/* ==============================================
   Master Stylesheet V10 - Final & Complete
   ============================================== */

/* ===== 1. Variables (Light & Dark Themes) ===== */
:root {
    --font-family-base: 'Cairo', sans-serif;
    
    /* Light Mode */
    --bg-main-light: #f4f7fa; --bg-card-light: #ffffff; --bg-header-light: #ffffff;
    --text-primary-light: #1a202c; --text-secondary-light: #718096;
    --border-color-light: #e2e8f0; --shadow-color-light: rgba(0, 0, 0, 0.05);
    --primary-color-light: #4a90e2; --primary-hover-light: #357abd;
    --success-color-light: #34d399; --warning-color-light: #f59e0b; --danger-color-light: #ef4444; --info-color-light: #0dcaf0;

    /* Dark Mode */
    --bg-main-dark: #121212; --bg-card-dark: #1e1e1e; --bg-header-dark: #1e1e1e;
    --text-primary-dark: #e5e7eb; --text-secondary-dark: #9ca3af;
    --border-color-dark: #374151; --shadow-color-dark: rgba(0, 0, 0, 0.2);
    --primary-color-dark: #60a5fa; --primary-hover-dark: #3b82f6;
    --success-color-dark: #4ade80; --warning-color-dark: #facc15; --danger-color-dark: #f87171; --info-color-dark: #33c3f3;
}

body {
    --bg-main: var(--bg-main-light); --bg-card: var(--bg-card-light); --bg-header: var(--bg-header-light);
    --text-primary: var(--text-primary-light); --text-secondary: var(--text-secondary-light);
    --border-color: var(--border-color-light); --shadow-color: var(--shadow-color-light);
    --primary-color: var(--primary-color-light); --primary-hover: var(--primary-hover-light);
    --success-color: var(--success-color-light); --warning-color: var(--warning-color-light); --danger-color: var(--danger-color-light); --info-color: var(--info-color-light);
}

body.dark-mode {
    --bg-main: var(--bg-main-dark); --bg-card: var(--bg-card-dark); --bg-header: var(--bg-header-dark);
    --text-primary: var(--text-primary-dark); --text-secondary: var(--text-secondary-dark);
    --border-color: var(--border-color-dark); --shadow-color: var(--shadow-color-dark);
    --primary-color: var(--primary-color-dark); --primary-hover: var(--primary-hover-dark);
    --success-color: var(--success-color-dark); --warning-color: var(--warning-color-dark); --danger-color: var(--danger-color-dark); --info-color: var(--info-color-dark);
}

/* ===== 2. Global Styles & Resets ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-family-base); background-color: var(--bg-main); color: var(--text-primary); line-height: 1.6; transition: background-color 0.3s, color 0.3s; }
.container { width: 100%; max-width: 1600px; margin: 0 auto; padding: 2rem; }
a { color: var(--primary-color); text-decoration: none; }
.page-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 2rem; display: flex; align-items: center; gap: 1rem; }

/* ===== 3. Main Dashboard Layout (Sidebar & Content) ===== */
.dashboard-container { display: flex; }
.sidebar { width: 260px; background-color: var(--bg-card); border-left: 1px solid var(--border-color); display: flex; flex-direction: column; height: 100vh; position: fixed; top: 0; right: 0; z-index: 1100; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.main-content { flex-grow: 1; margin-right: 260px; background-color: var(--bg-main); transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

/* Collapsed Sidebar for Desktop */
.sidebar--collapsed .sidebar { width: 80px; }
.sidebar--collapsed .main-content { margin-right: 80px; }
.sidebar--collapsed .sidebar .nav-link span, .sidebar--collapsed .sidebar .nav-title, .sidebar--collapsed .sidebar .logo-full { opacity: 0; visibility: hidden; width: 0; white-space: nowrap; }
.sidebar--collapsed .sidebar .logo-icon { display: block; }
.sidebar .logo-icon { display: none; }
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); text-align: center; height: 81px; flex-shrink: 0; }
.sidebar-logo-link img { height: 45px; transition: opacity 0.3s ease; }
.sidebar-nav { flex-grow: 1; overflow-y: auto; padding: 1rem; }
.nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-radius: 8px; color: var(--text-secondary); font-weight: 500; text-decoration: none; transition: background-color 0.2s, color 0.2s; white-space: nowrap; overflow: hidden; }
.nav-link span, .nav-title { transition: opacity 0.2s ease; }
.nav-link:hover, .nav-link.active { background-color: var(--bg-main); color: var(--primary-color); }
.nav-link i { width: 24px; height: 24px; flex-shrink: 0; }
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border-color); flex-shrink: 0; }
.logout-btn:hover { background-color: rgba(239, 68, 68, 0.1); color: var(--danger-color); }

/* ===== 4. Unified Header ===== */
.unified-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1.5rem; background-color: var(--bg-card); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 1000; }
.header-part { display: flex; align-items: center; gap: 1rem; }
.menu-toggle { background: none; border: none; color: var(--text-primary); cursor: pointer; padding: 0.5rem; display: flex; }
.menu-toggle i { width: 24px; height: 24px; }
.welcome-text { font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.welcome-text span { font-weight: 700; color: var(--text-primary); }
.balance-box { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 8px; background-color: var(--bg-main); border: 1px solid var(--border-color); white-space: nowrap; }
.balance-box span { font-weight: 600; }
.add-balance-btn { display: inline-flex; align-items: center; justify-content: center; color: var(--success-color); margin-right: 0.5rem; transition: transform 0.2s; }
.add-balance-btn:hover { transform: scale(1.2) rotate(90deg); }
.add-balance-btn i { width: 18px; height: 18px; }
.theme-toggle-btn { background: none; border: 1px solid var(--border-color); border-radius: 8px; cursor: pointer; width: 40px; height: 40px; display: flex; justify-content: center; align-items: center; color: var(--text-secondary); flex-shrink: 0; }

/* ===== 5. Form Pages (Login, Register) ===== */
.form-page-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 2rem 0; background-color: var(--bg-main); }
.form-container { width: 90%; max-width: 500px; padding: 2rem 2.5rem; background-color: var(--bg-card); border-radius: 20px; box-shadow: 0 10px 25px -5px var(--shadow-color); border: 1px solid var(--border-color); position: relative; }
.form-logo { text-align: center; margin-bottom: 1.5rem; }
.form-logo img { max-width: 130px; }
.form-container h2 { text-align: center; font-size: 1.8rem; margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: center; gap: 10px; }
.form-container h2 i { color: var(--primary-color); }
.styled-form .form-group { margin-bottom: 1.25rem; text-align: right; }
.styled-form label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.styled-form .form-control { width: 100%; padding: 12px 15px; border: 1px solid var(--border-color); border-radius: 8px; background-color: var(--bg-main); color: var(--text-primary); font-size: 1rem; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.styled-form .form-control:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.25); }
.bottom-link { text-align: center; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); }
.bottom-link a { font-weight: 600; text-decoration: none; }
.phone-input-group { display: flex; gap: 0; align-items: stretch; }
.phone-input-group select.country-code { width: 135px; flex-shrink: 0; border-left: none; border-radius: 0 8px 8px 0; appearance: none; background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23aaa" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>'); background-repeat: no-repeat; background-position: left 0.75rem center; background-size: 8px 10px; cursor: pointer; }
.phone-input-group input.mobile-number { border-radius: 8px 0 0 8px; text-align: left; direction: ltr; }
.phone-input-group select.country-code:focus, .phone-input-group input.mobile-number:focus { z-index: 2; }

/* ===== 6. Reusable Components (Cards, Buttons, etc.) ===== */
.btn, .btn-custom { display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 0.75rem 1.25rem; border-radius: 8px; border: 1px solid transparent; font-family: var(--font-family-base); font-size: 0.95rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: all 0.2s ease-in-out; }
.btn i, .btn-custom i { width: 18px; height: 18px; }
.btn:hover, .btn-custom:hover { transform: translateY(-2px); box-shadow: 0 4px 8px var(--shadow-color); }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: transparent; color: var(--text-primary); border-color: var(--border-color); }
.btn-secondary:hover { background-color: var(--bg-main); }
.btn-success { background-color: var(--success-color); color: white; }
.btn-info { background-color: var(--info-color); color: white; }
.btn-danger { background-color: var(--danger-color); color: white; }
.w-100 { width: 100%; }
.section-card { background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow-sm); }

/* ===== 7. Mobile Responsiveness ===== */
.mobile-header { display: none; } /* This is an old element, hide it just in case */
.sidebar-overlay { display: none; }

@media (max-width: 1024px) {
    .main-content { margin-right: 0 !important; }
    .sidebar { transform: translateX(100%); width: 260px !important; }
    .sidebar.is-open { transform: translateX(0); box-shadow: -5px 0 25px rgba(0,0,0,0.2); }
    .sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 1050; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; }
    .body--sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
    
    .unified-header .desktop-only { display: none; }
    .unified-header { padding: 0.75rem 1rem; }
}

@media (max-width: 768px) {
    .container { padding: 1rem; }
    .dashboard-layout { grid-template-columns: 1fr; }
    .quick-stats-grid { grid-template-columns: 1fr; }
    .header-part.left { gap: 0.5rem; }
    .balance-box { padding: 0.5rem; }
}

/* ===== 8. Utilities & Extras (Notifications, Loader, etc.) ===== */
#notification-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; min-width: 300px; max-width: 90%; display: flex; flex-direction: column; gap: 0.75rem; }
.notification { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 8px; color: white; box-shadow: 0 4px 15px rgba(0,0,0,0.1); transform: translateY(-20px); opacity: 0; animation: slideIn 0.5s forwards; }
.notification.success { background-color: var(--success-color); }
.notification.error { background-color: var(--danger-color); }
@keyframes slideIn { to { transform: translateY(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-20px); opacity: 0; } }
.notification.fade-out { animation: slideOut 0.5s forwards; }
.loader { border: 4px solid var(--border-color); border-top: 4px solid var(--primary-color); border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
body.dark-mode .swal2-popup { background-color: var(--bg-card-dark) !important; color: var(--text-primary-dark) !important; border: 1px solid var(--border-color-dark); }
body.dark-mode .swal2-title, body.dark-mode .swal2-html-container { color: var(--text-primary-dark) !important; }

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: #e2e8f0; /* لون الخلفية */
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 5px;
    width: 0%; /* يبدأ دائمًا من صفر */
    transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1); /* <<-- هذا هو السطر الأهم للحركة الناعمة */
}

/* الألوان حسب الحالة */
.progress-bar-fill.ok { background-color: #10B981; } /* أخضر */
.progress-bar-fill.warning { background-color: #F59E0B; } /* أصفر */
.progress-bar-fill.danger { background-color: #EF4444; } /* أحمر */

.usage-percentage.ok { color: #10B981; }
.usage-percentage.warning { color: #F59E0B; }
.usage-percentage.danger { color: #EF4444; }

:root {
    --font-family-base: 'Cairo', sans-serif;
    
    /* Light Mode */
    --bg-main-light: #f4f7fa; --bg-card-light: #ffffff; --bg-header-light: #ffffff;
    --text-primary-light: #1a202c; --text-secondary-light: #718096;
    --border-color-light: #e2e8f0; --shadow-color-light: rgba(0, 0, 0, 0.05);
    --primary-color-light: #4a90e2; --primary-hover-light: #357abd;
    --success-color-light: #34d399; --warning-color-light: #f59e0b; --danger-color-light: #ef4444; --info-color-light: #0dcaf0;

    /* Dark Mode */
    --bg-main-dark: #121212; --bg-card-dark: #1e1e1e; --bg-header-dark: #1e1e1e;
    --text-primary-dark: #e5e7eb; --text-secondary-dark: #9ca3af;
    --border-color-dark: #374151; --shadow-color-dark: rgba(0, 0, 0, 0.2);
    --primary-color-dark: #60a5fa; --primary-hover-dark: #3b82f6;
    --success-color-dark: #4ade80; --warning-color-dark: #facc15; --danger-color-dark: #f87171; --info-color-dark: #33c3f3;
}

body {
    --bg-main: var(--bg-main-light); --bg-card: var(--bg-card-light); --bg-header: var(--bg-header-light);
    --text-primary: var(--text-primary-light); --text-secondary: var(--text-secondary-light);
    --border-color: var(--border-color-light); --shadow-color: var(--shadow-color-light);
    --primary-color: var(--primary-color-light); --primary-hover: var(--primary-hover-light);
    --success-color: var(--success-color-light); --warning-color: var(--warning-color-light); --danger-color: var(--danger-color-light); --info-color: var(--info-color-light);
}

body.dark-mode {
    --bg-main: var(--bg-main-dark); --bg-card: var(--bg-card-dark); --bg-header: var(--bg-header-dark);
    --text-primary: var(--text-primary-dark); --text-secondary: var(--text-secondary-dark);
    --border-color: var(--border-color-dark); --shadow-color: var(--shadow-color-dark);
    --primary-color: var(--primary-color-dark); --primary-hover: var(--primary-hover-dark);
    --success-color: var(--success-color-dark); --warning-color: var(--warning-color-dark); --danger-color: var(--danger-color-dark); --info-color: var(--info-color-dark);
}

/* ===== 2. Global Styles & Resets ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-family-base); background-color: var(--bg-main); color: var(--text-primary); line-height: 1.6; transition: background-color 0.3s, color 0.3s; }
.container { width: 100%; max-width: 1600px; margin: 0 auto; padding: 2rem; }
a { color: var(--primary-color); text-decoration: none; }
.page-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 2rem; display: flex; align-items: center; gap: 1rem; }

/* ===== 3. Main Dashboard Layout (Sidebar & Content) ===== */
.dashboard-container { display: flex; }
.sidebar { width: 260px; background-color: var(--bg-card); border-left: 1px solid var(--border-color); display: flex; flex-direction: column; height: 100vh; position: fixed; top: 0; right: 0; z-index: 1100; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.main-content { flex-grow: 1; margin-right: 260px; background-color: var(--bg-main); transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
/* Collapsed Sidebar for Desktop */
.sidebar--collapsed .sidebar { width: 80px; }
.sidebar--collapsed .main-content { margin-right: 80px; }
.sidebar--collapsed .sidebar .nav-link span, .sidebar--collapsed .sidebar .nav-title, .sidebar--collapsed .sidebar .logo-full { opacity: 0; visibility: hidden; width: 0; white-space: nowrap; }
.sidebar--collapsed .sidebar .logo-icon { display: block; }
.sidebar .logo-icon { display: none; }
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); text-align: center; height: 81px; flex-shrink: 0; }
.sidebar-logo-link img { height: 45px; transition: opacity 0.3s ease; }
.sidebar-nav { flex-grow: 1; overflow-y: auto; padding: 1rem; }
.nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-radius: 8px; color: var(--text-secondary); font-weight: 500; text-decoration: none; transition: background-color 0.2s, color 0.2s; white-space: nowrap; overflow: hidden; }
.nav-link.active, .nav-link:hover { background-color: var(--bg-main); color: var(--primary-color); }
.nav-link i { width: 24px; height: 24px; flex-shrink: 0; }
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border-color); flex-shrink: 0; }
.logout-btn:hover { background-color: rgba(239, 68, 68, 0.1); color: var(--danger-color); }
.nav-title { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; margin: 1.5rem 0 0.5rem; padding: 0 0.5rem; transition: opacity 0.2s ease; }

/* ===== 4. Unified Header ===== */
.unified-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1.5rem; background-color: var(--bg-card); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 1000; }
.header-part { display: flex; align-items: center; gap: 1rem; }
.menu-toggle { background: none; border: none; color: var(--text-primary); cursor: pointer; padding: 0.5rem; display: flex; }
.menu-toggle i { width: 24px; height: 24px; }
.welcome-text { font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.welcome-text span { font-weight: 700; color: var(--text-primary); }
.balance-box { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 8px; background-color: var(--bg-main); border: 1px solid var(--border-color); white-space: nowrap; }
.balance-box span { font-weight: 600; }
.add-balance-btn { display: inline-flex; align-items: center; justify-content: center; color: var(--success-color); margin-right: 0.5rem; transition: transform 0.2s; }
.add-balance-btn:hover { transform: scale(1.2) rotate(90deg); }
.add-balance-btn i { width: 18px; height: 18px; }
.theme-toggle-btn { background: none; border: 1px solid var(--border-color); border-radius: 8px; cursor: pointer; width: 40px; height: 40px; display: flex; justify-content: center; align-items: center; color: var(--text-secondary); flex-shrink: 0; }

/* ===== 5. Form Pages (Login, Register, etc.) ===== */
.form-page-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 2rem 0; background-color: var(--bg-main); }
.form-container { width: 90%; max-width: 500px; padding: 2rem 2.5rem; background-color: var(--bg-card); border-radius: 20px; box-shadow: 0 10px 25px -5px var(--shadow-color); border: 1px solid var(--border-color); position: relative; }
.form-logo { text-align: center; margin-bottom: 1.5rem; }
.form-logo img { max-width: 130px; }
.form-container h2 { text-align: center; font-size: 1.8rem; margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: center; gap: 10px; }
.form-container h2 i { color: var(--primary-color); }
.styled-form .form-group { margin-bottom: 1.25rem; text-align: right; }
.styled-form label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.styled-form .form-control { width: 100%; padding: 12px 15px; border: 1px solid var(--border-color); border-radius: 8px; background-color: var(--bg-main); color: var(--text-primary); font-size: 1rem; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.styled-form .form-control:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.25); }
.bottom-link { text-align: center; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); }
.bottom-link a { font-weight: 600; text-decoration: none; }
.phone-input-group { display: flex; gap: 0; align-items: stretch; }
.phone-input-group select.country-code { width: 135px; flex-shrink: 0; border-left: none; border-radius: 0 8px 8px 0; appearance: none; background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23aaa" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>'); background-repeat: no-repeat; background-position: left 0.75rem center; background-size: 8px 10px; cursor: pointer; }
.phone-input-group input.mobile-number { border-radius: 8px 0 0 8px; text-align: left; direction: ltr; }

/* ===== 6. Reusable Components (Cards, Buttons, etc.) ===== */
.btn, .btn-custom { display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 0.75rem 1.25rem; border-radius: 8px; border: 1px solid transparent; font-family: var(--font-family-base); font-size: 0.95rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: all 0.2s ease-in-out; }
.btn i, .btn-custom i { width: 18px; height: 18px; }
.btn:hover, .btn-custom:hover { transform: translateY(-2px); box-shadow: 0 4px 8px var(--shadow-color); }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: transparent; color: var(--text-primary); border-color: var(--border-color); }
.btn-secondary:hover { background-color: var(--bg-main); }
.btn-success { background-color: var(--success-color); color: white; }
.btn-info { background-color: var(--info-color); color: white; }
.btn-danger { background-color: var(--danger-color); color: white; }
.w-100 { width: 100%; }
.section-card { background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow-sm); }
.section-card-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.section-card-header i { width: 24px; height: 24px; color: var(--primary-color); }
.section-card-header h3 { font-size: 1.2rem; font-weight: 600; }
.status-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.8rem; border-radius: 99px; font-weight: 600; font-size: 0.9rem; }
.status-badge.active, .status-badge.approved { background-color: rgba(52, 211, 153, 0.1); color: var(--success-color); }
.status-badge.inactive, .status-badge.rejected { background-color: rgba(108, 117, 125, 0.1); color: var(--text-secondary); }
.status-badge.pending { background-color: rgba(245, 158, 11, 0.1); color: var(--warning-color); }
.status-badge.warning { background-color: rgba(245, 158, 11, 0.1); color: var(--warning-color); }
.status-badge i { width: 14px; height: 14px; }
.table-wrapper { width: 100%; overflow-x: auto; }
.styled-table { width: 100%; border-collapse: collapse; }
.styled-table thead th { text-align: right; padding: 1rem 1.25rem; color: var(--text-secondary); font-weight: 600; font-size: 0.9rem; text-transform: uppercase; border-bottom: 2px solid var(--border-color); white-space: nowrap; }
.styled-table tbody td { padding: 1.25rem; text-align: right; border-bottom: 1px solid var(--border-color); color: var(--text-primary); vertical-align: middle; white-space: nowrap; }
.styled-table tbody tr:last-child td { border-bottom: none; }
.styled-table tbody tr:hover { background-color: var(--bg-main); }
.no-records { text-align: center; padding: 3rem 1rem; font-size: 1.1rem; color: var(--text-secondary); display:flex; flex-direction:column; align-items:center; gap: 1rem; }

/* ===== 7. Mobile Responsiveness ===== */
.mobile-header { display: none; } 
.sidebar-overlay { display: none; }

@media (max-width: 1024px) {
    .main-content { margin-right: 0 !important; }
    .sidebar { transform: translateX(100%); width: 260px !important; }
    .sidebar.is-open { transform: translateX(0); box-shadow: -5px 0 25px rgba(0,0,0,0.2); }
    .sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 1050; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; }
    .body--sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
    .mobile-header { display: flex; position: sticky; top: 0; background-color: var(--bg-header); padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); z-index: 1000; align-items: center; justify-content: space-between; }
    .mobile-logo img { height: 35px; }
    .container { padding: 1.5rem 1rem; }
    .page-title { font-size: 1.5rem; margin-bottom: 1.5rem; }
}

@media (max-width: 768px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .quick-stats-grid { grid-template-columns: 1fr; }
    .header-part.left { gap: 0.5rem; }
    .balance-box { padding: 0.5rem; }
    .styled-table thead { display: none; }
    .styled-table, .styled-table tbody, .styled-table tr, .styled-table td { display: block; width: 100%; }
    .styled-table tr { margin-bottom: 1rem; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
    .styled-table td { display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 0.75rem 1rem; white-space: normal; }
    .styled-table td:not(:last-child) { border-bottom: 1px dashed var(--border-color); }
    .styled-table td::before { content: attr(data-label); font-weight: 600; color: var(--text-secondary); margin-left: 1rem; text-align: right; }
}

/* ===== 8. Utilities & Extras (Notifications, Loader, etc.) ===== */
#notification-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; min-width: 300px; max-width: 90%; display: flex; flex-direction: column; gap: 0.75rem; }
.notification { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 8px; color: white; box-shadow: 0 4px 15px rgba(0,0,0,0.1); transform: translateY(-20px); opacity: 0; animation: slideIn 0.5s forwards; }
.notification.success { background-color: var(--success-color); }
.notification.error { background-color: var(--danger-color); }
@keyframes slideIn { to { transform: translateY(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-20px); opacity: 0; } }
.notification.fade-out { animation: slideOut 0.5s forwards; }
.loader { border: 4px solid var(--border-color); border-top: 4px solid var(--primary-color); border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }
body.dark-mode .swal2-popup { background-color: var(--bg-card-dark) !important; color: var(--text-primary-dark) !important; border: 1px solid var(--border-color-dark); }
body.dark-mode .swal2-title, body.dark-mode .swal2-html-container { color: var(--text-primary-dark) !important; }