/* ═══════════════════════════════════════════════════════════
   CSS Variables - Dark Mode (Default) + Light Mode
   ═══════════════════════════════════════════════════════════ */
:root {
    /* ── Dark Mode (الافتراضي) ── */
    --bg-primary: #0f172a;           /* خلفية رئيسية */
    --bg-secondary: #1e293b;         /* خلفية ثانوية */
    --bg-card: #1e293b;              /* خلفية البطاقات */
    --bg-sidebar: #0f172a;           /* خلفية السايدبار */
    --bg-input: #334155;             /* خلفية المدخلات */
    --bg-hover: #334155;             /* عند التمرير */
    
    --text-primary: #f1f5f9;         /* نص رئيسي */
    --text-secondary: #94a3b8;       /* نص ثانوي */
    --text-muted: #64748b;           /* نص خافت */
    
    --border-color: #334155;         /* حدود */
    --border-hover: #475569;         /* حدود عند التمرير */
    
    --accent-primary: #667eea;       /* لون أساسي */
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.6);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.7);
}

/* ── Light Mode ── */
[data-theme="light"] {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-sidebar: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    --bg-input: #ffffff;
    --bg-hover: #f8f9ff;
    
    --text-primary: #2c3e50;
    --text-secondary: #555555;
    --text-muted: #7f8c8d;
    
    --border-color: #e0e0e0;
    --border-hover: #667eea;
    
    --accent-primary: #667eea;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.2);
}

/* ═══════════════════════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════
   Login Page
   ═══════════════════════════════════════════════════════════ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--accent-gradient);
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: var(--bg-card);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.login-logo {
    text-align: center;
    margin-bottom: 35px;
}

.logo-icon {
    font-size: 60px;
    margin-bottom: 10px;
}

.login-logo h1 {
    font-size: 28px;
    color: var(--accent-primary);
    margin-bottom: 5px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 15px;
    transition: border 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.7;
}

.error-msg {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.error-msg.hidden {
    display: none;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════
   Dashboard Layout
   ═══════════════════════════════════════════════════════════ */
body:not(.login-page) {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    font-size: 48px;
    margin-bottom: 10px;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: rgba(102,126,234,0.3);
    color: white;
    border-right: 4px solid var(--accent-primary);
}

.nav-icon {
    font-size: 22px;
    margin-left: 15px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ── Theme Toggle Button ── */
.theme-toggle {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.user-icon {
    font-size: 32px;
    margin-left: 12px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.btn-change-password {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-change-password:hover {
    background: rgba(255,255,255,0.25);
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(231,76,60,0.8);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #e74c3c;
}

.main-content {
    margin-right: 260px;
    flex: 1;
    padding: 30px;
    width: calc(100% - 260px);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 28px;
    color: var(--text-primary);
}

.btn-toggle-sidebar {
    display: none;
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
}

.header-date {
    color: var(--text-muted);
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════
   Cards & Sections
   ═══════════════════════════════════════════════════════════ */
.section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 20px;
    color: var(--text-primary);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.card {
    background: var(--accent-gradient);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.card-red {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.card-gray {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.card-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.card-label {
    font-size: 14px;
    opacity: 0.9;
}

.card-sub {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   Forms & Inputs
   ═══════════════════════════════════════════════════════════ */
.router-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.router-selector label {
    font-weight: 600;
    color: var(--text-secondary);
}

.router-selector select,
.router-selector input[type="date"] {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid var(--border-color);
}

.form-section h4 {
    margin-bottom: 15px;
    color: var(--accent-primary);
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: auto;
    margin-left: 10px;
}

/* ═══════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════ */
.btn-primary {
    padding: 10px 20px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.btn-secondary:hover {
    background: var(--border-hover);
}

.btn-danger {
    padding: 6px 14px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.btn-edit {
    padding: 6px 14px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.btn-collect {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.btn-collect:hover {
    background: linear-gradient(135deg, #0d7a71, #2bc465);
}

.btn-warning {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    color: #333;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.btn-warning:hover {
    filter: brightness(0.9);
}

.filter-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-filter {
    padding: 6px 14px;
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-filter.active {
    background: var(--accent-primary);
    color: white;
}

.btn-filter.btn-red.active {
    background: #e74c3c;
    color: white;
}

.btn-filter.btn-yellow.active {
    background: #f39c12;
    color: white;
}

.btn-filter.btn-green.active {
    background: #27ae60;
    color: white;
}

.btn-filter.btn-gray.active {
    background: #95a5a6;
    color: white;
}

/* ═══════════════════════════════════════════════════════════
   Tables
   ═══════════════════════════════════════════════════════════ */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: var(--bg-hover);
    padding: 12px 15px;
    text-align: right;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table .text-center {
    text-align: center;
}

.text-download {
    color: #2ecc71;
    font-weight: 600;
}

.text-upload {
    color: #e67e22;
    font-weight: 600;
}

.text-total {
    color: var(--accent-primary);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   Badges
   ═══════════════════════════════════════════════════════════ */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-high {
    background: #fde8e8;
    color: #c0392b;
}

.badge-medium {
    background: #fef9e7;
    color: #d68910;
}

.badge-low {
    background: #e9f7ef;
    color: #1e8449;
}

.badge-zero {
    background: #f0f0f0;
    color: #7f8c8d;
    border: 1px solid #bdc3c7;
}

.badge-active {
    background: #e9f7ef;
    color: #1e8449;
}

.badge-inactive {
    background: #fde8e8;
    color: #c0392b;
}

/* ═══════════════════════════════════════════════════════════
   Modal
   ═══════════════════════════════════════════════════════════ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
}

.modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    width: 100%;
    max-width: 550px;
    margin: auto;
    box-shadow: var(--shadow-lg);
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 5px;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    margin-top: 20px;
}

/* Modal - Change Password */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-box {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s ease;
}

.modal-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.success-msg {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

.force-change-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   Chart
   ═══════════════════════════════════════════════════════════ */
.chart-container {
    position: relative;
    height: 300px;
    padding: 10px;
}

/* ═══════════════════════════════════════════════════════════
   View Tabs
   ═══════════════════════════════════════════════════════════ */
.view-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 24px;
    border: 2px solid var(--accent-primary);
    border-radius: 8px;
    background: transparent;
    color: var(--accent-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--accent-primary);
    color: white;
}

/* ═══════════════════════════════════════════════════════════
   Filter Pills
   ═══════════════════════════════════════════════════════════ */
.filter-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    justify-content: center;
}

.pill-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pill-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.pill-btn.active {
    color: white;
    border-color: currentColor;
}

.pill-btn.filter-all.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.pill-btn.filter-high.active {
    background: #e74c3c;
    border-color: #e74c3c;
}

.pill-btn.filter-medium.active {
    background: #f39c12;
    border-color: #f39c12;
}

.pill-btn.filter-low.active {
    background: #f1c40f;
    border-color: #f1c40f;
    color: #333;
}

.pill-btn.filter-zero.active {
    background: #95a5a6;
    border-color: #95a5a6;
}

/* ═══════════════════════════════════════════════════════════
   Date Range Filter
   ═══════════════════════════════════════════════════════════ */
.date-range-filter {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.date-range-filter label {
    font-weight: 500;
    color: var(--text-secondary);
}

.date-range-filter input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════
   Comments Column
   ═══════════════════════════════════════════════════════════ */
.comment-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-muted);
    font-size: 0.9em;
    font-style: italic;
}

.comment-cell:hover {
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    background: var(--bg-hover);
    padding: 8px;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 10;
}

/* ═══════════════════════════════════════════════════════════
   Toast Notifications
   ═══════════════════════════════════════════════════════════ */
.toast-msg {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    z-index: 9999;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s ease;
}

.toast-success {
    background: #2ecc71;
    color: white;
}

.toast-error {
    background: #e74c3c;
    color: white;
}

@keyframes toastIn {
    from { opacity: 0; top: 0; }
    to { opacity: 1; top: 24px; }
}

/* ═══════════════════════════════════════════════════════════
   Utilities
   ═══════════════════════════════════════════════════════════ */
.hidden {
    display: none !important;
}

.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #e9f7ef;
    color: #1e8449;
}

.alert-error {
    background: #fde8e8;
    color: #c0392b;
}

.admin-only,
.superadmin-only {
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
        width: 100%;
        padding: 15px;
    }
    
    .btn-toggle-sidebar {
        display: block;
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .router-selector {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .router-selector select,
    .router-selector input[type="date"] {
        width: 100%;
    }
    
    .view-tabs {
        width: 100%;
    }
    
    .tab-btn {
        flex: 1;
        text-align: center;
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════
   Theme Toggle Button
   ═══════════════════════════════════════════════════════════ */
.theme-toggle {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.theme-toggle:hover {
    background: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
    transform: scale(1.05);
}
/* موقع الزر في الـ header للصفحات الداخلية */
.page-header .theme-toggle,
.user-info ~ .theme-toggle,
.header-actions .theme-toggle {
    margin-right: 12px;
}
/* موقع الزر في صفحة اللوجن */
.login-page .theme-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
}

/* ── Light Mode: Sidebar Override ── */
[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    border-color: #34495e;
}
[data-theme="light"] .sidebar .sidebar-title,
[data-theme="light"] .sidebar .nav-text,
[data-theme="light"] .sidebar .user-name {
    color: #f1f5f9;
}
[data-theme="light"] .sidebar .nav-item:hover {
    background: rgba(255,255,255,0.1);
}
[data-theme="light"] .sidebar .user-role {
    color: #94a3b8;
}
[data-theme="light"] .sidebar .nav-item.active {
    background: rgba(102,126,234,0.4);
}

/* ═══════════════════════════════════════════════════════════
   Login Footer
   ═══════════════════════════════════════════════════════════ */
.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    padding: 16px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    z-index: 10;
}

.login-footer p {
    margin: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.login-footer strong {
    color: var(--accent-primary);
    font-weight: 600;
}

.login-footer .contact a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
    direction: ltr;
    unicode-bidi: embed;
}

.login-footer .contact a:hover {
    color: #8b9bf9;
}

.login-footer .version {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Light Mode */
[data-theme="light"] .login-footer {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e0e0e0;
}

/* ═══════════════════════════════════════════════════════════
   Developer Credit (Sidebar)
   ═══════════════════════════════════════════════════════════ */
.developer-credit {
    padding: 16px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    background: rgba(15, 23, 42, 0.5);
}

.developer-credit p {
    margin: 4px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.developer-credit strong {
    color: var(--accent-primary);
}

.developer-credit .contact {
    margin-top: 8px;
}

.developer-credit .contact a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    direction: ltr;
    unicode-bidi: embed;
}

.developer-credit .contact a:hover {
    color: #8b9bf9;
}

/* Light Mode */
[data-theme="light"] .developer-credit {
    background: rgba(44, 62, 80, 0.05);
    border-top: 1px solid rgba(255,255,255,0.1);
}

[data-theme="light"] .developer-credit p {
    color: #f1f5f9;
}

/* Powered By */
.powered-by {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    letter-spacing: 0.3px;
}

.powered-by strong {
    color: var(--accent-primary);
    font-weight: 600;
}

.powered-by a {
    color: var(--accent-primary);
    text-decoration: none;
    direction: ltr;
    unicode-bidi: embed;
}

.powered-by a:hover {
    text-decoration: underline;
}

[data-theme="light"] .powered-by {
    color: #7f8c8d;
}

/* Powered By */
.powered-by {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    letter-spacing: 0.3px;
}

.powered-by strong {
    color: var(--accent-primary);
    font-weight: 600;
}

.powered-by a {
    color: var(--accent-primary);
    text-decoration: none;
    direction: ltr;
    unicode-bidi: embed;
}

.powered-by a:hover {
    text-decoration: underline;
}

[data-theme="light"] .powered-by {
    color: #7f8c8d;
}

/* Sidebar Dev Credit */
.sidebar-dev {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    text-align: center;
    margin: 2px 0;
    line-height: 1.4;
}

.sidebar-dev strong {
    color: rgba(255,255,255,0.75);
    font-weight: 600;
}

.sidebar-dev a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    direction: ltr;
    unicode-bidi: embed;
}

.sidebar-dev a:hover {
    color: #fff;
    text-decoration: underline;
}

/* تصغير Login Footer */
.login-footer {
    padding: 10px 20px !important;
}

.login-footer p {
    font-size: 11px !important;
    margin: 2px 0 !important;
}

.login-footer .version {
    font-size: 10px !important;
    margin-top: 3px !important;
}

/* ═══════════════════════════════════════════
   Daily View — Toolbar (بحث + فلتر + تصدير)
   ═══════════════════════════════════════════ */
.daily-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.daily-search-wrap {
    flex: 1;
    min-width: 200px;
}
.daily-search-input {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    font-size: 13px;
    background: var(--card-bg, #fff);
    color: var(--text-color, #333);
    outline: none;
    transition: border-color .2s;
}
.daily-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}
.daily-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.btn-export {
    padding: 8px 16px;
    background: linear-gradient(135deg,#27ae60,#2ecc71);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s;
}
.btn-export:hover { opacity: .88; }

/* مقارنة اليوم بالأمس داخل الكرت */
.card-compare {
    font-size: 12px;
    margin-top: 4px;
    min-height: 18px;
}

/* قيمة صغيرة داخل الكرت (آخر تحديث) */
.card-value-sm {
    font-size: 18px !important;
}

/* رؤوس قابلة للترتيب */
.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.sortable:hover { background: rgba(102,126,234,.1); }
.sort-icon {
    font-size: 11px;
    opacity: .6;
    margin-right: 4px;
}

/* ═══════════════════════════════════════════
   Daily View — Toolbar (بحث + فلتر + تصدير)
   ═══════════════════════════════════════════ */
.daily-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.daily-search-wrap {
    flex: 1;
    min-width: 200px;
}
.daily-search-input {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-input, #fff);
    color: var(--text-main, #333);
    transition: border-color .2s, box-shadow .2s;
}
.daily-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}
.daily-filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.btn-export {
    padding: 8px 16px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s, transform .1s;
}
.btn-export:hover  { opacity: .88; transform: translateY(-1px); }
.btn-export:active { transform: translateY(0); }

/* ─── رأس جدول قابل للترتيب ─── */
th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
th.sortable:hover { background: rgba(102,126,234,.08); }
.sort-icon {
    font-size: 11px;
    color: #aaa;
    margin-right: 4px;
}

/* ─── كرت مقارنة (أصغر نص) ─── */
.card-compare {
    font-size: 12px;
    margin-top: 4px;
    min-height: 18px;
}
.card-value-sm {
    font-size: 1.4rem;
}

/* ═══════════════════════════════════════════════════════════
   Compare Yesterday Box (البوكس الخامس)
   ═══════════════════════════════════════════════════════════ */
#dayCompareGb {
    line-height: 1.2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

#dayCompareGb > span {
    display: block;
    margin-bottom: 4px;
}

#dayCompareGb > div {
    font-size: 0.78em !important;
    color: var(--text-secondary, #888) !important;
}

body.dark-mode #dayCompareGb > div {
    color: #aaa !important;
}

/* ═══════════════════════════════════════════════════════════
/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE FIX
   ═══════════════════════════════════════════════════════════ */

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

* {
    box-sizing: border-box;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.force-change-alert,
.toast-msg {
    white-space: normal;
    width: 90%;
    max-width: 420px;
    text-align: center;
    word-break: break-word;
}

@media (max-width: 480px) {

    .cards-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .page-header {
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 12px;
    }

    .page-header h2 {
        font-size: 1rem;
        flex: 1;
    }

    .header-date {
        width: 100%;
        font-size: 12px;
        text-align: center;
        order: 3;
    }

    .router-selector {
        gap: 8px;
    }

    .router-selector label {
        width: 100%;
        font-size: 13px;
    }

    .router-selector select,
    .router-selector input[type="date"],
    .router-selector button {
        width: 100% !important;
        font-size: 14px;
    }

    .filter-btns {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .filter-btns button {
        flex: 1 1 calc(50% - 6px);
        min-width: 80px;
        font-size: 12px;
        padding: 6px 8px;
        text-align: center;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 4px !important;
        font-size: 11px !important;
    }

    .login-container {
        padding: 10px;
        align-items: flex-start;
        padding-top: 30px;
    }

    .login-box {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px 16px;
        border-radius: 12px;
    }

    .login-logo h1 {
        font-size: 1.3rem;
    }

    .login-footer {
        padding: 8px 12px !important;
    }

    .login-footer p {
        font-size: 10px !important;
        margin: 1px 0 !important;
    }

    .sidebar-footer {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }

    .sidebar-footer .theme-toggle,
    .sidebar-footer .btn-logout {
        width: 100%;
        text-align: center;
    }

    .daily-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .daily-search-wrap {
        min-width: unset;
        width: 100%;
    }

    .btn-export {
        width: 100%;
        text-align: center;
        padding: 10px;
    }

    .tab-btn {
        font-size: 12px !important;
        padding: 8px 6px !important;
    }

    .view-tabs {
        gap: 6px;
    }

    .date-range-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .date-range-filter input[type="date"] {
        width: 100%;
    }

    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .comment-cell:hover {
        position: static;
        white-space: normal;
        max-width: 120px;
    }

    .pill-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .card-value {
        font-size: 1.6rem;
    }

    .chart-container {
        height: 220px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {

    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .filter-btns {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .filter-btns button {
        flex: 1 1 calc(33% - 6px);
        font-size: 13px;
    }

    .login-box {
        width: 90% !important;
        max-width: 420px !important;
    }

    .daily-toolbar {
        flex-wrap: wrap;
    }

    .daily-search-wrap {
        min-width: 160px;
    }
}

@media (max-width: 768px) {

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        width: 260px !important;
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateX(0) !important;
    }

    .btn-toggle-sidebar {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        font-size: 18px;
        padding: 0;
        flex-shrink: 0;
    }

    .main-content {
        margin-right: 0 !important;
        width: 100% !important;
        padding: 12px !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE - Complete Fix v2
   ═══════════════════════════════════════════════════════════ */
* { box-sizing: border-box; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 998;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0; right: 0;
        height: 100%;
        width: 260px;
        z-index: 999;
        transform: translateX(100%);
        transition: transform 0.28s ease;
        overflow-y: auto;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: -6px 0 24px rgba(0,0,0,0.45);
    }
    .main-content {
        margin-right: 0 !important;
        width: 100% !important;
        padding: 10px !important;
    }
    .btn-toggle-sidebar {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 38px; height: 38px;
        font-size: 20px;
        padding: 0;
        flex-shrink: 0;
    }
    .page-header {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 0 12px;
        flex-wrap: wrap;
    }
    .page-header h2 {
        font-size: 15px;
        flex: 1;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .page-header .btn-primary {
        font-size: 12px !important;
        padding: 7px 11px !important;
        white-space: nowrap;
    }
    .header-date {
        font-size: 11px;
        width: 100%;
        padding-right: 46px;
    }
    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .card { padding: 12px 10px !important; }
    .card-icon  { font-size: 18px !important; }
    .card-value { font-size: 20px !important; }
    .card-label { font-size: 11px !important; }
    .card-compare { font-size: 10px !important; }
    .router-selector {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }
    .router-selector select,
    .router-selector input[type="date"],
    .router-selector .btn-primary {
        width: 100% !important;
        font-size: 15px !important;
        padding: 10px 12px !important;
    }
    .section { padding: 12px !important; margin-bottom: 10px !important; }
    .section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .section-header h3 { font-size: 14px !important; margin: 0; }
    .filter-btns { gap: 5px !important; flex-wrap: wrap !important; }
    .btn-filter { font-size: 11px !important; padding: 5px 9px !important; }
    .filter-pills { gap: 6px !important; justify-content: flex-start !important; }
    .pill-btn { font-size: 12px !important; padding: 6px 12px !important; }
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    .data-table { font-size: 12px !important; }
    .data-table th, .data-table td { padding: 8px 6px !important; }
    #vlansTable th:nth-child(3),
    #vlansTable td:nth-child(3),
    #vlansTable th:nth-child(4),
    #vlansTable td:nth-child(4),
    #vlansTable th:nth-child(7),
    #vlansTable td:nth-child(7) { display: none; }
    .view-tabs { gap: 5px !important; width: 100%; }
    .tab-btn {
        flex: 1 !important;
        padding: 9px 4px !important;
        font-size: 12px !important;
        text-align: center;
        min-width: 0;
    }
    .daily-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }
    .daily-search-wrap { min-width: unset !important; }
    .btn-export { width: 100% !important; text-align: center; padding: 10px !important; }
    .date-range-filter {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }
    .date-range-filter input[type="date"] { width: 100% !important; }
    .modal {
        padding: 0 !important;
        align-items: flex-end !important;
    }
    .modal-content {
        border-radius: 18px 18px 0 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        max-height: 92vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .modal-lg { max-width: 100% !important; }
    .modal-header {
        padding: 16px 18px !important;
        position: sticky;
        top: 0;
        background: var(--bg-card);
        z-index: 2;
        border-radius: 18px 18px 0 0;
    }
    .modal-header h3 { font-size: 15px !important; }
    .modal-body { padding: 14px 16px !important; }
    .modal-footer {
        flex-direction: column !important;
        gap: 8px !important;
        padding: 12px 16px 20px !important;
        position: sticky;
        bottom: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
    }
    .modal-footer button { width: 100% !important; padding: 13px !important; font-size: 14px !important; }
    .modal-overlay { align-items: flex-end !important; }
    .modal-box {
        border-radius: 18px 18px 0 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 1.4rem 1.2rem 2rem !important;
    }
    .form-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important;
        padding: 10px 12px !important;
    }
    .form-group label { font-size: 13px !important; }
    .sys-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
    .sys-value { font-size: 28px !important; }
    .container-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        padding: 12px !important;
    }
    .container-stats { gap: 6px !important; flex-wrap: wrap; }
    .backup-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }
    .btn-run-backup { width: 100% !important; text-align: center; }
    .backup-stats { justify-content: space-around; width: 100%; }
    .refresh-bar { flex-wrap: wrap; gap: 8px !important; }
    .login-container { padding: 20px 14px 110px !important; }
    .login-box { padding: 22px 18px !important; border-radius: 16px !important; }
    .login-logo h1 { font-size: 20px !important; }
    .btn-login { font-size: 15px !important; padding: 13px !important; }
    .chart-container { height: 210px !important; }
    .toast-msg {
        width: 92% !important;
        font-size: 13px !important;
        padding: 11px 18px !important;
        text-align: center;
    }
    .comment-cell { max-width: 90px !important; }
    .actions-cell { gap: 3px !important; justify-content: center; }
    .btn-sm { padding: 4px 7px !important; font-size: 11px !important; }
    .badge { padding: 3px 8px !important; font-size: 11px !important; }
    .force-change-alert {
        font-size: 12px !important;
        padding: 8px 14px !important;
        white-space: normal !important;
        width: 92%;
        text-align: center;
    }
}

@media (max-width: 380px) {
    .cards-grid { gap: 6px !important; }
    .card-value { font-size: 17px !important; }
    .tab-btn { font-size: 10px !important; padding: 8px 2px !important; }
    .pill-btn { font-size: 10px !important; padding: 5px 8px !important; }
    .page-header h2 { font-size: 13px !important; }
    .btn-filter { font-size: 10px !important; padding: 4px 7px !important; }
}

/* ═══════════════════════════════════════════════════════════
   Mobile Tables - Hide columns
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* جدول الراوترات: إخفاء عمود الموقع (4) */
    #routersTableBody tr td:nth-child(4),
    table.data-table thead tr th:nth-child(4) { display: none; }

    /* جدول المستخدمين: إخفاء عمود البريد (4) */
    #usersTableBody tr td:nth-child(4),
    table.data-table thead tr th:nth-child(4) { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   Mobile Tables - Fix using correct IDs
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* جدول الراوترات: إخفاء الموقع (عمود 4) */
    #routersTable th:nth-child(4),
    #routersTable td:nth-child(4) { display: none; }

    /* جدول المستخدمين: إخفاء البريد (عمود 4) */
    #usersTable th:nth-child(4),
    #usersTable td:nth-child(4) { display: none; }
}

/* ═══ FIX: Mobile Routers Table - precise column hiding ═══ */
@media (max-width: 768px) {
    /* إلغاء الـ nth-child العام اللي يأثر على كل الجداول */
    .data-table th:nth-child(4),
    .data-table td:nth-child(4) { display: revert; }

    /* إخفاء الموقع فقط من جدول الراوترات */
    #routersTable th:nth-child(4),
    #routersTable td:nth-child(4) { display: none; }

    /* عمود المالك يظهر كـ table-cell مش flex */
    #routersTable th.superadmin-only,
    #routersTable td.superadmin-only,
    .superadmin-only th,
    .superadmin-only td,
    th.superadmin-only,
    td.superadmin-only { display: table-cell !important; }
}

/* ═══ Fix: Daily Stats Table Mobile ═══ */
@media (max-width: 768px) {
    /* إلغاء أي إخفاء عام يأثر على جدول الإحصائيات */
    #dailyStatsTable th,
    #dailyStatsTable td { display: table-cell !important; }

    /* إخفاء عمود ملاحظات فقط على الجوال */
    #dailyStatsTable th:nth-child(6),
    #dailyStatsTable td:nth-child(6) { display: none !important; }

    /* تصغير الخط */
    #dailyStatsTable th,
    #dailyStatsTable td { font-size: 11px !important; padding: 6px 4px !important; }

    #dailyStatsTable th:nth-child(1),
    #dailyStatsTable td:nth-child(1) { width: 28px; }
}

/* إظهار عمود الملاحظات في جدول الإحصائيات اليومية */
@media (max-width: 768px) {
    #dailyStatsTable th:nth-child(6),
    #dailyStatsTable td:nth-child(6) { display: table-cell !important; font-size: 10px !important; max-width: 60px; }
}

/* ملاحظات جدول الإحصائيات - سطرين */
@media (max-width: 768px) {
    #dailyStatsTable td:nth-child(6) {
        white-space: normal !important;
        word-break: break-word !important;
        max-width: 80px !important;
        font-size: 10px !important;
        line-height: 1.3 !important;
    }
}

/* ═══ Monthly & Top VLANs Tables - Mobile Fix ═══ */
@media (max-width: 768px) {
    /* كل الجداول - عناوين سطرين */
    .data-table th {
        white-space: normal !important;
        word-break: break-word !important;
        font-size: 11px !important;
        padding: 6px 4px !important;
        line-height: 1.3 !important;
    }
    .data-table td {
        font-size: 11px !important;
        padding: 6px 4px !important;
    }
    /* ملاحظات سطرين */
    .data-table td:last-child {
        white-space: normal !important;
        word-break: break-word !important;
        max-width: 70px !important;
        line-height: 1.3 !important;
    }
    /* إظهار كل أعمدة جدول Top VLANs */
    #topVlansTable th,
    #topVlansTable td { display: table-cell !important; }

    /* إظهار كل أعمدة جدول الأيام */
    #monthlyDaysTable th,
    #monthlyDaysTable td { display: table-cell !important; }
}
