@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&family=Tajawal:wght@400;500;700&display=swap');

:root {
    /* Premium Color Palette */
    --primary: #A01C2C;
    /* Deep Luxurious Red */
    --primary-gradient: linear-gradient(135deg, #A01C2C 0%, #700F1A 100%);
    --primary-light: rgba(160, 28, 44, 0.08);
    --primary-text: #2D0A0E;

    --accent: #D4AF37;
    /* Gold Accent for premium feel */

    --background: #FDFBFB;
    --background-gradient: radial-gradient(circle at top right, #FFF5F5 0%, #FAFAFA 100%);

    --surface: #FFFFFF;
    --surface-glass: rgba(255, 255, 255, 0.85);
    /* Glass Effect */

    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #F59E0B;
    --error: #EF4444;

    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #FFFFFF;

    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(255, 255, 255, 0.6);

    /* Shadows — متعددة الطبقات لعمق طبيعي */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 8px rgba(160, 28, 44, 0.06), 0 12px 28px rgba(160, 28, 44, 0.08);
    --shadow-xl: 0 8px 16px rgba(160, 28, 44, 0.06), 0 20px 40px rgba(160, 28, 44, 0.10);
    --shadow-glass: 0 4px 16px rgba(160, 28, 44, 0.06), 0 12px 40px rgba(160, 28, 44, 0.08);

    /* Transitions — مركزية لتناسق الحركة */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* KPI Colors — ألوان بطاقات المؤشرات */
    --kpi-green: #10B981;
    --kpi-green-bg: rgba(16, 185, 129, 0.10);
    --kpi-blue: #3B82F6;
    --kpi-blue-bg: rgba(59, 130, 246, 0.10);
    --kpi-orange: #F59E0B;
    --kpi-orange-bg: rgba(245, 158, 11, 0.10);
    --kpi-purple: #8B5CF6;
    --kpi-purple-bg: rgba(139, 92, 246, 0.10);

    /* Spacing & Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --space-xxs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-xxl: 4rem;

    /* Admin v2 specific */
    --admin-bg: #f8fafc;
    --admin-sidebar: #1e293b;
    --admin-primary: #8B1D2E;
    --admin-border: #e2e8f0;
    --space-grid: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--background-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.7;
    direction: rtl;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
.btn-3d,
.logo {
    font-family: 'Cairo', sans-serif;
}

/* Glassmorphism Generic Class */
.glass {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-glass);
}

/* Buttons */
.btn-3d {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--transition-base), box-shadow var(--transition-base), filter var(--transition-base);
    box-shadow: 0 4px 12px rgba(160, 28, 44, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-3d:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(160, 28, 44, 0.35);
    filter: brightness(1.05);
}

.btn-3d:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(160, 28, 44, 0.3);
}

/* Classic Admin Buttons */
.btn-admin {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-admin:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    opacity: 0.92;
}

.btn-admin:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-admin-primary {
    background: var(--primary);
    color: white;
}

.btn-admin-secondary {
    background: #6c757d;
    color: white;
}

.btn-admin-info {
    background: #17a2b8;
    color: white;
}

.btn-admin-danger {
    background: #dc3545;
    color: white;
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 1px solid #ccc;
}

.btn-secondary:hover {
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
}

/* Cards */
.card {
    background: white;
    border-radius: 4px;
    border: 1px solid var(--border);
    padding: var(--space-lg);
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(160, 28, 44, 0.12);
}

/* Header & Nav */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -1px;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Form Elements */
.input-primary {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-md);
    background: #F9FAFB;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition-base), background var(--transition-base), box-shadow var(--transition-base);
}

.input-primary:focus {
    background: white;
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(160, 28, 44, 0.08);
}

/* Modal System (Classic Solid) */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 28px;
    border: none;
    width: 100%;
    max-width: 600px;
    border-radius: 12px;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: dal-modal-in 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dal-modal-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close-modal {
    color: #aaa;
    position: absolute;
    top: 10px;
    left: 15px;
    /* RTL fix */
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: #555;
}

/* Sidebar */
.dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar-component {
    background: white;
    border-left: 1px solid var(--border);
    padding: var(--space-lg);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-component .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    margin-bottom: 8px;
    transition: background var(--transition-base), color var(--transition-base), transform var(--transition-fast);
}

.sidebar-component .nav-link:hover {
    background: var(--background);
    color: var(--primary);
    transform: translateX(-2px);
}

.sidebar-component .nav-link.active {
    background: var(--primary-light);
    /* Much lighter active background */
    color: var(--primary);
    font-weight: 700;
    border-right-color: var(--primary);
    /* Accent border on right */
    box-shadow: none;
    /* Removed heavy shadow */
}

/* View Toggle (Segmented Control) */
.view-toggle {
    background: #F3F4F6;
    padding: 4px;
    border-radius: 12px;
    display: flex;
    gap: 2px;
}

.view-btn {
    border: none;
    background: transparent;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.view-btn.active {
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #F3F4F6;
    color: var(--text-secondary);
}

.badge-success {
    background: var(--success-bg);
    color: #059669;
}

/* Utilities */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sidebar Footer Spacing Fix */
/* Sidebar Footer Spacing Fix */
.sidebar-footer {
    padding-top: var(--space-lg);
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: var(--space-lg);
    margin-top: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.user-info {
    overflow: hidden;
}

.user-info .name {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .email {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Admin v2 Components */
.stat-tile {
    background: white;
    padding: 24px;
    border-radius: 4px;
    border: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.stat-tile:hover {
    border-color: var(--admin-primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-tile .tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
}

.stat-tile .tile-emoji {
    font-size: 1.5rem;
}

.stat-tile .tile-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--admin-primary);
}

.control-bar {
    background: white;
    border: 1px solid var(--admin-border);
    padding: 12px;
    border-radius: 4px;
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
}

.nav-link-v2 {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: 0.2s;
}

.nav-link-v2:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-link-v2.active {
    background: var(--admin-primary);
    color: white;
}

@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-component {
        display: flex;
        /* Flex to organize children */
        flex-direction: column;
        position: fixed;
        right: -300px;
        /* Hidden off-screen RTL */
        top: 0;
        bottom: 0;
        width: 300px;
        z-index: 2000;
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
        box-shadow: none;
        border-left: 1px solid var(--border);
        height: 100vh;
        background: white;
        padding: 0;
    }

    .sidebar-component.open {
        transform: translateX(-300px);
        /* Slide in RTL */
    }

    /* Mobile Sidebar Header */
    .sidebar-component .logo {
        padding: var(--space-lg);
        margin: 0;
        border-bottom: 1px solid var(--border);
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.8rem;
    }

    /* Close Button */
    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: var(--primary-light);
        color: var(--primary);
        border-radius: 50%;
        font-size: 1.2rem;
        cursor: pointer;
        border: none;
    }

    /* Compact User Profile */
    .sidebar-component .user-profile {
        margin: var(--space-md);
        padding: var(--space-md);
        background: var(--surface);
        border: 1px solid var(--border);
        box-shadow: var(--shadow-sm);
    }

    /* List styling */
    .sidebar-component .nav-menu {
        padding: 0 var(--space-md);
        overflow-y: auto;
    }

    .sidebar-component .nav-link {
        padding: 12px 16px;
        margin-bottom: 4px;
        border-radius: var(--radius-sm);
        font-size: 1rem;
    }

    .sidebar-footer {
        margin-top: auto;
        padding: var(--space-md);
        background: #f8f9fa;
        border-top: 1px solid var(--border);
    }
}

/* Mobile Header */
.mobile-header {
    display: none;
    background: white;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
}

.logo-small {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Cairo', sans-serif;
}

.menu-toggle {
    background: transparent;
    border: none;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.menu-toggle:active {
    background: var(--primary-light);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1999;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s;
    opacity: 0;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Loading Spinners */
.dal-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: dal-spin 0.6s linear infinite;
    vertical-align: middle;
}

.dal-spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
    border-color: rgba(160, 28, 44, 0.15);
    border-top-color: var(--primary);
}

@keyframes dal-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Admin Panel Styles ===== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--admin-border);
}

.admin-header h2 {
    margin: 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-kpi-bar {
    display: flex;
    gap: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    border: 1px solid var(--admin-border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.admin-kpi-item {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.admin-kpi-item .kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.admin-kpi-item .kpi-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--admin-primary);
    line-height: 1;
}

.admin-kpi-item .kpi-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Clickable KPI Cards */
.admin-kpi-clickable {
    cursor: pointer;
    border-radius: 8px;
    padding: 8px 12px;
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.admin-kpi-clickable:hover {
    background: rgba(139, 29, 46, 0.03);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: right;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--admin-primary);
    box-shadow: var(--shadow-lg);
}

.stat-card .tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
    font-weight: 700;
}

.stat-card .value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--admin-primary);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════
   Admin Sub-Navigation (Vertical → Horizontal on mobile)
   ═══════════════════════════════════════════════════════ */

.admin-body {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    align-items: start;
}

.admin-subnav {
    background: white;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: 20px;
}

.admin-subnav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    text-align: right;
    transition: background var(--transition-fast), color var(--transition-fast);
    position: relative;
    white-space: nowrap;
}

.admin-subnav-item:hover {
    background: #f8f9fa;
    color: var(--text-primary);
}

.admin-subnav-item.active {
    background: rgba(139, 29, 46, 0.06);
    color: var(--admin-primary);
    font-weight: 700;
}

.admin-subnav-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--admin-primary);
    border-radius: 3px;
}

.admin-subnav-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.admin-subnav-label {
    flex: 1;
}

.admin-content {
    min-width: 0;
}

/* Mobile: collapse to horizontal strip */
@media (max-width: 768px) {
    .admin-body {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .admin-subnav {
        flex-direction: row;
        overflow-x: auto;
        padding: 6px;
        gap: 4px;
        position: static;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .admin-subnav::-webkit-scrollbar {
        display: none;
    }

    .admin-subnav-item {
        padding: 8px 12px;
        font-size: 0.8rem;
        gap: 6px;
    }

    .admin-subnav-item.active::before {
        display: none;
    }

    .admin-subnav-item.active::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 20%;
        right: 20%;
        height: 2px;
        background: var(--admin-primary);
        border-radius: 2px;
    }

    .admin-subnav-label {
        display: none;
    }

    .admin-subnav-icon {
        width: auto;
    }
}

/* ═══════════════════════════════════════════════════════
   Admin Form Cards (Settings / Activation)
   ═══════════════════════════════════════════════════════ */

.admin-form-card {
    background: white;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    max-width: 500px;
    margin: 0 auto;
    overflow: hidden;
}

.admin-form-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--admin-border);
}

.admin-form-header-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.admin-form-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.admin-form-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.admin-form-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-input-label {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.admin-input-hint {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.admin-form-result {
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    min-height: 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.table-container {
    background: white;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
}

/* ═══════════════════════════════════════════════════════
   Enhanced Table System — يستفيد 6+ شاشات
   ═══════════════════════════════════════════════════════ */

/* --- Base Table (Admin + Reusable) --- */
.admin-table,
.dal-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.admin-table th,
.dal-table th {
    background: #f8f9fa;
    padding: 12px 14px;
    text-align: right;
    border-bottom: 2px solid var(--admin-border);
    color: #495057;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    position: sticky;
    top: 0;
    z-index: 1;
}

.admin-table td,
.dal-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--admin-border);
    vertical-align: middle;
    font-size: 0.9rem;
}

.admin-table tbody tr,
.dal-table tbody tr {
    transition: background var(--transition-fast);
}

.admin-table tbody tr:hover,
.dal-table tbody tr:hover {
    background: rgba(139, 29, 46, 0.03);
}

/* Zebra Striping */
.admin-table tbody tr:nth-child(even),
.dal-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}

.admin-table tbody tr:nth-child(even):hover,
.dal-table tbody tr:nth-child(even):hover {
    background: rgba(139, 29, 46, 0.04);
}

/* --- Badge Status (Semantic Variants) --- */
.badge-status {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.4;
}

.badge-active,
.badge-success {
    background: var(--kpi-green-bg);
    color: #059669;
}

.badge-pending,
.badge-warning {
    background: var(--kpi-orange-bg);
    color: #d97706;
}

.badge-rejected,
.badge-danger {
    background: rgba(239, 68, 68, 0.10);
    color: #dc2626;
}

.badge-info {
    background: var(--kpi-blue-bg);
    color: #2563eb;
}

.badge-neutral {
    background: #f1f5f9;
    color: #64748b;
}

.badge-closed {
    background: var(--kpi-purple-bg);
    color: #7c3aed;
}

/* --- Table Avatar (for user rows) --- */
.table-avatar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.table-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.table-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}

.table-avatar-name {
    font-weight: 600;
    font-size: 0.88rem;
}

.table-avatar-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* --- Detail Table --- */
.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.9rem;
}

.detail-table td:first-child {
    font-weight: 700;
    width: 35%;
    color: var(--text-secondary);
}

/* --- History Table (verification.html) --- */
.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    background: #f8f9fa;
    padding: 10px 14px;
    text-align: right;
    border-bottom: 2px solid var(--admin-border);
    color: #495057;
    font-weight: 700;
    font-size: 0.8rem;
}

.history-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.9rem;
}

.history-table tbody tr {
    transition: background var(--transition-fast);
}

.history-table tbody tr:hover {
    background: rgba(139, 29, 46, 0.03);
}

/* --- Bids Comparison Table (deal_details.html) --- */
.bids-comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.bids-comparison-table th {
    background: #f8f9fa;
    padding: 12px 14px;
    text-align: right;
    border-bottom: 2px solid var(--admin-border);
    color: #495057;
    font-weight: 700;
    font-size: 0.8rem;
}

.bids-comparison-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--admin-border);
    vertical-align: middle;
    font-size: 0.9rem;
}

.bids-comparison-table tbody tr {
    transition: background var(--transition-fast);
}

.bids-comparison-table tbody tr:hover {
    background: rgba(139, 29, 46, 0.03);
}

/* --- Empty State for Tables --- */
.table-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.table-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════
   Toast / Snackbar Notification System
   ═══════════════════════════════════════════════════════ */

#dal-toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 40px);
}

.dal-toast {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(-30px) scale(0.96);
    transition: transform var(--transition-slow), opacity var(--transition-slow);
    border-right: 4px solid #94a3b8;
}

.dal-toast-show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.dal-toast-hide {
    animation: dal-toast-out 300ms ease forwards;
}

@keyframes dal-toast-out {
    to {
        opacity: 0;
        transform: translateX(-30px) scale(0.92);
        max-height: 0;
        margin-bottom: -10px;
        padding: 0;
    }
}

/* Toast Types — Border Colors */
.dal-toast-success {
    border-right-color: var(--kpi-green);
}

.dal-toast-error {
    border-right-color: var(--error);
}

.dal-toast-warning {
    border-right-color: var(--kpi-orange);
}

.dal-toast-info {
    border-right-color: var(--kpi-blue);
}

.dal-toast-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    direction: rtl;
}

.dal-toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.dal-toast-message {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
}

.dal-toast-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.dal-toast-close:hover {
    color: var(--text-primary);
}

/* Progress Bar */
.dal-toast-progress {
    height: 3px;
    background: rgba(0, 0, 0, 0.06);
}

.dal-toast-progress-bar {
    height: 100%;
    border-radius: 0 3px 3px 0;
    animation: dal-toast-shrink linear forwards;
    transform-origin: right;
}

.dal-toast-success .dal-toast-progress-bar {
    background: var(--kpi-green);
}

.dal-toast-error .dal-toast-progress-bar {
    background: var(--error);
}

.dal-toast-warning .dal-toast-progress-bar {
    background: var(--kpi-orange);
}

.dal-toast-info .dal-toast-progress-bar {
    background: var(--kpi-blue);
}

@keyframes dal-toast-shrink {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Mobile Toast */
@media (max-width: 768px) {
    #dal-toast-container {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: 100%;
        width: calc(100% - 20px);
    }
}

/* ═══════════════════════════════════════════════════════
   Confirm Dialog — بديل عن confirm()
   ═══════════════════════════════════════════════════════ */

.dal-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
    direction: rtl;
}

.dal-confirm-overlay.active {
    opacity: 1;
}

.dal-confirm-box {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9);
    transition: transform var(--transition-bounce);
}

.dal-confirm-overlay.active .dal-confirm-box {
    transform: scale(1);
}

.dal-confirm-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.dal-confirm-message {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.dal-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.dal-confirm-btn {
    padding: 10px 28px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    font-family: inherit;
}

.dal-confirm-btn:hover {
    transform: translateY(-1px);
}

.dal-confirm-cancel {
    background: #f1f5f9;
    color: var(--text-secondary);
}

.dal-confirm-cancel:hover {
    background: #e2e8f0;
}

.dal-confirm-ok.dal-confirm-warning {
    background: var(--kpi-orange);
    color: white;
}

.dal-confirm-ok.dal-confirm-danger {
    background: var(--error);
    color: white;
}

.dal-confirm-ok.dal-confirm-info {
    background: var(--kpi-blue);
    color: white;
}