/* style.css - النسخة النهائية المجمعة (الوضع المزدوج: ذهب + نقدية) */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

:root {
    --gold-primary: #D4AF37;
    --gold-hover: #F3E5AB;
    --bg-dark: #0f1115;       
    --bg-card: #161920;       
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #2d3038;
    --nav-height-mobile: 70px;
    --modal-bg: #1e2126;
    --input-bg: #2b303b;
    --input-border: #424855;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main) !important;
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    margin: 0;
    overflow-x: hidden;
}

/* ================== إصلاح ألوان النصوص ================== */
h1, h2, h3, h4, h5, h6, span, div, p, label, small, b, strong { color: #ffffff !important; }
.text-muted { color: #a0a0a0 !important; }
.text-black { color: #000 !important; } 

.text-warning { color: #ffc107 !important; }
.text-danger { color: #ff6b6b !important; }   
.text-success { color: #2ecc71 !important; }  
.text-info { color: #48dbfb !important; }     

h2 { border-bottom: 2px solid #222; padding-bottom: 15px; display: inline-block; }

/* ================== إصلاح خانات التاريخ ================== */
.input-date-custom {
    direction: ltr !important;       
    text-align: right !important;    
    cursor: pointer;
    font-size: 1.1rem !important;
    padding: 12px !important;
    color: #ffffff !important;       
    background-color: var(--input-bg) !important; 
    border: 1px solid var(--input-border) !important;
    border-radius: 8px;
    height: 50px;                    
}

.input-date-custom::-webkit-calendar-picker-indicator {
    filter: invert(1) !important;    
    opacity: 1 !important;
    cursor: pointer;
    width: 22px;
    height: 22px;
    margin-left: 10px;
}

/* ================== تنسيق التبويبات والأزرار ================== */
.nav-pills .nav-link {
    color: #888 !important;
    background: transparent;
    border: 1px solid transparent;
    transition: 0.3s;
}
.nav-pills .nav-link:hover {
    color: #fff !important;
}
.nav-pills .nav-link.active {
    background-color: var(--gold-primary) !important;
    color: #000 !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-check:checked + .btn-outline-warning {
    background-color: #ffc107;
    color: #000 !important;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.4);
}
.btn-check:checked + .btn-outline-success {
    background-color: #198754;
    color: #fff !important;
    box-shadow: 0 0 10px rgba(25, 135, 84, 0.4);
}

/* ================== تصميم منتقي التاريخ الرئيسي ================== */
.date-trigger-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 10px 20px;
    cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    transition: all 0.3s ease; min-width: 250px;
}
.date-trigger-box:hover { border-color: var(--gold-primary); box-shadow: 0 0 10px rgba(212, 175, 55, 0.1); }
.date-trigger-text { font-weight: 700; font-size: 1.1rem; color: #fff; }
.date-trigger-icon { color: var(--gold-primary); font-size: 1.2rem; }

/* مودال الشهور */
.month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; padding: 20px 0; }
.month-btn {
    background-color: transparent; border: 1px solid #444; color: #fff; padding: 15px;
    border-radius: 12px; font-weight: 600; transition: all 0.2s;
}
.month-btn:hover { background-color: #333; border-color: #666; }
.month-btn.active {
    background-color: #198754 !important; color: #fff !important; border-color: #198754 !important;
    box-shadow: 0 5px 15px rgba(25, 135, 84, 0.3);
}
.year-selector-header {
    display: flex; justify-content: center; align-items: center; gap: 20px;
    margin-bottom: 10px; background: #111; padding: 10px; border-radius: 12px;
}
.year-nav-btn { background: none; border: none; color: var(--gold-primary); font-size: 1.2rem; cursor: pointer; }
.year-display { font-size: 1.5rem; font-weight: bold; color: #fff; }

/* صفحة الدخول */
body.login-page {
    margin: 0; padding: 0; width: 100%; min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at top right, #252830 0%, #000000 100%);
    overflow-y: auto;
}
.login-container { width: 100%; padding: 20px; display: flex; justify-content: center; }
.login-card {
    width: 100%; max-width: 400px; background-color: #161920;
    border: 1px solid #2d3038; border-radius: 20px; padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6); position: relative; overflow: hidden; color: #fff;
}
.login-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, transparent, #D4AF37, transparent);
}
.login-header { text-align: center; margin-bottom: 35px; }
.login-icon-box {
    width: 70px; height: 70px; background: rgba(212, 175, 55, 0.1);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 15px auto; border: 1px solid rgba(212, 175, 55, 0.3);
}
.login-icon-box i { font-size: 30px; color: #D4AF37; }
.login-header h3 { color: #fff; font-weight: 700; font-size: 1.5rem; margin: 0; }
.login-header p { color: #888; font-size: 0.9rem; margin-top: 5px; }

.input-group-modern { position: relative; margin-bottom: 20px; }
.input-group-modern i {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    color: #666; font-size: 1.1rem; z-index: 2; transition: 0.3s;
}
.form-control-modern {
    width: 100%; background-color: #0a0c10; border: 2px solid #2d3038;
    color: #fff; padding: 14px 50px 14px 15px; border-radius: 12px;
    font-size: 1rem; transition: all 0.3s ease; outline: none;
}
.form-control-modern:focus { border-color: #D4AF37; background-color: #000; box-shadow: 0 0 15px rgba(212, 175, 55, 0.1); }
.form-control-modern:focus + i { color: #D4AF37; }

.btn-login-modern {
    width: 100%; padding: 15px; background: linear-gradient(135deg, #D4AF37, #c5a028);
    color: #000; font-weight: 800; font-size: 1.1rem; border: none; border-radius: 12px;
    cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; margin-top: 10px;
}
.btn-login-modern:hover { box-shadow: 0 5px 25px rgba(212, 175, 55, 0.3); }
.error-message { color: #ff4d4d; text-align: center; font-size: 0.9rem; margin-top: 15px; min-height: 20px; }
.footer-copy { text-align: center; color: #444; font-size: 0.8rem; margin-top: 30px; }

/* الخانات العامة */
.form-control, .form-select, input, select, textarea {
    background-color: #000000 !important;
    border: 1px solid #333 !important;
    color: #ffffff !important;
    padding: 12px 15px;
    border-radius: 8px;
}
::placeholder { color: #888 !important; opacity: 1; }
.form-control:focus, .form-select:focus {
    background-color: #050505 !important;
    border-color: var(--gold-primary) !important;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2) !important;
    color: #ffffff !important;
}
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #000000 inset !important;
    -webkit-text-fill-color: white !important;
}

/* المودال */
.custom-modal-style {
    background-color: var(--modal-bg) !important;
    border: 1px solid #333;
    box-shadow: 0 20px 60px rgba(0,0,0,0.9);
    border-radius: 16px;
    overflow: hidden;
}
.bg-dark-header {
    background-color: #16191d;
    padding: 20px 25px;
    border-bottom: 1px solid #2c3038;
    position: relative;
}
.modal-header .btn-close {
    position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
    margin: 0 !important; background-color: rgba(255,255,255,0.05);
    border-radius: 50%; padding: 12px; opacity: 1; filter: invert(1);
    transition: 0.3s; background-size: 10px;
}
.modal-header .btn-close:hover { background-color: #dc3545; transform: translateY(-50%) rotate(90deg); }

.input-premium {
    background-color: var(--input-bg) !important; 
    border: 1px solid var(--input-border) !important;
    color: #ffffff !important;
    border-radius: 10px; padding: 14px; font-size: 1rem; transition: 0.3s;
}
.input-premium:focus {
    background-color: #323844 !important;
    border-color: var(--gold-primary) !important;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15) !important;
}

.balance-card-modern {
    background: linear-gradient(135deg, #16191d 0%, #1f2329 100%);
    border: 1px solid #333; border-right: 4px solid var(--gold-primary);
    border-radius: 12px; padding: 20px; margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.balance-card-modern small, .balance-card-modern h2, .balance-card-modern h3 { color: #fff !important; }

.nav-pills-modern { background-color: #111316; padding: 5px; border-radius: 12px; border: 1px solid #2c3038; }
.nav-pills-modern .nav-link { border-radius: 8px; color: #888 !important; font-weight: 600; padding: 10px; transition: 0.3s; }
.nav-pills-modern .nav-link.active { color: #fff !important; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.nav-pills-modern .nav-link.active#pills-deposit-tab { background-color: #198754; }
.nav-pills-modern .nav-link.active#pills-withdraw-tab { background-color: #dc3545; }

.btn-delete-modern {
    background: rgba(220, 53, 69, 0.1); color: #dc3545 !important;
    border: 1px dashed #dc3545; border-radius: 8px; padding: 10px; transition: 0.3s;
}
.btn-delete-modern:hover { background: #dc3545; color: #fff !important; }

/* الجداول */
.table-modern-container {
    background-color: #16191d; border-radius: 12px; border: 1px solid #2c3038;
    overflow: hidden; height: 100%;
}
.table-modern, .table-modern > :not(caption) > * > * {
    background-color: transparent !important; color: #ffffff !important;
    box-shadow: none !important; border-bottom-color: #2d3038 !important;
    text-align: center !important;
}
.table-modern th {
    background-color: #111316 !important; color: #8a909d !important;
    font-weight: 600; font-size: 0.85rem; text-transform: uppercase; padding: 15px;
}
.table-modern td { padding: 15px; vertical-align: middle; }
.table-modern tr:hover td { background-color: rgba(255, 255, 255, 0.05) !important; }

.table-responsive { border-radius: 12px; overflow-x: auto; background-color: var(--bg-card); border: 1px solid var(--border-color); }
.table-custom { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 600px; }
.table-custom th, .table-custom td {
    text-align: center !important; vertical-align: middle !important; padding: 15px !important;
}
.table-custom th { background-color: #000 !important; color: var(--gold-primary) !important; border-bottom: 1px solid #333; }
.table-custom td { color: #fff !important; border-bottom: 1px solid #222; background-color: transparent !important; }
#usersTable tr, #usersTable td { background-color: transparent !important; color: #fff !important; }

.badge { display: inline-block !important; padding: 0.5em 0.8em; font-size: 0.85em; font-weight: 500; border-radius: 6px; }
.table-modern-container .badge.bg-secondary { display: none !important; }

.custom-card, .stat-card {
    background-color: var(--bg-card) !important; color: var(--text-main);
    border: 1px solid var(--border-color); border-radius: 16px; padding: 25px; margin-bottom: 20px;
}
.stat-title { color: var(--text-muted) !important; margin-bottom: 10px; }
.stat-value { color: var(--gold-primary) !important; font-size: 1.8rem; font-weight: 700; }
.btn-gold {
    background: linear-gradient(135deg, var(--gold-primary), #b8952b);
    color: #000 !important; font-weight: 700; border: none; padding: 10px 25px; border-radius: 8px;
}
.btn-gold:hover { background: linear-gradient(135deg, #F3E5AB, var(--gold-primary)); }
.section-content { display: none; animation: fadeIn 0.4s ease-in-out; }
.active-section { display: block; }
@keyframes fadeIn { from {opacity: 0; transform: translateY(10px);} to {opacity: 1; transform: translateY(0);} }
.alert-dark, .alert-info, .alert-warning {
    background-color: rgba(255, 255, 255, 0.05) !important; border: 1px solid #333 !important; color: #cccccc !important;
}

/* التجاوب */
@media (min-width: 992px) {
    .sidebar { width: 260px; height: 100vh; background: #000000; position: fixed; right: 0; top: 0; border-left: 1px solid #222; z-index: 1000; display: flex; flex-direction: column; overflow-y: auto; }
    .sidebar::-webkit-scrollbar { width: 6px; }
    .sidebar::-webkit-scrollbar-track { background: #000; }
    .sidebar::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
    .main-content { margin-right: 260px; padding: 30px; }
    .brand-box { text-align: center; padding: 30px 0; border-bottom: 1px solid #222; }
    .brand-box i { color: var(--gold-primary); font-size: 2rem; }
    .brand-box h4 { color: #fff; margin-top: 10px; }
    .nav-link { color: var(--text-muted) !important; padding: 18px 25px; cursor: pointer; display: flex; align-items: center; border-right: 4px solid transparent; transition: 0.3s; }
    .nav-link:hover, .nav-link.active { background: #111; color: var(--gold-primary) !important; border-right-color: var(--gold-primary); }
    .nav-link i { margin-left: 15px; width: 25px; text-align: center; }
    #logoutBtn { margin-top: auto; border-top: 1px solid #222; }
    .mobile-bottom-nav, .mobile-more-menu, .menu-overlay { display: none !important; }
}
@media (max-width: 991px) {
    .sidebar { display: none !important; }
    .main-content { margin-right: 0; padding: 15px; padding-bottom: 90px; }
    .mobile-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-height-mobile); background-color: #000000; border-top: 1px solid #222; display: flex; justify-content: space-around; align-items: center; z-index: 2000; box-shadow: 0 -5px 20px rgba(0,0,0,0.5); }
    .nav-item-mobile { color: #666 !important; text-align: center; font-size: 0.75rem; cursor: pointer; flex: 1; padding: 10px 0; display: flex; flex-direction: column; align-items: center; }
    .nav-item-mobile.active { color: var(--gold-primary) !important; }
    .mobile-more-menu { position: fixed; bottom: -100%; left: 0; right: 0; background-color: var(--bg-card); border-top-left-radius: 20px; border-top-right-radius: 20px; padding: 20px; z-index: 2001; transition: bottom 0.3s ease; border-top: 2px solid var(--gold-primary); }
    .mobile-more-menu.open { bottom: var(--nav-height-mobile); }
    .menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 2000; display: none; backdrop-filter: blur(2px); }
    .menu-overlay.show { display: block; }
    .more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .more-item { background: #000; border: 1px solid #333; border-radius: 10px; padding: 15px; text-align: center; color: #fff; }
}
@media (max-width: 768px) {
    .table-custom th, .table-custom td { padding: 10px 5px !important; font-size: 0.8rem !important; white-space: nowrap; }
}

/* ===================== تنسيقات نافذة اختيار الجرد الجديدة ===================== */
.inventory-list-box {
    max-height: 300px;
    overflow-y: auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}

/* تنسيق شريط التمرير للقائمة */
.inventory-list-box::-webkit-scrollbar { width: 5px; }
.inventory-list-box::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

.inv-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #333;
    transition: 0.2s;
}
.inv-item:hover { background-color: rgba(255,255,255,0.05); }
.inv-item:last-child { border-bottom: none; }
.inv-item label { cursor: pointer; flex-grow: 1; margin-right: 10px; font-size: 0.95rem; }
.form-check-input:checked {
    background-color: var(--gold-primary);
    border-color: var(--gold-primary);
}