/* 
 * Premium Admin Panel Styles
 * Modern, Dynamic, Glassmorphism, Premium Aesthetics
 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
    /* Brand Colors */
    --color-primary-500: #B32C27; /* PFI Red */
    --color-primary-600: #9e231f;
    --color-primary-light: rgba(179, 44, 39, 0.1);
    
    --color-accent-500: #195983; /* PFI Blue */
    --color-accent-600: #124568;
    --color-accent-dark: #0f172a; /* Slate 900 */

    /* Light Theme Base Colors */
    --bg-body: #f8fafc; /* Slate 50 */
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-sidebar: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --bg-header: rgba(255, 255, 255, 0.8);
    
    --text-main: #334155; /* Slate 700 */
    --text-heading: #0f172a; /* Slate 900 */
    --text-muted: #64748b; /* Slate 500 */
    --text-sidebar: #e2e8f0;
    --text-sidebar-hover: #ffffff;
    
    --border-color: #e2e8f0; /* Slate 200 */
    --border-light: rgba(255, 255, 255, 0.2);
    
    /* Semantic Colors */
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #0ea5e9;

    /* Fonts */
    --font-heading: 'Tajawal', sans-serif;
    --font-body: 'IBM Plex Sans Arabic', sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-card-hover: 0 15px 30px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.95);
    --bg-sidebar: linear-gradient(180deg, #020617 0%, #0f172a 100%);
    --bg-header: rgba(15, 23, 42, 0.8);
    
    --text-main: #cbd5e1;
    --text-heading: #f8fafc;
    --text-muted: #94a3b8;
    
    --border-color: #334155;
    
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-card-hover: 0 15px 30px -5px rgba(0,0,0,0.4), 0 8px 10px -6px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-heading);
    margin-top: 0;
}

/* ============================================================
   Glassmorphism Utilities
   ============================================================ */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
}

/* ============================================================
   Buttons (Premium, Micro-interactions)
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 10px 24px;
    font-size: 1rem;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(179, 44, 39, 0.39);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(179, 44, 39, 0.5);
    transform: translateY(-2px);
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--color-primary-500);
    color: var(--color-primary-500);
}

.btn-outline-primary:hover {
    background: var(--color-primary-500);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px 0 rgba(179, 44, 39, 0.2);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.875rem;
}

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(1400px 650px at 8% 15%, rgba(179, 44, 39, 0.32), transparent 58%),
        radial-gradient(950px 550px at 90% 88%, rgba(25, 89, 131, 0.45), transparent 62%),
        linear-gradient(135deg, #0a1628 0%, #1a2844 42%, #0f1f3a 78%, #0a1628 100%);
    position: relative;
    padding: 28px;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 25% 35%, rgba(179, 44, 39, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 75% 65%, rgba(25, 89, 131, 0.08) 0%, transparent 45%),
        linear-gradient(115deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.025) 50%, rgba(255, 255, 255, 0.025) 75%, transparent 75%, transparent);
    background-size: 100% 100%, 100% 100%, 48px 48px;
    opacity: 0.35;
    animation: subtleFloat 25s ease-in-out infinite;
}

@keyframes subtleFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10px, -10px) scale(1.02); }
}

.login-container.modern-layout {
    width: 100%;
    max-width: 1120px;
    position: relative;
    z-index: 10;
    perspective: 1400px;
}

.login-card.login-card-modern {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    background: linear-gradient(148deg, rgba(255, 255, 255, 0.98) 0%, rgba(252, 253, 254, 0.94) 100%);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 18px;
    box-shadow: 
        0 32px 64px -24px rgba(15, 23, 42, 0.45),
        0 12px 24px -8px rgba(15, 23, 42, 0.25),
        0 2px 8px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
    overflow: hidden;
    animation: slideUp 0.48s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    transform: translateZ(0);
    will-change: transform;
}

.login-card.login-card-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(118deg, rgba(179, 44, 39, 0.06) 0%, transparent 28%, rgba(25, 89, 131, 0.06) 100%),
        radial-gradient(ellipse at top left, rgba(179, 44, 39, 0.08), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(25, 89, 131, 0.08), transparent 50%);
    pointer-events: none;
    opacity: 0.85;
}

[data-theme="dark"] .login-card.login-card-modern {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
}

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

@keyframes riseFade {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-brand-panel {
    background: 
        linear-gradient(158deg, #0d1d30 0%, #14324f 38%, #1a4568 72%, #1d5179 100%),
        radial-gradient(ellipse at top, rgba(179, 44, 39, 0.15), transparent 60%),
        radial-gradient(ellipse at bottom, rgba(25, 89, 131, 0.2), transparent 65%);
    background-blend-mode: normal, screen, screen;
    color: #e2e8f0;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-brand-panel::before,
.login-brand-panel::after {
    content: '';
    position: absolute;
    border-radius: var(--radius-full);
    pointer-events: none;
}

.login-brand-panel::before {
    width: 280px;
    height: 280px;
    top: -100px;
    left: -70px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 50%, transparent 100%);
    filter: blur(20px);
}

.login-brand-panel::after {
    width: 200px;
    height: 200px;
    bottom: -70px;
    right: -60px;
    background: radial-gradient(circle, rgba(179, 44, 39, 0.35) 0%, rgba(179, 44, 39, 0.15) 50%, transparent 100%);
    filter: blur(25px);
}

.brand-panel-inner {
    position: relative;
    z-index: 2;
}

.brand-panel-inner > * {
    opacity: 0;
    animation: riseFade 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.brand-panel-inner > *:nth-child(1) { animation-delay: 0.08s; }
.brand-panel-inner > *:nth-child(2) { animation-delay: 0.14s; }
.brand-panel-inner > *:nth-child(3) { animation-delay: 0.2s; }
.brand-panel-inner > *:nth-child(4) { animation-delay: 0.26s; }

.brand-logo-link {
    display: inline-block;
    text-decoration: none;
    margin-bottom: 24px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-logo-link:hover {
    transform: scale(1.03) translateY(-2px);
}

.brand-logo-main {
    max-height: 68px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
    transition: filter 0.4s;
    display: block;
}

.brand-logo-link:hover .brand-logo-main {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.brand-title {
    color: #f8fafc;
    font-size: 2rem;
    margin-bottom: 14px;
    font-weight: 800;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    line-height: 1.15;
}

.brand-subtitle {
    color: #e0f2fe;
    margin: 0 0 32px;
    line-height: 1.85;
    font-size: 1rem;
    opacity: 0.94;
}

.brand-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 13px;
}

.brand-feature-list li {
    padding: 13px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.32) 0%, rgba(15, 23, 42, 0.24) 100%);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.brand-feature-list li::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 50%);
    opacity: 0;
    transition: opacity 0.35s;
}

.brand-feature-list li:hover {
    transform: translateX(-6px) translateY(-2px);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.35) 100%);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.brand-feature-list li:hover::before {
    opacity: 1;
}

.login-form-panel {
    padding: 48px 44px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    background:
        radial-gradient(450px 220px at 12% -35%, rgba(179, 44, 39, 0.06), transparent 72%),
        radial-gradient(400px 240px at 94% 118%, rgba(25, 89, 131, 0.07), transparent 70%),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02), transparent 50%);
}

.login-header > * {
    opacity: 0;
    animation: riseFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-header > *:first-child { animation-delay: 0.12s; }
.login-header > *:last-child { animation-delay: 0.18s; }

.login-form .form-group,
.login-form .floating-label-group,
.login-form .remember-me-row,
.login-form .login-submit-btn,
.login-footer {
    opacity: 0;
    animation: riseFade 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-form .form-group:nth-of-type(1),
.login-form .floating-label-group:nth-of-type(1) { animation-delay: 0.22s; }
.login-form .form-group:nth-of-type(2),
.login-form .floating-label-group:nth-of-type(2) { animation-delay: 0.28s; }
.login-form .remember-me-row { animation-delay: 0.34s; }
.login-form .login-submit-btn { animation-delay: 0.4s; }
.login-footer { animation-delay: 0.46s; }

@media (prefers-reduced-motion: reduce) {
    .brand-panel-inner > *,
    .login-header > *,
    .login-form .form-group,
    .login-form .floating-label-group,
    .login-form .remember-me-row,
    .login-form .login-submit-btn,
    .login-footer {
        opacity: 1;
        animation: none;
        transform: none;
    }
}

.login-logo { max-height: 64px; margin-bottom: 20px; transition: transform 0.3s; }
.login-logo:hover { transform: scale(1.05); }
.dark-logo { display: none; }
[data-theme="dark"] .light-logo { display: none; }
[data-theme="dark"] .dark-logo { display: inline-block; }

.login-title {
    font-size: 1.75rem;
    color: var(--color-accent-500);
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -0.015em;
    background: linear-gradient(135deg, var(--color-accent-500) 0%, var(--color-accent-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}
[data-theme="dark"] .login-title { 
    background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    margin: 0 0 32px;
    color: var(--text-muted);
    line-height: 1.75;
    font-size: 0.98rem;
}

.login-form {
    display: grid;
    gap: 4px;
}

.alert {
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.92rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #b91c1c;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.35);
    color: #92400e;
}

.alert-info {
    background: rgba(14, 165, 233, 0.13);
    border-color: rgba(14, 165, 233, 0.3);
    color: #075985;
}

/* Forms */
.form-group { margin-bottom: 22px; }
.form-group label {
    display: block;
    margin-bottom: 11px;
    font-size: 0.93rem;
    color: var(--text-heading);
    letter-spacing: -0.01em;
}

/* Floating Label Input Groups */
.floating-label-group {
    position: relative;
    margin-bottom: 18px;
}

.floating-label-group .input-icon {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-accent-500);
    pointer-events: none;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 22px;
    height: 22px;
    opacity: 0.65;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.floating-label-group.is-focused .input-icon {
    color: var(--color-primary-500);
    opacity: 1;
    transform: translateY(-50%) scale(1.15) rotate(5deg);
    filter: drop-shadow(0 4px 12px rgba(179, 44, 39, 0.4));
}

.floating-label-group .floating-input.has-value ~ .input-icon {
    color: var(--color-accent-600);
    opacity: 0.9;
    transform: translateY(-50%) scale(1.05);
}

.floating-input {
    width: 100%;
    padding: 24px 64px 24px 20px;
    font-size: 1.04rem;
    font-family: var(--font-body);
    font-weight: 500;
    border: 2px solid rgba(25, 89, 131, 0.25);
    border-radius: 16px;
    background: 
        linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.88) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-main);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 4px 12px rgba(15, 23, 42, 0.08),
        0 2px 4px rgba(15, 23, 42, 0.04),
        inset 0 2px 4px rgba(255, 255, 255, 1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 1;
    text-align: right;
    direction: rtl;
    line-height: 1.5;
}

.floating-input:hover {
    border-color: rgba(25, 89, 131, 0.4);
    background: 
        linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 251, 252, 0.92) 100%);
    box-shadow: 
        0 8px 20px rgba(15, 23, 42, 0.12),
        0 4px 8px rgba(15, 23, 42, 0.06),
        inset 0 2px 4px rgba(255, 255, 255, 1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

.floating-input:focus {
    outline: none;
    border-color: var(--color-primary-500);
    background: 
        linear-gradient(145deg, #ffffff 0%, rgba(254, 252, 253, 1) 100%);
    box-shadow: 
        0 0 0 4px var(--color-primary-light),
        0 0 0 2px rgba(179, 44, 39, 0.1),
        0 12px 36px -10px rgba(179, 44, 39, 0.4),
        0 8px 20px -6px rgba(179, 44, 39, 0.25),
        0 4px 10px rgba(15, 23, 42, 0.08),
        inset 0 3px 6px rgba(255, 255, 255, 1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.95);
    transform: translateY(-3px) scale(1.01);
}

.floating-label {
    position: absolute;
    right: 64px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(100, 116, 139, 0.75);
    font-size: 1.04rem;
    font-weight: 500;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: transparent;
    z-index: 2;
    white-space: nowrap;
    padding: 0 6px;
    letter-spacing: -0.01em;
}

.floating-label-group.is-focused .floating-label,
.floating-input.has-value ~ .floating-label {
    top: -2px;
    font-size: 0.78rem;
    color: var(--color-accent-600);
    font-weight: 700;
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        #ffffff 45%, 
        rgba(255, 255, 255, 0.98) 70%,
        rgba(255, 255, 255, 0.95) 100%);
    padding: 3px 10px;
    transform: translateY(0) scale(1.05);
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    border-radius: 8px;
}

.floating-label-group.is-focused .floating-label {
    color: var(--color-primary-500);
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        rgba(254, 242, 242, 0.5) 100%);
    box-shadow: 
        0 4px 12px rgba(179, 44, 39, 0.15),
        0 2px 4px rgba(179, 44, 39, 0.1);
    transform: translateY(0) scale(1.08);
}

.floating-label-group.is-error .floating-label {
    color: var(--color-danger-500);
}

.floating-label-group.is-error .floating-input {
    border-color: var(--color-danger-500);
    background: 
        linear-gradient(145deg, rgba(254, 242, 242, 0.96) 0%, rgba(255, 248, 248, 0.92) 100%);
    box-shadow: 
        0 0 0 4px rgba(239, 68, 68, 0.15),
        0 8px 24px -4px rgba(239, 68, 68, 0.3),
        0 4px 12px rgba(239, 68, 68, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.9),
        inset 0 0 0 1px rgba(239, 68, 68, 0.15);
}

.floating-label-group.is-error .input-icon {
    color: var(--color-danger-500);
}

/* Input Highlight Animation */
.input-highlight {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--color-primary-500) 0%,
        var(--color-primary-600) 50%,
        var(--color-primary-500) 100%);
    background-size: 200% 100%;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 0 0 16px 16px;
    z-index: 3;
    box-shadow: 0 2px 12px rgba(179, 44, 39, 0.5);
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.floating-label-group.is-focused .input-highlight {
    width: 100%;
}

/* Toggle Password Button */
.toggle-password {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.4);
    padding: 10px;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 10px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    box-shadow: 
        0 4px 12px rgba(15, 23, 42, 0.08),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.toggle-password:hover {
    background: none;
    border-color: rgba(203, 213, 225, 0.6);
    color: var(--color-accent-500);
    transform: translateY(-50%) scale(1.1) rotate(5deg);
    box-shadow: 
        0 6px 20px rgba(15, 23, 42, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 1);
}

.toggle-password.active {
    color: var(--color-primary-500);
    background: none;
    border-color: rgba(179, 44, 39, 0.3);
    box-shadow: 
        0 6px 20px rgba(179, 44, 39, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.9);
    transform: translateY(-50%) scale(1.05);
}

.toggle-password svg {
    display: block;
}

/* Error Message - dynamic expand/collapse */
.error-message {
    display: block;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding: 0 12px;
    overflow: hidden;
    color: #dc2626;
    background: linear-gradient(to bottom, rgba(254, 226, 226, 0.95), rgba(254, 242, 242, 0.9));
    border: 0 solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    font-size: 0.83rem;
    font-weight: 600;
    transform: translateY(-6px);
    transition: max-height 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease,
                margin-top 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                padding 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-width 0.35s ease,
                transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 4px 12px rgba(239, 68, 68, 0.2),
        0 2px 4px rgba(239, 68, 68, 0.1);
    text-align: right;
}

.error-message::before {
    content: '⚠';
    margin-left: 6px;
    font-size: 1rem;
}

.floating-label-group.is-error .error-message {
    max-height: 80px;
    opacity: 1;
    margin-top: 10px;
    padding: 6px 12px;
    border-width: 1px;
    transform: translateY(0);
}

/* Adjust password input padding for toggle button */
#password {
    padding-left: 72px;
}

/* Remember Me Checkbox - Enhanced Design */
.remember-me-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 52px 0 10px 0;
    cursor: pointer;
    user-select: none;
    padding: 16px 20px;
    border-radius: 14px;
    background: 
        linear-gradient(145deg, rgba(248, 250, 252, 0.7), rgba(241, 245, 249, 0.6));
    backdrop-filter: blur(8px);
    border: 2px solid rgba(226, 232, 240, 0.5);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 2px 8px rgba(15, 23, 42, 0.04),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.remember-me-row::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(179, 44, 39, 0.03), 
        rgba(25, 89, 131, 0.03));
    opacity: 0;
    transition: opacity 0.35s;
}

.remember-me-row:hover {
    background: 
        linear-gradient(145deg, rgba(250, 251, 252, 0.85), rgba(243, 246, 249, 0.75));
    border-color: rgba(203, 213, 225, 0.7);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 16px rgba(15, 23, 42, 0.08),
        inset 0 1px 3px rgba(255, 255, 255, 1);
}

.remember-me-row:hover::before {
    opacity: 1;
}

.remember-me-row input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--color-accent-500);
    border-radius: 7px;
    background: linear-gradient(145deg, #ffffff, rgba(248, 250, 252, 0.9));
    cursor: pointer;
    position: relative;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 2px 6px rgba(15, 23, 42, 0.08),
        inset 0 1px 2px rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.remember-me-row input[type="checkbox"]:hover {
    border-color: var(--color-accent-600);
    transform: scale(1.1);
    box-shadow: 
        0 4px 12px rgba(25, 89, 131, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 1);
}

.remember-me-row input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    border-color: var(--color-primary-500);
    box-shadow: 
        0 4px 14px rgba(179, 44, 39, 0.35),
        0 2px 6px rgba(179, 44, 39, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.remember-me-row input[type="checkbox"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg) scale(1);
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    opacity: 1;
    animation: checkmark 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkmark {
    0% {
        transform: translate(-50%, -50%) rotate(45deg) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) rotate(45deg) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) rotate(45deg) scale(1);
        opacity: 1;
    }
}

.remember-me-row span {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.96rem;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.remember-me-row:has(input:checked) {
    background: 
        linear-gradient(145deg, rgba(254, 242, 242, 0.4), rgba(254, 226, 226, 0.3));
    border-color: rgba(179, 44, 39, 0.3);
    box-shadow: 
        0 4px 14px rgba(179, 44, 39, 0.12),
        inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.remember-me-row:has(input:checked) span {
    color: var(--color-primary-600);
    font-weight: 700;
}

/* Remember Me Checkbox - Enhanced Design */
.remember-me-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 16px 0 30px;
    cursor: pointer;
    user-select: none;
    padding: 16px 20px;
    border-radius: 14px;
    background: 
        linear-gradient(145deg, rgba(248, 250, 252, 0.7), rgba(241, 245, 249, 0.6));
    backdrop-filter: blur(8px);
    border: 2px solid rgba(226, 232, 240, 0.5);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 2px 8px rgba(15, 23, 42, 0.04),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.remember-me-row::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(179, 44, 39, 0.03), 
        rgba(25, 89, 131, 0.03));
    opacity: 0;
    transition: opacity 0.35s;
}

.remember-me-row:hover {
    background: 
        linear-gradient(145deg, rgba(250, 251, 252, 0.85), rgba(243, 246, 249, 0.75));
    border-color: rgba(203, 213, 225, 0.7);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 16px rgba(15, 23, 42, 0.08),
        inset 0 1px 3px rgba(255, 255, 255, 1);
}

.remember-me-row:hover::before {
    opacity: 1;
}

.remember-me-row input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--color-accent-500);
    border-radius: 7px;
    background: linear-gradient(145deg, #ffffff, rgba(248, 250, 252, 0.9));
    cursor: pointer;
    position: relative;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 2px 6px rgba(15, 23, 42, 0.08),
        inset 0 1px 2px rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.remember-me-row input[type="checkbox"]:hover {
    border-color: var(--color-accent-600);
    transform: scale(1.1);
    box-shadow: 
        0 4px 12px rgba(25, 89, 131, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 1);
}

.remember-me-row input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    border-color: var(--color-primary-500);
    box-shadow: 
        0 4px 14px rgba(179, 44, 39, 0.35),
        0 2px 6px rgba(179, 44, 39, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.remember-me-row input[type="checkbox"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg) scale(1);
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    opacity: 1;
    animation: checkmark 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkmark {
    0% {
        transform: translate(-50%, -50%) rotate(45deg) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) rotate(45deg) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) rotate(45deg) scale(1);
        opacity: 1;
    }
}

.remember-me-row span {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.96rem;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.remember-me-row:has(input:checked) {
    background: 
        linear-gradient(145deg, rgba(254, 242, 242, 0.4), rgba(254, 226, 226, 0.3));
    border-color: rgba(179, 44, 39, 0.3);
    box-shadow: 
        0 4px 14px rgba(179, 44, 39, 0.12),
        inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.remember-me-row:has(input:checked) span {
    color: var(--color-primary-600);
    font-weight: 700;
}

/* Input placeholder styling */
.floating-input::placeholder {
    color: transparent;
}

.floating-input:focus::placeholder {
    color: rgba(148, 163, 184, 0.4);
    transition: color 0.3s;
}

/* Autofill styling */
.floating-input:-webkit-autofill,
.floating-input:-webkit-autofill:hover,
.floating-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-main);
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    transition: background-color 5000s ease-in-out 0s;
}

.floating-input:-webkit-autofill ~ .floating-label {
    top: 0;
    font-size: 0.8rem;
    color: var(--color-accent-500);
    font-weight: 700;
    background: linear-gradient(to bottom, #ffffff 0%, #ffffff 50%, rgba(255, 255, 255, 0.95) 100%);
    padding: 2px 8px;
    transform: translateY(0);
    letter-spacing: 0;
}

/* Input focus glow effect */
.floating-label-group.is-focused::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 20px;
    background: radial-gradient(ellipse at center, 
        rgba(179, 44, 39, 0.15) 0%, 
        rgba(179, 44, 39, 0.08) 40%,
        transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: inputGlowPulse 2.5s ease-in-out infinite;
}

@keyframes inputGlowPulse {
    0%, 100% { 
        opacity: 0.5;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Ripple effect on focus */
.floating-label-group.is-focused::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: radial-gradient(circle at center, 
        rgba(179, 44, 39, 0.1), 
        transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: ripple 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.form-control {
    width: 100%;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 1.5px solid var(--border-color); /* Changed from hardcoded to variable */
    border-radius: 10px;
    background: var(--bg-surface); /* Changed to use theme variable */
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 1px 2px rgba(15, 23, 42, 0.04),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    position: relative;
    top: 5px;
    /* padding: 2px; */
}

[data-theme="dark"] .form-control {
    background: var(--bg-surface-alt);
    border-color: var(--border-color);
    color: var(--text-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary-500);
    background: var(--bg-body); /* Using theme variable for focus bg */
    box-shadow: 
        0 0 0 4px var(--color-primary-light),
        0 8px 20px -4px rgba(179, 44, 39, 0.2),
        0 2px 6px rgba(15, 23, 42, 0.08),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

[data-theme="dark"] .form-control:focus {
    background: var(--bg-surface);
}

.btn-block,
.login-submit-btn {
    width: 100%;
}

.login-submit-btn {
    margin-top: 10px;
    height: 56px;
    font-size: 1.08rem;
    letter-spacing: 0.015em;
    font-weight: 700;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 55%, #9e1f1a 100%);
    box-shadow: 
        0 4px 14px rgba(179, 44, 39, 0.35),
        0 2px 6px rgba(179, 44, 39, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-submit-btn:hover::before {
    left: 100%;
}

.login-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 28px rgba(179, 44, 39, 0.48),
        0 6px 12px rgba(179, 44, 39, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.login-submit-btn:active {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 16px rgba(179, 44, 39, 0.4),
        0 2px 6px rgba(179, 44, 39, 0.25);
}

.login-footer {
    margin-top: 32px;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    padding-top: 20px;
    text-align: center;
}

.footer-department {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0 0 4px;
}

.footer-organization {
    color: var(--text-heading);
    font-size: 0.91rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    margin: 0;
    opacity: 0.85;
}

.login-footer p {
    margin: 0;
}

.login-footer p + p {
    margin-top: 6px;
    font-weight: 700;
}

@media (max-width: 960px) {
    .login-card.login-card-modern {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        padding: 26px 24px;
    }

    .brand-title {
        font-size: 1.5rem;
    }

    .login-form-panel {
        padding: 28px 22px 24px;
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: 14px;
    }

    .login-title {
        font-size: 1.35rem;
    }
}

/* ============================================================
   Modern Top Navbar Layout
   ============================================================ */
.admin-wrapper.top-nav-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.top-navbar {
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    height: 70px;
    max-width: 1600px;
    margin: 0 auto;
    overflow: visible;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-left: 30px; /* Space before nav links */
}

.nav-logo {
    height: 40px; /* Fixed height to prevent logo from blowing up */
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-fast);
}

.nav-logo:hover {
    transform: scale(1.05);
}

.navbar-nav {
    /* flex: 1; */
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-primary-500);
    background: var(--color-primary-light);
}

.nav-link.active {
    color: white;
    background: var(--color-primary-500);
    box-shadow: 0 4px 12px rgba(179, 44, 39, 0.3);
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 2px);
    /* left: calc(100% - 70px); */
    /* right: 0; */
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    z-index: 1001;
    pointer-events: none;
}

@media (max-width: 640px) {
    .dropdown-menu {
        left: calc(100% - 70px);
    }
}

@media (max-width: 640px) {
    .dropdown-menu-management {
        right: 0
    }
}
.user-dropdown-container.show .dropdown-menu,
.nav-item.dropdown.show .dropdown-menu,
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-item.dropdown.show .dropdown-chevron {
    transform: rotate(180deg);
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--color-primary-light);
    color: var(--color-primary-500);
}

.dropdown-menu form {
    margin: 0;
}

.dropdown-menu button.dropdown-item {
    width: 100%;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    text-align: right;
    cursor: pointer;
}

.dropdown-menu button.dropdown-item:hover {
    background: var(--color-primary-light);
    color: var(--color-primary-500);
}

/* Navbar Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-dropdown-container {
    position: relative;
    cursor: pointer;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
}
[data-theme="dark"] .nav-user { background: rgba(255,255,255,0.05); }

.nav-user .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-500), #ff4742);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(179, 44, 39, 0.3);
}

.nav-user .user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-heading);
}

.text-danger { color: var(--color-danger) !important; }
.text-danger:hover { background-color: rgba(239, 68, 68, 0.1) !important; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-heading);
    cursor: pointer;
}

/* Main Content Adjustments for Top Nav */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px;
}

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

.page-title { margin: 0; font-size: 1.8rem; font-weight: 800; color: var(--text-heading); }

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .navbar-container { padding: 0 15px; }
    
    .mobile-menu-btn { display: block; }
    
    .navbar-nav {
        display: none; /* Hide by default on mobile */
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
        box-shadow: var(--shadow-md);
    }
    
    .navbar-nav.show { display: block; }
    
    .nav-list {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-item.dropdown.show .dropdown-menu {
        /* position: static; */
        box-shadow: none;
        /* background: transparent; */
        border: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        /* padding-right: 20px; */
        /* padding: 180px 0px 0px 40px; */
        height: fit-content;
    }
}

/* ============================================================
   Dashboard Cards (Glass & Hover effects)
   ============================================================ */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--color-primary-500), var(--color-accent-500));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
}

.stat-card:hover::after { opacity: 1; }

.stat-icon {
    width: 65px;
    height: 65px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.3);
}

.stat-details h3 { margin: 0 0 5px 0; font-size: 1rem; color: var(--text-muted); font-weight: 600; }
.stat-number { margin: 0; font-size: 2.25rem; font-weight: 800; color: var(--text-heading); font-family: var(--font-heading); }

/* Dashboard Grids */
.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: box-shadow var(--transition-normal);
}

.dashboard-card:hover { box-shadow: var(--shadow-lg); }

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.01);
}

.card-title { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--color-accent-500); }
[data-theme="dark"] .card-title { color: #e2e8f0; }

.card-body { padding: 25px; }
.card-body.p-0 { padding: 0; }

/* ============================================================
   Modern Tables
   ============================================================ */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }

.table th, .table td {
    padding: 16px 20px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--bg-body);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
}

.table tbody tr { transition: background-color var(--transition-fast); }
.table tbody tr:hover { background-color: var(--color-primary-light); }
.table tbody tr:last-child td { border-bottom: none; }

.table a { color: var(--color-accent-500); text-decoration: none; font-weight: 700; }
.table a:hover { color: var(--color-primary-500); text-decoration: underline; }

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-blue { background: rgba(14, 165, 233, 0.1); color: #0284c7; }
.badge-red { background: rgba(239, 68, 68, 0.1); color: #b91c1c; }
.badge-green { background: rgba(16, 185, 129, 0.1); color: #047857; }

/* Field Rows (Details view) */
.field-row { display: flex; flex-wrap: wrap; gap: 20px; }
.field-row > div { flex: 1 1 200px; }

/* Responsive adjustments */
@media (max-width: 992px) {
    .sidebar { position: fixed; right: 0; top: 0; bottom: 0; transform: translateX(100%); }
    .sidebar.open { transform: translateX(0); }
    .toggle-sidebar { display: block; }
}

/* ============================================================
   Premium Login Enhancements
   ============================================================ */

/* Animated ambient background */
.login-ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    animation: orbFloat 18s ease-in-out infinite alternate;
}

.orb-1 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(179, 44, 39, 0.55) 0%, transparent 70%);
    top: -120px;
    right: -100px;
    animation-duration: 22s;
}

.orb-2 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(25, 89, 131, 0.55) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    animation-duration: 26s;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(179, 44, 39, 0.35) 0%, transparent 70%);
    top: 40%;
    left: 25%;
    animation-duration: 20s;
    animation-delay: -10s;
}

.orb-4 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.35) 0%, transparent 70%);
    top: 15%;
    left: 45%;
    animation-duration: 24s;
    animation-delay: -15s;
}

.ambient-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.4;
    animation: gridDrift 30s linear infinite;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -40px) scale(1.08); }
}

@keyframes gridDrift {
    0% { transform: translateY(0); }
    100% { transform: translateY(60px); }
}

/* Premium card overrides */
.login-card.login-card-modern {
    border-radius: 28px;
    box-shadow:
        0 40px 80px -30px rgba(0, 0, 0, 0.55),
        0 16px 32px -12px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.login-card.login-card-modern::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.2));
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Brand panel shine */
.brand-shine {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.08) 45%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.08) 55%, transparent 70%);
    background-size: 200% 100%;
    animation: shineSweep 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shineSweep {
    0%, 100% { background-position: 200% 0; }
    50% { background-position: -200% 0; }
}

.brand-feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
}

.feature-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

/* Welcome badge */
.login-welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(179, 44, 39, 0.1), rgba(25, 89, 131, 0.1));
    border: 1px solid rgba(179, 44, 39, 0.15);
    color: var(--color-primary-600);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: 0.02em;
    animation: riseFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.08s forwards;
    opacity: 0;
}

.login-welcome-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-primary-500);
    box-shadow: 0 0 8px var(--color-primary-500);
    animation: pulseDot 1.8s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Submit button loading state */
.login-submit-btn {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
}

.login-submit-btn .btn-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: inherit;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
}

.login-submit-btn .btn-loader svg {
    animation: spin 1s linear infinite;
}

.login-submit-btn .btn-loader svg circle {
    stroke-dashoffset: 60;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-submit-btn.is-loading .btn-text {
    opacity: 0;
    transform: translateY(-10px);
}

.login-submit-btn.is-loading .btn-loader {
    opacity: 1;
    transform: translateY(0);
}

.login-submit-btn .btn-text {
    display: inline-block;
    transition: all 0.25s ease;
}

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

/* Shake animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

@keyframes shake-strong {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@keyframes shake-subtle {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.shake-normal {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.shake-strong {
    animation: shake-strong 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.shake-subtle {
    animation: shake-subtle 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Apply shake to modal card via JS class injection */
.alert-system-shake .alert-system-card {
    animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.login-form .remember-me-row {
    margin-top: 12px;
    margin-bottom: 32px;
}

/* Improved remember me styling */
.remember-me-row .remember-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid var(--color-accent-500);
    border-radius: 7px;
    background: linear-gradient(145deg, #ffffff, rgba(248, 250, 252, 0.9));
    flex-shrink: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 2px 6px rgba(15, 23, 42, 0.08),
        inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.remember-me-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.remember-me-row input[type="checkbox"]:checked + .remember-check {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    border-color: var(--color-primary-500);
    box-shadow:
        0 4px 14px rgba(179, 44, 39, 0.35),
        0 2px 6px rgba(179, 44, 39, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.remember-me-row input[type="checkbox"]:checked + .remember-check::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(1);
    animation: checkmark 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Footer organization line */
.footer-organization {
    color: var(--color-accent-600);
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 8px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ambient-orb,
    .ambient-grid,
    .brand-shine,
    .login-welcome-badge::before {
        animation: none;
    }
    .login-card.login-card-modern {
        transition: none;
        transform: none !important;
    }
}

/* Lock screen specific styles */
.lock-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 auto 18px;
    box-shadow: 0 8px 24px rgba(179, 44, 39, 0.35);
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.lock-user-name {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.lock-actions {
    text-align: center;
    margin-top: 20px;
}

.lock-logout-link {
    color: var(--color-accent-500);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: color 0.25s;
}

.lock-logout-link:hover {
    color: var(--color-primary-500);
    text-decoration: underline;
}

/* ============================================================
   Premium Admin Toast Notifications
   ============================================================ */
.admin-toast-container {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.admin-toast {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 320px;
    max-width: 420px;
    padding: 16px 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        0 20px 40px -12px rgba(15, 23, 42, 0.25),
        0 8px 16px -6px rgba(15, 23, 42, 0.15),
        0 0 0 1px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(-60px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.admin-toast--visible {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.admin-toast--hiding {
    opacity: 0;
    transform: translateX(-40px) scale(0.95);
}

.admin-toast::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(14, 165, 233, 0.2));
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.admin-toast--success .admin-toast-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.admin-toast--info .admin-toast-icon {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

.admin-toast-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-toast-content {
    flex: 1;
    min-width: 0;
}

.admin-toast-message {
    margin: 0;
    color: var(--text-heading);
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.5;
}

.admin-toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.25s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-toast-close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-heading);
    transform: rotate(90deg);
}

.admin-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, #10b981, #0ea5e9);
    opacity: 0.7;
}

[data-theme="dark"] .admin-toast {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.96) 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 576px) {
    .admin-toast-container {
        top: 12px;
        left: 12px;
        right: 12px;
    }
    .admin-toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

/* Mobile refinements */
@media (max-width: 960px) {
    .login-card.login-card-modern {
        border-radius: 22px;
    }
    .login-form-panel {
        padding: 34px 26px 28px;
    }
    .brand-feature-list {
        gap: 10px;
    }
    .brand-feature-list li {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: 12px;
        align-items: flex-start;
        padding-top: 24px;
    }
    .login-card.login-card-modern {
        border-radius: 18px;
    }
    .login-form-panel {
        padding: 26px 18px 22px;
    }
    .login-title {
        font-size: 1.45rem;
    }
    .floating-input {
        padding: 22px 56px 22px 18px;
        font-size: 1rem;
    }
    .floating-label {
        right: 56px;
        font-size: 1rem;
    }
    .floating-label-group .input-icon {
        right: 20px;
        width: 20px;
        height: 20px;
    }
}

/* ============================================================
   Premium Dashboard Styles
   ============================================================ */

/* Dashboard Header */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--color-accent-500) 0%, #1a6fa0 60%, var(--color-primary-500) 100%);
    border-radius: var(--radius-xl);
    color: white;
    box-shadow: 0 10px 30px -5px rgba(179, 44, 39, 0.35);
    position: relative;
    overflow: visible;
    z-index: 10;
}

.dashboard-header-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    z-index: 0;
    pointer-events: none;
}

.dashboard-header-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-header-content,
.dashboard-quick-search-container,
.dashboard-header-actions {
    position: relative;
    z-index: 1;
}

@media (min-width: 1024px) {
    .dashboard-quick-search-container {
    margin-right: auto;
}
}

#dashboard-quick-search {
    width: 100%;
}
@media(max-width: 640px) {
    #dashboard-quick-search {
        width: calc(100% - 33px)
    }
}

@media(max-width: 640px) {
    .charandpartcount {
        flex-direction: column;
    }
}

.dashboard-title {
    margin: 0 0 6px;
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
}

.dashboard-subtitle {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
    color: rgba(255,255,255,0.9);
}

.dashboard-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    animation: pulseLive 2s infinite;
}

@keyframes pulseLive {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.dashboard-date {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.95;
    font-family: 'IBM Plex Sans Arabic', monospace;
}

/* Primary Stat Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.stat-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    opacity: 1;
}

.stat-card--primary .stat-card-bg { background: linear-gradient(90deg, var(--color-success), #34d399); }
.stat-card--info .stat-card-bg { background: linear-gradient(90deg, var(--color-info), #38bdf8); }
.stat-card--warning .stat-card-bg { background: linear-gradient(90deg, var(--color-warning), #fbbf24); }
.stat-card--accent .stat-card-bg { background: linear-gradient(90deg, var(--color-primary-500), var(--color-accent-500)); }

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(0,0,0,0.03);
}

.stat-card--primary .stat-icon { background: rgba(16, 185, 129, 0.12); color: var(--color-success); }
.stat-card--info .stat-icon { background: rgba(14, 165, 233, 0.12); color: var(--color-info); }
.stat-card--warning .stat-icon { background: rgba(245, 158, 11, 0.12); color: var(--color-warning); }
.stat-card--accent .stat-icon { background: rgba(179, 44, 39, 0.1); color: var(--color-primary-500); }

.stat-details {
    flex: 1;
    min-width: 0;
}

.stat-details h3 {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-number {
    margin: 0 0 10px;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-heading);
    font-family: var(--font-heading);
    line-height: 1.1;
}

.stat-progress {
    width: 100%;
    height: 5px;
    background: rgba(0,0,0,0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 10px;
}

[data-theme="dark"] .stat-progress { background: rgba(255,255,255,0.08); }

.stat-progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s ease-out;
}

.stat-card--primary .stat-progress-bar { background: linear-gradient(90deg, var(--color-success), #34d399); }
.stat-card--info .stat-progress-bar { background: linear-gradient(90deg, var(--color-info), #38bdf8); }
.stat-card--warning .stat-progress-bar { background: linear-gradient(90deg, var(--color-warning), #fbbf24); }
.stat-card--accent .stat-progress-bar { background: linear-gradient(90deg, var(--color-primary-500), var(--color-accent-500)); }

.stat-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Secondary Metrics */
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 14px;
    margin-bottom: 32px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(0,0,0,0.03);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

[data-theme="dark"] .metric-icon { background: rgba(255,255,255,0.05); }

.metric-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-heading);
    font-family: var(--font-heading);
    line-height: 1.1;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.3;
}

.metric-card--alert {
    border-color: rgba(239, 68, 68, 0.25);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(239, 68, 68, 0.04) 100%);
}

/* Dashboard Sections */
.dashboard-section {
    margin-bottom: 36px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    margin: 0 0 4px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
}

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

.section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    gap: 22px;
    margin-bottom: 22px;
}

.dashboard-grid--2cols {
    grid-template-columns: repeat(2, 1fr);
}

.dashboard-grid--3cols {
    grid-template-columns: repeat(3, 1fr);
}

.dashboard-grid--full {
    grid-template-columns: 1fr;
}

@media (max-width: 1200px) {
    .dashboard-metrics {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid--2cols,
    .dashboard-grid--3cols { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
    .dashboard-stats { grid-template-columns: 1fr; }
    .dashboard-metrics { grid-template-columns: repeat(2, 1fr); }
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .section-actions {
        display: flex;
        flex-direction: column;
        align-items: start;
        gap: 10px;
    }
}

/* Card refinements */
.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-lg);
}

.dashboard-card--trend {
    border-top: 4px solid var(--color-primary-500);
}

.dashboard-card--gradient {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(179, 44, 39, 0.03) 100%);
    border-color: rgba(179, 44, 39, 0.15);
}

.card-header {
    padding: 22px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.01);
}

.card-title {
    margin: 0 0 4px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-accent-500);
}

[data-theme="dark"] .card-title { color: #e2e8f0; }

.card-subtitle {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

.trend-badge--up {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.trend-badge--down {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

[data-theme="dark"] .trend-badge--up { color: #34d399; }
[data-theme="dark"] .trend-badge--down { color: #f87171; }

/* Year Comparison */
.year-comparison {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-bottom: 20px;
}

.year-item {
    text-align: center;
}

.year-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.year-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-heading);
    font-family: var(--font-heading);
}

.year-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.year-growth {
    font-size: 1.1rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: rgba(0,0,0,0.04);
}

/* Chart Containers */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 300px;
}

.chart-container--trend {
    min-height: 380px;
}

.chart-container--doughnut {
    min-height: 280px;
    max-width: 280px;
    margin: 0 auto;
}

.chart-container--mini {
    min-height: 160px;
}

@media (max-width: 576px) {
    .chart-container,
    .chart-container--trend,
    .chart-container--doughnut {
        min-height: 260px;
    }
}

/* Dashboard Table refinements */
.table--dashboard tbody tr {
    animation: fadeSlideUp 0.4s ease-out both;
}

.table--dashboard tbody tr:nth-child(1) { animation-delay: 0.05s; }
.table--dashboard tbody tr:nth-child(2) { animation-delay: 0.1s; }
.table--dashboard tbody tr:nth-child(3) { animation-delay: 0.15s; }
.table--dashboard tbody tr:nth-child(4) { animation-delay: 0.2s; }
.table--dashboard tbody tr:nth-child(5) { animation-delay: 0.25s; }
.table--dashboard tbody tr:nth-child(6) { animation-delay: 0.3s; }

.user-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-accent-500);
    text-decoration: none;
    font-weight: 700;
    transition: color var(--transition-fast);
}

.user-link:hover {
    color: var(--color-primary-500);
}

.user-avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.mono-text {
    font-family: 'IBM Plex Sans Arabic', monospace;
    font-weight: 500;
}

.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }

/* Entrance animations */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-header,
.dashboard-stats > .stat-card,
.dashboard-metrics > .metric-card,
.dashboard-section,
.dashboard-grid > .dashboard-card {
    animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dashboard-header { animation-delay: 0s; }
.dashboard-stats > .stat-card:nth-child(1) { animation-delay: 0.05s; }
.dashboard-stats > .stat-card:nth-child(2) { animation-delay: 0.1s; }
.dashboard-stats > .stat-card:nth-child(3) { animation-delay: 0.15s; }
.dashboard-stats > .stat-card:nth-child(4) { animation-delay: 0.2s; }

.dashboard-metrics > .metric-card:nth-child(1) { animation-delay: 0.25s; }
.dashboard-metrics > .metric-card:nth-child(2) { animation-delay: 0.28s; }
.dashboard-metrics > .metric-card:nth-child(3) { animation-delay: 0.31s; }
.dashboard-metrics > .metric-card:nth-child(4) { animation-delay: 0.34s; }
.dashboard-metrics > .metric-card:nth-child(5) { animation-delay: 0.37s; }
.dashboard-metrics > .metric-card:nth-child(6) { animation-delay: 0.4s; }
.dashboard-metrics > .metric-card:nth-child(7) { animation-delay: 0.43s; }
.dashboard-metrics > .metric-card:nth-child(8) { animation-delay: 0.46s; }

.dashboard-section:nth-of-type(1) { animation-delay: 0.5s; }
.dashboard-section:nth-of-type(2) { animation-delay: 0.55s; }
.dashboard-section:nth-of-type(3) { animation-delay: 0.6s; }
.dashboard-section:nth-of-type(4) { animation-delay: 0.65s; }
.dashboard-section:nth-of-type(5) { animation-delay: 0.7s; }
.dashboard-section:nth-of-type(6) { animation-delay: 0.75s; }

@media (prefers-reduced-motion: reduce) {
    .dashboard-header,
    .dashboard-stats > .stat-card,
    .dashboard-metrics > .metric-card,
    .dashboard-section,
    .dashboard-grid > .dashboard-card,
    .table--dashboard tbody tr {
        animation: none;
    }
    .live-dot { animation: none; }
}

/* ============================================================
   Registrations Page Styles
   ============================================================ */

.registrations-card {
    animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.registrations-header {
    flex-wrap: wrap;
    gap: 16px;
}

.registrations-header .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.registrations-header .btn-outline-primary svg {
    width: 16px;
    height: 16px;
}

/* Filters */
.registrations-filters {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 20px;
}

[data-theme="dark"] .registrations-filters {
    background: rgba(255, 255, 255, 0.02);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.filter-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-heading);
}

[data-theme="dark"] .filter-group label {
    color: var(--text-heading-dark);
}

.filter-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-input-wrapper svg {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.filter-input-wrapper .form-control {
    padding-right: 38px;
}

.filters-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.filters-actions .btn-primary svg,
.filters-actions .btn-reset svg {
    width: 16px;
    height: 16px;
}

.btn-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-normal);
}

.btn-reset:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-heading);
    transform: translateY(-2px);
}

@media (max-width: 1200px) {
    .filters-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
    .filters-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .filters-grid { grid-template-columns: 1fr; }
    .filters-actions { flex-direction: column; }
    .filters-actions .btn,
    .filters-actions .btn-reset { width: 100%; }
}

/* Active Filters */
.active-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: rgba(25, 89, 131, 0.04);
    border: 1px solid rgba(25, 89, 131, 0.12);
    border-radius: var(--radius-lg);
}

[data-theme="dark"] .active-filters {
    background: rgba(25, 89, 131, 0.08);
    border-color: rgba(25, 89, 131, 0.2);
}

.active-filters-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-accent-500);
    white-space: nowrap;
}

.active-filters-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.filter-chip:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
}

.filter-chip-remove {
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 700;
}

.filter-chip--clear {
    background: rgba(179, 44, 39, 0.08);
    border-color: rgba(179, 44, 39, 0.2);
    color: var(--color-primary-500);
}

.filter-chip--clear:hover {
    background: var(--color-primary-500);
    color: white;
}

/* Registrations Table */
.registrations-table-wrapper {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.table--registrations {
    margin-bottom: 0;
}

.table--registrations th {
    background: var(--bg-body);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table--registrations td {
    vertical-align: middle;
    padding: 14px 16px;
}

.table--registrations tbody tr {
    transition: all var(--transition-fast);
}

.table--registrations tbody tr:hover {
    background: rgba(25, 89, 131, 0.04);
}

.col-number {
    width: 50px;
    text-align: center;
}

.row-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.col-actions {
    width: 70px;
    text-align: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.04);
    transition: all var(--transition-fast);
}

.btn-action:hover {
    background: var(--color-primary-500);
    color: white;
    transform: scale(1.1);
}

.btn-action--view:hover {
    background: var(--color-accent-500);
}

/* Badges */
.badge-male {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.badge-female {
    background: rgba(236, 72, 153, 0.12);
    color: #be185d;
}

.badge-edu {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
}

[data-theme="dark"] .badge-male { color: #7dd3fc; }
[data-theme="dark"] .badge-female { color: #f9a8d4; }
[data-theme="dark"] .badge-edu { color: #a5b4fc; }

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

.indicator {
    font-size: 0.95rem;
    opacity: 0.85;
    cursor: help;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h4 {
    margin: 0 0 6px;
    font-size: 1.1rem;
    color: var(--text-heading);
}

.empty-state p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Footer & Pagination */
.registrations-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pagination-info strong {
    color: var(--text-heading);
    font-weight: 700;
}

.pagination {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pagination-btn,
.pagination-number,
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination-btn,
.pagination-number {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
}

.pagination-btn:hover,
.pagination-number:hover {
    border-color: var(--color-primary-500);
    color: var(--color-primary-500);
    transform: translateY(-2px);
}

.pagination-number.active {
    background: var(--color-primary-500);
    border-color: var(--color-primary-500);
    color: white;
    box-shadow: 0 4px 12px rgba(179, 44, 39, 0.3);
}

.pagination-ellipsis {
    color: var(--text-muted);
    cursor: default;
}

.per-page-form {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.per-page-select {
    width: 70px;
    padding: 6px 10px;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .registrations-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    .per-page-form {
        justify-content: center;
    }
}

/* ============================================================
   Premium Registrations Page  — Full Redesign
   ============================================================ */

/* ── Page Wrapper ── */
.reg-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Page Header ── */
.reg-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 26px 30px;
    background: linear-gradient(135deg, var(--color-accent-500) 0%, #1a6fa0 60%, var(--color-primary-500) 100%);
    border-radius: var(--radius-xl);
    color: white;
    box-shadow: 0 10px 32px -6px rgba(25, 89, 131, 0.38);
    position: relative;
    overflow: hidden;
}

.reg-page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 90% -20%, rgba(255,255,255,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 40% 60% at 10% 110%, rgba(179,44,39,0.18) 0%, transparent 55%);
    pointer-events: none;
}

.reg-page-header__info {
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.reg-page-header__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
}

.reg-page-header__title {
    margin: 0 0 4px;
    font-size: 1.55rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.reg-page-header__subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

.reg-page-header__subtitle strong {
    color: #fff;
    font-weight: 700;
}

.reg-page-header__actions {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.reg-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: var(--radius-full);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    transition: all var(--transition-normal);
    backdrop-filter: blur(8px);
    white-space: nowrap;
    cursor: pointer;
}

.reg-export-btn:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* ── Filter Panel ── */
.reg-filter-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: visible;
    transition: box-shadow var(--transition-normal);
}

.reg-filter-panel:hover {
    box-shadow: var(--shadow-md);
}

.reg-filter-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.015);
    cursor: pointer;
    user-select: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

[data-theme="dark"] .reg-filter-panel__head {
    background: rgba(255,255,255,0.02);
}

.reg-filter-panel__head-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reg-filter-panel__head-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--color-primary-light);
    color: var(--color-primary-500);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.reg-filter-panel__head-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.97rem;
    color: var(--text-heading);
}

.reg-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: var(--color-primary-500);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
}

.reg-filter-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
    flex-shrink: 0;
}

.reg-filter-toggle-btn:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-500);
    color: var(--color-primary-500);
}

.reg-chevron {
    transition: transform var(--transition-normal);
}

.reg-filter-panel.is-collapsed .reg-chevron {
    transform: rotate(180deg);
}

.reg-filter-body {
    padding: 24px;
    transition: all var(--transition-normal);
}

.reg-filter-body.is-collapsed {
    display: none;
}

/* Filter Grid */
.reg-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.reg-filter-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.reg-filter-field--wide {
    grid-column: span 2;
}

.reg-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Inputs */
.reg-input {
    width: 100%;
    padding: 9px 14px;
    font-size: 0.92rem;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text-main);
    background: var(--bg-body);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.reg-input:hover {
    border-color: #b0bec5;
}

.reg-input:focus {
    border-color: var(--color-accent-500);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(25, 89, 131, 0.12);
}

.reg-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
    cursor: pointer;
}

.reg-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reg-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.reg-search-ico {
    position: absolute;
    right: 13px;
    color: var(--text-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.reg-search-input {
    padding-right: 40px;
}

/* Filter Actions */
.reg-filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
}

.reg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.93rem;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-normal);
}

.reg-btn:active { transform: scale(0.97); }

.reg-btn--primary {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    color: white;
    box-shadow: 0 4px 14px rgba(179,44,39,0.35);
}

.reg-btn--primary:hover {
    box-shadow: 0 6px 22px rgba(179,44,39,0.48);
    transform: translateY(-2px);
}

.reg-btn--ghost {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-muted);
}

.reg-btn--ghost:hover {
    background: rgba(0,0,0,0.04);
    border-color: #94a3b8;
    color: var(--text-heading);
    transform: translateY(-1px);
}

/* ── Active Filters Bar ── */
.reg-active-filters {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    background: rgba(25, 89, 131, 0.05);
    border: 1px solid rgba(25, 89, 131, 0.14);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}

[data-theme="dark"] .reg-active-filters {
    background: rgba(25, 89, 131, 0.1);
    border-color: rgba(25, 89, 131, 0.22);
}

.reg-active-filters__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-accent-500);
    white-space: nowrap;
    flex-shrink: 0;
}

.reg-active-filters__list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-chip:hover {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.3);
    color: var(--color-danger);
}

.filter-chip-label { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

.filter-chip-remove {
    font-size: 1rem;
    line-height: 1;
    font-weight: 800;
    opacity: 0.6;
}

.filter-chip:hover .filter-chip-remove { opacity: 1; }

.reg-clear-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(179,44,39,0.08);
    border: 1px solid rgba(179,44,39,0.2);
    border-radius: var(--radius-full);
    color: var(--color-primary-500);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.reg-clear-all:hover {
    background: var(--color-primary-500);
    border-color: var(--color-primary-500);
    color: #fff;
    transform: translateY(-1px);
}

/* ── Table Card ── */
.reg-table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* Table Toolbar */
.reg-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.01);
    flex-wrap: wrap;
}

[data-theme="dark"] .reg-table-toolbar {
    background: rgba(255,255,255,0.02);
}

.reg-results-count {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
}

.reg-results-count strong {
    color: var(--text-heading);
    font-weight: 700;
}

.reg-per-page-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reg-per-page-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.reg-per-page-select {
    padding: 5px 10px;
    font-size: 0.85rem;
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--text-heading);
    background: var(--bg-body);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-fast);
}

.reg-per-page-select:focus {
    border-color: var(--color-accent-500);
}

/* Scrollable Table Wrapper */
.reg-table-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Table */
.reg-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 900px;
}

.reg-th {
    padding: 13px 18px;
    text-align: right;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: var(--bg-body);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.reg-th--id {
    width: 72px;
    text-align: center;
}

.reg-th--actions {
    width: 90px;
    text-align: center;
}

/* Rows */
.reg-row {
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.reg-row:last-child {
    border-bottom: none;
}

.reg-row:hover {
    background: rgba(25, 89, 131, 0.035);
}

[data-theme="dark"] .reg-row:hover {
    background: rgba(25, 89, 131, 0.07);
}

.reg-td {
    padding: 14px 18px;
    vertical-align: middle;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Checkbox Column */
.reg-th--check,
.reg-td--check {
    width: 44px;
    text-align: center;
    padding: 14px 8px !important;
}

.reg-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-accent-500);
}

.reg-selected-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-accent-500);
    background: rgba(25,89,131,0.08);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}

.reg-btn--danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.reg-btn--danger:hover {
    background: #dc2626;
}

/* ID Badge */
.reg-td--id {
    text-align: center;
}

.reg-id-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 28px;
    padding: 0 8px;
    background: linear-gradient(135deg, rgba(25,89,131,0.08) 0%, rgba(25,89,131,0.05) 100%);
    border: 1px solid rgba(25,89,131,0.15);
    border-radius: var(--radius-sm);
    font-family: 'IBM Plex Sans Arabic', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-accent-500);
    letter-spacing: 0.02em;
}

[data-theme="dark"] .reg-id-badge {
    background: rgba(25,89,131,0.15);
    border-color: rgba(25,89,131,0.25);
    color: #7dd3fc;
}

.reg-id-badge--link {
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.reg-id-badge--link:hover {
    background: var(--color-accent-500);
    border-color: var(--color-accent-500);
    color: white;
    box-shadow: 0 3px 10px rgba(25,89,131,0.3);
    transform: translateY(-1px);
}

/* User Link */
.reg-user-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-heading);
    font-weight: 600;
    transition: color var(--transition-fast);
}

.reg-user-link:hover {
    color: var(--color-primary-500);
}

.reg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent-500) 0%, var(--color-accent-600) 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(25,89,131,0.25);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.reg-user-link:hover .reg-avatar {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(25,89,131,0.35);
}

.reg-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: inherit;
}

/* Mono text */
.reg-mono {
    font-family: 'IBM Plex Sans Arabic', monospace;
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--text-main);
    letter-spacing: 0.02em;
}

/* Governorate text */
.reg-gov-text {
    font-size: 0.88rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Date */
.reg-date {
    font-family: 'IBM Plex Sans Arabic', monospace;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Badges */
.reg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.reg-badge--male {
    background: rgba(14,165,233,0.1);
    color: #0369a1;
    border: 1px solid rgba(14,165,233,0.2);
}

.reg-badge--female {
    background: rgba(236,72,153,0.1);
    color: #be185d;
    border: 1px solid rgba(236,72,153,0.2);
}

.reg-badge--edu {
    background: rgba(99,102,241,0.1);
    color: #4338ca;
    border: 1px solid rgba(99,102,241,0.2);
}

[data-theme="dark"] .reg-badge--male  { color: #7dd3fc; background: rgba(14,165,233,0.15); border-color: rgba(14,165,233,0.25); }
[data-theme="dark"] .reg-badge--female { color: #f9a8d4; background: rgba(236,72,153,0.15); border-color: rgba(236,72,153,0.25); }
[data-theme="dark"] .reg-badge--edu   { color: #a5b4fc; background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.25); }

/* Text Indicator Tags */
.reg-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.reg-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.reg-tag--displaced {
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.25);
    color: #b45309;
}

.reg-tag--training {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.25);
    color: #047857;
}

.reg-tag--gov {
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.25);
    color: #3730a3;
}

[data-theme="dark"] .reg-tag--displaced { color: #fcd34d; background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.3); }
[data-theme="dark"] .reg-tag--training  { color: #6ee7b7; background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.3); }
[data-theme="dark"] .reg-tag--gov       { color: #a5b4fc; background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.3); }

.reg-none {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.5;
}

/* Actions Column */
.reg-td--actions {
    text-align: center;
    white-space: nowrap;
}

.reg-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(25,89,131,0.07);
    border: 1px solid rgba(25,89,131,0.15);
    border-radius: var(--radius-full);
    color: var(--color-accent-500);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.reg-view-btn:hover {
    background: var(--color-accent-500);
    border-color: var(--color-accent-500);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25,89,131,0.3);
}

/* Empty State */
.reg-empty-cell {
    padding: 0 !important;
}

.reg-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
}

.reg-empty__icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(0,0,0,0.03);
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.7;
}

.reg-empty__title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.reg-empty__sub {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.reg-empty__sub a {
    color: var(--color-primary-500);
    font-weight: 600;
    text-decoration: none;
}

.reg-empty__sub a:hover {
    text-decoration: underline;
}

/* ── Pagination Bar ── */
.reg-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    background: rgba(0,0,0,0.01);
}

[data-theme="dark"] .reg-pagination-bar {
    background: rgba(255,255,255,0.01);
}

.reg-pagination {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.reg-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.reg-page-btn:hover {
    border-color: var(--color-primary-500);
    color: var(--color-primary-500);
    background: var(--color-primary-light);
    transform: translateY(-1px);
}

.reg-page-btn--active {
    background: var(--color-primary-500) !important;
    border-color: var(--color-primary-500) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(179,44,39,0.28);
    pointer-events: none;
}

.reg-page-btn--nav {
    color: var(--text-muted);
}

.reg-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 36px;
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.reg-pagination-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.reg-pagination-meta strong {
    color: var(--text-heading);
    font-weight: 700;
}

/* ── Responsive ── */
@media (max-width: 1280px) {
    .reg-filter-grid { grid-template-columns: repeat(3, 1fr); }
    .reg-filter-field--wide { grid-column: span 2; }
}

@media (max-width: 1024px) {
    .reg-filter-grid { grid-template-columns: repeat(2, 1fr); }
    .reg-filter-field--wide { grid-column: span 2; }
}

@media (max-width: 768px) {
    .reg-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .reg-filter-grid { grid-template-columns: 1fr; }
    .reg-filter-field--wide { grid-column: span 1; }

    .reg-filter-actions {
        flex-direction: column;
    }

    .reg-filter-actions .reg-btn {
        width: 100%;
        justify-content: center;
    }

    .reg-pagination-bar {
        flex-direction: column;
        align-items: center;
    }

    .reg-pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    .reg-table-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .reg-page-header__icon { display: none; }
    .reg-page-header__title { font-size: 1.25rem; }
}

/* Dashboard Refresh & Insights Styles */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin-icon {
    animation: spin 0.8s linear infinite;
}
    /* box-shadow: 0 4px 12px rgba(25,89,131,0.3);
} */

/* Empty State */
.reg-empty-cell {
    padding: 0 !important;
}

.reg-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
}

.reg-empty__icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(0,0,0,0.03);
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.7;
}

.reg-empty__title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.reg-empty__sub {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.reg-empty__sub a {
    color: var(--color-primary-500);
    font-weight: 600;
    text-decoration: none;
}

.reg-empty__sub a:hover {
    text-decoration: underline;
}

.dashboard-header-actions {
    position: relative;
    z-index: 1;
}

/* ── Pagination Bar ── */
.reg-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    background: rgba(0,0,0,0.01);
}

[data-theme="dark"] .reg-pagination-bar {
    background: rgba(255,255,255,0.01);
}

.reg-pagination {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.reg-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.reg-page-btn:hover {
    border-color: var(--color-primary-500);
    color: var(--color-primary-500);
    background: var(--color-primary-light);
    transform: translateY(-1px);
}

.reg-page-btn--active {
    background: var(--color-primary-500) !important;
    border-color: var(--color-primary-500) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(179,44,39,0.28);
    pointer-events: none;
}

.reg-page-btn--nav {
    color: var(--text-muted);
}

.reg-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 36px;
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.reg-pagination-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.reg-pagination-meta strong {
    color: var(--text-heading);
    font-weight: 700;
}

/* ── Responsive ── */
@media (max-width: 1280px) {
    .reg-filter-grid { grid-template-columns: repeat(3, 1fr); }
    .reg-filter-field--wide { grid-column: span 2; }
}

@media (max-width: 1024px) {
    .reg-filter-grid { grid-template-columns: repeat(2, 1fr); }
    .reg-filter-field--wide { grid-column: span 2; }
}

@media (max-width: 768px) {
    .reg-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .reg-filter-grid { grid-template-columns: 1fr; }
    .reg-filter-field--wide { grid-column: span 1; }

    .reg-filter-actions {
        flex-direction: column;
    }

    .reg-filter-actions .reg-btn {
        width: 100%;
        justify-content: center;
    }

    .reg-pagination-bar {
        flex-direction: column;
        align-items: center;
    }

    .reg-pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    .reg-table-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .reg-page-header__icon { display: none; }
    .reg-page-header__title { font-size: 1.25rem; }
}

/* Dashboard Refresh & Insights Styles */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin-icon {
    animation: spin 0.8s linear infinite;
}

.stat-card, .metric-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease !important;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
    border-color: rgba(179,44,39,0.2) !important;
}

.metric-card:hover {
    transform: translateY(-6px) scale(1.03) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important;
    border-color: rgba(25, 89, 131, 0.2) !important;
}

[data-theme="dark"] .smart-insights-card {
    background: var(--bg-card) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
}
[data-theme="dark"] .smart-insights-card h3 {
    color: var(--color-primary-400) !important;
}
[data-theme="dark"] #smart-insights-list {
    color: #94a3b8 !important;
}

#refresh-dashboard-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.1);
}

.insight-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border-color: rgba(25, 89, 131, 0.3) !important;
}

[data-theme="dark"] .insight-item {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .insight-item:hover {
    border-color: rgba(25, 89, 131, 0.5) !important;
}

/* Quick Search Dropdown & Input overrides */
#dashboard-quick-search::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
#dashboard-quick-search:focus {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15) !important;
}

.quick-search-item {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.quick-search-item:last-child {
    border-bottom: none;
}

.quick-search-item:hover {
    background: rgba(179, 44, 39, 0.05);
    color: var(--color-primary-500);
}

[data-theme="dark"] .quick-search-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-primary-400);
}

.quick-search-name {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.quick-search-meta {
    display: flex;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Leaflet Map Premium Polish */
#leaflet-map {
    border: none;
}

[data-theme="dark"] .leaflet-tile-container {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    font-family: 'Tajawal', sans-serif !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
}

.leaflet-popup-content {
    font-size: 0.88rem !important;
    line-height: 1.6 !important;
}

.leaflet-container a.leaflet-popup-close-button {
    color: var(--text-muted) !important;
    padding: 6px 8px 0 0 !important;
}

#quick-search-results {
    z-index: 9999 !important;
}

/* Leaflet Tooltip & Attribution */
.leaflet-gov-tooltip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
    color: var(--text-main) !important;
    font-family: 'Tajawal', sans-serif !important;
}

.leaflet-gov-tooltip::before {
    border-top-color: var(--border-color) !important;
}

.leaflet-control-attribution {
    display: none !important;
}

/* Map Permanent Label Overlays */
.leaflet-polygon-label-container {
    background: transparent !important;
    border: none !important;
}
.leaflet-polygon-label {
    text-align: center;
    font-family: 'Tajawal', sans-serif;
    pointer-events: none;
    line-height: 1.25;
}
.leaflet-polygon-label .label-name {
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--text-main);
    text-shadow: 0 1.5px 3px var(--bg-card), 0 0 5px var(--bg-card), 0 0 8px var(--bg-card);
}
.leaflet-polygon-label .label-count {
    font-weight: 900;
    font-size: 1.1rem;
    margin: 2px 0;
    text-shadow: 0 1.5px 3px var(--bg-card), 0 0 5px var(--bg-card), 0 0 8px var(--bg-card);
}
.leaflet-polygon-label .label-pct {
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-shadow: 0 1.5px 3px var(--bg-card), 0 0 5px var(--bg-card), 0 0 8px var(--bg-card);
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM NAVBAR & FOOTER STYLING
   ═══════════════════════════════════════════════════════════════ */

/* --- Navbar height & logo size increase --- */
.navbar-container {
    height: 80px;
}

.nav-logo {
    height: 50px;
}

/* --- Gradient top accent bar --- */
.top-navbar {
    position: relative;
}

.top-navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary-500) 0%, var(--color-accent-500) 100%);
    z-index: 1001;
}

/* --- Active link gradient glow --- */
.nav-link.active {
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%) !important;
    box-shadow: 0 4px 15px rgba(179, 44, 39, 0.35) !important;
}

/* --- Theme toggle in dropdown: show/hide labels --- */
#themeToggle .icon-light,
#themeToggle .theme-label-light { display: none; }
#themeToggle .icon-dark,
#themeToggle .theme-label-dark { display: inline; }

[data-theme="dark"] #themeToggle .icon-light,
[data-theme="dark"] #themeToggle .theme-label-light { display: inline; }
[data-theme="dark"] #themeToggle .icon-dark,
[data-theme="dark"] #themeToggle .theme-label-dark { display: none; }

/* --- Dropdown divider --- */
.dropdown-divider {
    height: 1px;
    margin: 6px 0;
    background: var(--border-color);
}

/* --- Premium Footer --- */
.admin-footer {
    text-align: center;
    padding: 2.5rem 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    background: linear-gradient(180deg, transparent 0%, rgba(179, 44, 39, 0.02) 100%);
    position: relative;
}

[data-theme="dark"] .admin-footer {
    background: linear-gradient(180deg, transparent 0%, rgba(25, 89, 131, 0.03) 100%);
}

.admin-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary-500) 0%, var(--color-accent-500) 100%);
    border-radius: var(--radius-full);
}

.admin-footer-text {
    font-weight: 700;
    color: var(--text-heading);
    font-size: 0.9rem;
    letter-spacing: 0.2px;
    font-family: var(--font-heading);
}

.admin-footer-copyright {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* --- Responsive: Navbar mobile adjustments --- */
@media (max-width: 992px) {
    .navbar-container { height: 65px; }
    .nav-logo { height: 40px; }
    .navbar-nav { top: 65px; }
    .user-info { display: none; }
}

@media (max-width: 768px) {
    .main-content { padding: 15px; }
    .page-title { font-size: 1.4rem; }
    .admin-footer { margin-top: 2rem; padding: 1.5rem 1rem 1.2rem; }
    .admin-footer-text { font-size: 0.82rem; }
}

@media (max-width: 480px) {
    .main-content { padding: 10px; }
    .page-title { font-size: 1.2rem; }
    .navbar-container { padding: 0 10px; height: 55px; }
    .nav-logo { height: 34px; }
    .navbar-nav { top: 55px; }
    .nav-user { padding: 3px 8px; gap: 6px; }
    .nav-user .user-avatar { width: 28px; height: 28px; font-size: 0.85rem; }
}

/* ==========================================
   GLOBAL PREMIUM LOADING SPINNER & OVERLAY
   ========================================== */
#global-page-spinner {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#global-page-spinner.visible {
    opacity: 1;
    pointer-events: auto;
}
.spinner-content-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem 3rem;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    transform: scale(0.9);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90%;
    width: 320px;
    text-align: center;
}
#global-page-spinner.visible .spinner-content-box {
    transform: scale(1);
}



/* ==========================================
   GLOBAL PREMIUM PORTAL TOOLTIP SYSTEM
   ========================================== */
.custom-tooltip-container {
    position: relative;
    cursor: help;
}
.custom-tooltip-box {
    display: none;
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    width: 230px;
    z-index: 99999;
    text-align: right;
    direction: rtl;
}
.custom-tooltip-box.global-tooltip-clone {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto;
}
.custom-tooltip-box::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--border-color) transparent transparent transparent;
}
.tooltip-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.35rem;
    font-family: var(--font-heading);
}
.tooltip-list {
    margin: 0;
    padding: 0 0.5rem 0 0;
    list-style: none;
    max-height: 180px;
    overflow-y: auto;
}
.tooltip-list li {
    font-size: 0.78rem;
    color: var(--text-main);
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
}

/* ==========================================
   PREMIUM CUSTOM CALENDAR & DATEPICKER
   ========================================== */
.custom-calendar-popup {
    position: absolute;
    z-index: 100000;
    width: 290px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 16px;
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    user-select: none;
    animation: calendarFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes calendarFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.calendar-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-heading, #0f172a);
    text-align: center;
}
.calendar-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-body, #f8fafc);
    color: var(--text-main, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: all 0.2s ease;
}
.calendar-btn:hover {
    background: var(--color-primary-500);
    color: #ffffff;
    border-color: var(--color-primary-500);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 6px;
}
.calendar-weekday {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    padding: 4px 0;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.calendar-months-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px 0;
}

.calendar-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-main, #334155);
    transition: all 0.2s ease;
}
.calendar-cell--month {
    aspect-ratio: auto;
    height: 40px;
}
.calendar-cell:hover {
    background: var(--bg-body, #f1f5f9);
    color: var(--color-primary-500);
}
.calendar-cell--other {
    color: var(--text-muted, #cbd5e1);
    opacity: 0.5;
}
.calendar-cell--today {
    border: 1.5px solid var(--color-primary-500);
    color: var(--color-primary-500);
    font-weight: 800;
}
.calendar-cell--selected {
    background: var(--color-primary-500) !important;
    color: #ffffff !important;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(179, 44, 39, 0.3);
}

.calendar-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}
.calendar-footer-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: var(--bg-body, #f1f5f9);
    color: var(--text-main, #334155);
    transition: all 0.2s ease;
}
.calendar-footer-btn--today {
    background: var(--color-primary-500);
    color: #ffffff;
}
.calendar-footer-btn--today:hover {
    box-shadow: 0 4px 10px rgba(179, 44, 39, 0.2);
}
.calendar-footer-btn:hover {
    opacity: 0.9;
}

/* 🛸 Global Floating Bulk Action Bar */
.floating-bulk-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 120px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    border-radius: 50px;
    padding: 8px 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.35s;
}

[data-theme="dark"] .floating-bulk-bar {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(51, 65, 85, 0.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.floating-bulk-bar.show {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.floating-bulk-bar .bulk-count {
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
}

[data-theme="dark"] .floating-bulk-bar .bulk-count {
    color: #f8fafc;
}

.floating-bulk-bar .bulk-actions-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.floating-bulk-bar button, 
.floating-bulk-bar .bulk-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    border: none;
    border-radius: 30px;
    padding: 8px 18px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.25s, transform 0.2s;
    font-family: var(--font-heading);
}

.floating-bulk-bar .bulk-btn-danger {
    background: #ef4444;
    color: #ffffff !important;
}
.floating-bulk-bar .bulk-btn-danger:hover {
    background: #dc2626;
    transform: scale(1.02);
}

.floating-bulk-bar .bulk-btn-success {
    background: #10b981;
    color: #ffffff !important;
}
.floating-bulk-bar .bulk-btn-success:hover {
    background: #059669;
    transform: scale(1.02);
}

.floating-bulk-bar .bulk-btn-primary {
    background: #3b82f6;
    color: #ffffff !important;
}
.floating-bulk-bar .bulk-btn-primary:hover {
    background: #2563eb;
    transform: scale(1.02);
}

.floating-bulk-bar .bulk-btn-outline {
    background: transparent;
    color: var(--text-main, #334155) !important;
    border: 1px solid var(--border-color, #cbd5e1);
}

[data-theme="dark"] .floating-bulk-bar .bulk-btn-outline {
    color: #cbd5e1 !important;
    border-color: #475569;
}

.floating-bulk-bar .bulk-btn-outline:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.02);
}

[data-theme="dark"] .floating-bulk-bar .bulk-btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

.floating-bulk-bar button:active,
.floating-bulk-bar .bulk-btn:active {
    transform: scale(0.98);
}

/* ============================================================
   Dynamic Form Builder (Premium Admin Styles)
   ============================================================ */

.form-builder-page {
    max-width: 1400px;
    margin: 0 auto;
}

.form-builder-header {
    margin-bottom: 1.5rem;
}

.form-builder-header .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    transition: color 0.2s;
}

.form-builder-header .back-link:hover {
    color: var(--color-primary-500);
}

.form-builder-header .page-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-heading);
    margin: 0 0 0.35rem 0;
}

.form-builder-header .page-subtitle {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
}

.form-builder-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1100px) {
    .form-builder-layout {
        grid-template-columns: 1fr;
    }
}

.form-builder-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: box-shadow var(--transition-normal);
}

.form-builder-card:hover {
    box-shadow: var(--shadow-lg);
}

.form-builder-card .card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.01);
}

.form-builder-card .card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-builder-card .card-body {
    padding: 1.5rem;
}

/* Fields Container */
.form-fields-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 120px;
}

.form-fields-container.drag-over {
    background: var(--color-primary-light);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 2px var(--color-primary-500);
}

/* Field Card */
.form-field-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: grab;
}

.form-field-card:hover {
    border-color: rgba(179, 44, 39, 0.3);
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.form-field-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    cursor: grabbing;
    box-shadow: var(--shadow-xl);
}

.form-field-card.drag-over {
    border-top: 3px solid var(--color-primary-500) !important;
    background-color: rgba(179, 44, 39, 0.03) !important;
    transition: background-color 0.2s ease, border-top 0.2s ease;
}

.form-field-card.has-error {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-field-card.has-error .field-error-message {
    display: flex;
}

/* Field Header */
.form-field-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--border-color);
}

.field-drag-handle {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: grab;
    transition: all 0.2s;
    flex-shrink: 0;
}

.field-drag-handle:hover {
    background: var(--color-primary-light);
    color: var(--color-primary-500);
}

.field-drag-handle:active {
    cursor: grabbing;
}

.field-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--color-primary-light);
    color: var(--color-primary-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.field-type-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: rgba(25, 89, 131, 0.1);
    color: var(--color-accent-500);
    margin-right: auto;
}

.field-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.field-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.field-action-btn:hover {
    background: var(--color-primary-light);
    color: var(--color-primary-500);
    border-color: rgba(179, 44, 39, 0.3);
}

.field-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Field Body */
.form-field-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-field-body {
        grid-template-columns: 1fr;
    }
}

.form-field-full {
    grid-column: 1 / -1;
}

.form-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-heading);
}

.form-field-group .field-input,
.form-field-group .field-select,
.form-field-group .field-textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.2s;
    outline: none;
}

.form-field-group .field-input:focus,
.form-field-group .field-select:focus,
.form-field-group .field-textarea:focus {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px var(--color-primary-light);
    background: var(--bg-card);
}

.form-field-group .field-input.error,
.form-field-group .field-select.error,
.form-field-group .field-textarea.error {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-field-group .field-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-field-group .field-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    padding-left: 2.25rem;
}

.form-field-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-heading);
    cursor: pointer;
    margin-top: 1.6rem;
}

.form-field-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary-500);
    cursor: pointer;
}

/* Validation Rules */
.field-validation-rules {
    border-top: 1px dashed var(--border-color);
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-validation-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.field-validation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    align-items: center;
}

.field-validation-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
}

.field-validation-checkbox input {
    width: 15px;
    height: 15px;
    accent-color: var(--color-primary-500);
    cursor: pointer;
}

.field-validation-number {
    display: flex;
    align-items: center;
    gap: 6px;
}

.field-validation-number span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.field-validation-number input {
    width: 70px;
    padding: 4px 8px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 0.8rem;
}

/* Options Section */
.field-options-section {
    border-top: 1px dashed var(--border-color);
    padding-top: 1rem;
    display: none;
}

.field-options-section.visible {
    display: block;
    animation: fadeSlideIn 0.25s ease-out;
}

/* Empty State */
.form-builder-empty-state {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-body);
}

.form-builder-empty-state .empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
}

.form-builder-empty-state .empty-title {
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.35rem;
}

.form-builder-empty-state .empty-desc {
    font-size: 0.9rem;
    margin: 0;
}

/* Error Messages */
.field-error-message {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-danger);
    margin-top: 4px;
}

.form-builder-global-errors {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.form-builder-global-errors ul {
    margin: 0;
    padding-right: 1.25rem;
    color: var(--color-danger);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Preview Panel */
.form-builder-preview {
    position: sticky;
    top: 90px;
}

.form-preview-frame {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
}

.form-preview-field {
    margin-bottom: 1rem;
}

.form-preview-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 5px;
}

.form-preview-field .required-mark {
    color: var(--color-danger);
    margin-right: 3px;
}

.form-preview-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.85rem;
}

/* Settings Form */
.form-settings-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1rem;
}

.form-settings-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-heading);
}

.form-settings-group .settings-input,
.form-settings-group .settings-select,
.form-settings-group .settings-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.2s;
    outline: none;
}

.form-settings-group .settings-input:focus,
.form-settings-group .settings-select:focus,
.form-settings-group .settings-textarea:focus {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px var(--color-primary-light);
    background: var(--bg-card);
}

.form-settings-group .settings-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-settings-group .settings-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

.form-settings-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0.5rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-heading);
}

.form-settings-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary-500);
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .form-builder-card .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .form-field-header {
        flex-wrap: wrap;
    }

    .field-type-badge {
        margin-right: 0;
    }
}

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

/* ============================================================
   Form Builder Enhancements
   ============================================================ */

/* Theme Settings */
.form-settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-color {
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    padding: 2px;
    background: white;
}

.settings-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.settings-color::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.color-input-wrapper .color-text {
    flex: 1;
    font-family: monospace;
    direction: ltr;
    text-align: left;
}

.btn-outline-accent {
    background: transparent;
    border-color: var(--color-accent-500);
    color: var(--color-accent-500);
}

.btn-outline-accent:hover {
    background: var(--color-accent-500);
    color: white;
}

/* Extra Field Settings */
.field-extra-settings,
.field-section-settings {
    border-top: 1px dashed var(--border-color);
    padding-top: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .field-extra-settings,
    .field-section-settings,
    .form-settings-row {
        grid-template-columns: 1fr;
    }
}

/* Conditional Logic Builder */
.field-conditional-logic {
    border-top: 1px dashed var(--border-color);
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-conditional-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.field-conditional-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-heading);
}

.field-conditional-toggle input {
    width: 15px;
    height: 15px;
    accent-color: var(--color-primary-500);
    cursor: pointer;
}

.field-conditional-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: fadeSlideIn 0.25s ease-out;
}

.field-conditional-rules {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-conditional-rule {
    display: grid;
    grid-template-columns: 1fr 100px 1fr 28px;
    gap: 0.5rem;
    align-items: center;
}

.field-conditional-rule select,
.field-conditional-rule input {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
}

.field-conditional-rule select:focus,
.field-conditional-rule input:focus {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.field-conditional-remove {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--color-danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.field-conditional-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.field-conditional-add {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.45rem 0.85rem;
    border: 1px dashed var(--color-accent-500);
    border-radius: 8px;
    background: rgba(25, 89, 131, 0.04);
    color: var(--color-accent-500);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    width: fit-content;
}

.field-conditional-add:hover {
    background: var(--color-accent-500);
    color: white;
}

.field-conditional-operator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-heading);
    font-weight: 700;
}

.field-conditional-operator select {
    padding: 0.4rem 0.6rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    .field-conditional-rule {
        grid-template-columns: 1fr;
    }
}

/* Live Preview Public Style */
.form-preview-public {
    --form-primary: var(--color-primary-500);
    --form-accent: var(--color-accent-500);
}

.form-preview-section {
    border-bottom: 2px solid var(--form-primary);
    padding: 0.75rem 0 0.25rem;
    margin: 1rem 0 0.5rem;
}

.badge-gray { background: rgba(100, 116, 139, 0.1); color: #475569; }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: #b45309; }

.status-dropdown {
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding-left: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 8px center;
    min-width: 110px;
}

.status-dropdown.badge-blue { background-color: rgba(14, 165, 233, 0.1); color: #0284c7; }
.status-dropdown.badge-warning { background-color: rgba(245, 158, 11, 0.1); color: #b45309; }
.status-dropdown.badge-green { background-color: rgba(16, 185, 129, 0.1); color: #047857; }
.status-dropdown.badge-red { background-color: rgba(239, 68, 68, 0.1); color: #b91c1c; }
.status-dropdown.badge-gray { background-color: rgba(100, 116, 139, 0.1); color: #475569; }

.flag-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.flag-btn:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.4);
    color: var(--color-warning);
}

.flag-btn.flagged {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.5);
    color: var(--color-warning);
}

.admin-notes-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.85rem;
    resize: vertical;
    min-height: 48px;
    transition: all 0.2s;
    outline: none;
}

.admin-notes-textarea:focus {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.admin-notes-textarea.notes-saved {
    border-color: var(--color-success);
    background: rgba(16, 185, 129, 0.05);
}

.source-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: rgba(25, 89, 131, 0.08);
    color: var(--color-accent-500);
    font-size: 0.75rem;
    font-weight: 700;
}

.submissions-filter-form {
    width: 100%;
}

.submissions-filter-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    align-items: end;
}

@media (max-width: 1200px) {
    .submissions-filter-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .submissions-filter-grid { grid-template-columns: 1fr; }
}

.status-summary-card {
    padding: 1rem;
    justify-content: center;
    text-decoration: none;
}

.status-summary-card:hover {
    transform: translateY(-3px);
}

.source-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.source-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.source-chip .source-name {
    font-weight: 600;
    color: var(--text-heading);
}

.source-chip .source-count {
    background: var(--color-primary-500);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.submissions-table th {
    white-space: nowrap;
}

.submissions-table td {
    vertical-align: middle;
}

/* ============================================================
   Forms Index Page Enhancements
   ============================================================ */

.forms-index-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.forms-search-filter {
    display: flex;
    gap: 0.75rem;
    flex: 1;
    min-width: 320px;
}

.forms-view-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.view-toggle {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
}

.view-toggle-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn.active {
    background: var(--color-primary-500);
    color: white;
}

.view-toggle-btn:hover:not(.active) {
    background: var(--color-primary-light);
    color: var(--color-primary-500);
}

/* Grid View */
.forms-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.form-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.form-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 0.75rem;
}

.form-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--color-primary-light);
    color: var(--color-primary-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.form-card-status {
    display: flex;
    gap: 6px;
}

.form-card-body {
    padding: 0 1.25rem 1rem;
    flex: 1;
}

.form-card-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.35;
}

.form-card-desc {
    margin: 0 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

.form-card-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-accent-500);
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
}

.form-card-link:hover {
    color: var(--color-primary-500);
}

.form-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-body);
    border-top: 1px solid var(--border-color);
}

.form-card-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.form-card-stat.wide {
    grid-column: 1 / -1;
}

.form-card-stat-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-heading);
}

.form-card-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.form-card-progress {
    width: 100%;
    height: 5px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 4px;
}

.form-card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-500), var(--color-accent-500));
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.form-card-actions {
    display: flex;
    gap: 6px;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.form-card-actions .field-action-btn {
    flex: 1;
    min-width: 70px;
}

/* List View */
.forms-list-view {
    animation: fadeSlideIn 0.3s ease-out;
}

@media (max-width: 992px) {
    .forms-index-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .forms-search-filter {
        width: 100%;
        min-width: auto;
    }

    .forms-view-actions {
        justify-content: space-between;
    }

    .forms-grid-view {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .forms-search-filter {
        flex-direction: column;
    }

    .forms-search-filter .settings-select {
        width: 100% !important;
    }
}

/* ============================================================
   Admin Modal (Used by Form Builder Submission Details)
   ============================================================ */

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.admin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
}

.admin-modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 650px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: fadeSlideIn 0.25s ease-out;
    overflow: hidden;
}

.admin-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.01);
}

.admin-modal-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-heading);
}

.admin-modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.admin-modal-close:hover {
    background: var(--color-primary-light);
    color: var(--color-primary-500);
}

.admin-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.admin-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-body);
}

@media (max-width: 640px) {
    .admin-modal-content {
        max-height: 90vh;
    }
}

/* ── Searchable Multi-Select Filter Component ── */
.reg-multi {
    position: relative;
    width: 100%;
    z-index: 1;
}

.reg-multi.is-open {
    z-index: 40;
}

.reg-multi__control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 42px;
    padding: 5px 14px;
    background: var(--bg-body);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: text;
    transition: all var(--transition-fast);
}

.reg-multi__control:hover {
    border-color: #b0bec5;
}

.reg-multi__control:focus-within {
    border-color: var(--color-accent-500);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(25, 89, 131, 0.12);
}

.reg-multi__tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.reg-multi__tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: rgba(25, 89, 131, 0.1);
    border: 1px solid rgba(25, 89, 131, 0.22);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-accent-500);
    white-space: nowrap;
}

.reg-multi__tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: inherit;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.reg-multi__tag-remove:hover {
    background: rgba(179, 44, 39, 0.15);
    color: var(--color-primary-500);
}

.reg-multi__search {
    flex: 1;
    min-width: 120px;
    padding: 4px 2px;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-main);
    outline: none;
}

.reg-multi__search::placeholder { color: var(--text-muted); }

.reg-multi__chevron {
    color: var(--text-muted);
    flex-shrink: 0;
    pointer-events: none;
}

.reg-multi__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    max-height: 240px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
    display: none;
}

[data-theme="dark"] .reg-multi__dropdown {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.reg-multi__dropdown.is-open { display: block; }

.reg-multi__options {
    list-style: none;
    margin: 0;
    padding: 6px;
}

.reg-multi__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.reg-multi__option:hover {
    background: rgba(25, 89, 131, 0.08);
}

.reg-multi__option.is-selected {
    color: var(--color-accent-500);
    font-weight: 700;
}

.reg-multi__option.is-selected::before {
    content: '\2713';
    font-weight: 800;
    color: var(--color-accent-500);
}

.reg-multi__empty {
    padding: 14px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.reg-multi__hint {
    padding: 8px 16px 4px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.reg-multi__loading {
    padding: 14px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================================
   Eligibility Builder (Registration Linking)
   ============================================================ */
.elig-section {
    margin-bottom: 1.25rem;
}

.elig-section:last-child {
    margin-bottom: 0;
}

.elig-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 2px;
}

.elig-section-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0 0 0.6rem;
}

.elig-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.elig-section-head .elig-section-hint {
    margin-bottom: 0.75rem;
}

.elig-op-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.elig-op-card {
    position: relative;
    display: block;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
    cursor: pointer;
    background: var(--bg-card);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.elig-op-card:hover {
    border-color: rgba(179, 44, 39, 0.45);
}

.elig-op-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.elig-op-card.is-active,
.elig-op-card:has(input:checked) {
    border-color: var(--color-primary-500);
    background: var(--color-primary-light);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.elig-op-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.elig-op-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-heading);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.elig-op-badge {
    font-family: monospace;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--color-primary-500);
    background: var(--bg-body);
    border: 1px solid rgba(179, 44, 39, 0.4);
    border-radius: 6px;
    padding: 1px 6px;
}

.elig-op-card.is-active .elig-op-badge,
.elig-op-card:has(input:checked) .elig-op-badge {
    background: var(--color-primary-500);
    color: #fff;
    border-color: var(--color-primary-500);
}

.elig-op-desc {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.elig-count {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--color-primary-500);
    background: var(--color-primary-light);
    border: 1px solid rgba(179, 44, 39, 0.4);
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}

.elig-count.is-empty {
    color: var(--text-muted);
    background: var(--bg-body);
    border-color: var(--border-color);
}

.elig-rows {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.eligibility-row {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1.55fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-body);
    animation: fadeSlideIn 0.2s ease;
}

.eligibility-field-wrap,
.eligibility-value-wrap {
    min-width: 0;
}

.eligibility-op,
.eligibility-value {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.eligibility-op:focus,
.eligibility-value:focus {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.eligibility-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--color-danger, #b91c1c);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.eligibility-remove:hover {
    background: var(--color-danger, #b91c1c);
    border-color: var(--color-danger, #b91c1c);
    color: #fff;
}

.elig-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 0.6rem;
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-accent-500);
    background: transparent;
    border: 1.5px dashed #3882b6;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.elig-add-btn:hover {
    background: var(--color-accent-50, rgba(25, 89, 131, 0.08));
    color: var(--color-accent-600);
}

.elig-note {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.35);
    margin-top: 1rem;
}

.elig-note-icon {
    font-size: 1rem;
    line-height: 1.4;
}

.elig-note p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-main);
    line-height: 1.8;
}

/* Searchable select (eligibility) */
.elig-search-select {
    position: relative;
    min-width: 0;
}

.elig-search-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    text-align: right;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.elig-search-btn:hover {
    border-color: rgba(179, 44, 39, 0.45);
}

.elig-search-btn:focus {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.elig-search-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
}

.elig-search-label.has-value {
    color: var(--text-main);
    font-weight: 600;
}

.elig-search-caret {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.elig-search-btn.is-open .elig-search-caret {
    transform: rotate(180deg);
}

.elig-search-panel {
    position: fixed;
    z-index: 20000;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    padding: 0.5rem;
}

.elig-search-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.82rem;
    outline: none;
    margin-bottom: 0.4rem;
}

.elig-search-input:focus {
    border-color: var(--color-primary-500);
}

.elig-search-list {
    max-height: 250px;
    overflow-y: auto;
    border-radius: 8px;
}

.elig-search-item {
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
    color: var(--text-main);
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.elig-search-item:hover,
.elig-search-item.is-highlighted {
    background: var(--color-primary-light);
    color: var(--color-primary-500);
}

.elig-search-empty {
    padding: 1rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 768px) {
    .elig-op-grid {
        grid-template-columns: 1fr;
    }

    .eligibility-row {
        grid-template-columns: 1fr 1fr auto;
    }

    .eligibility-value-wrap {
        grid-column: 1 / -1;
    }
}

/* Form Builder: Tabbed Sidebar */
.sidebar-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: sticky;
    top: 1rem;
}

.sidebar-tabs {
    display: flex;
    gap: 4px;
    padding: 0.75rem 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.01);
}

.sidebar-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.6rem 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.sidebar-tab:hover {
    color: var(--text-heading);
    background: var(--bg-body);
}

.sidebar-tab.is-active {
    color: var(--color-primary-500);
    border-bottom-color: var(--color-primary-500);
    background: var(--color-primary-light);
}

.sidebar-tab-panel {
    display: none;
    padding: 1.25rem 1.5rem;
}

.sidebar-tab-panel.is-active {
    display: block;
    animation: fadeSlideIn 0.2s ease;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.25rem 0;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0,0,0,0.01);
}

.field-count-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--color-accent-500);
    background: var(--color-accent-50, rgba(25, 89, 131, 0.08));
    border: 1px solid rgba(25, 89, 131, 0.4);
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .sidebar-tab {
        font-size: 0.7rem;
        padding: 0.55rem 0.2rem;
    }

    .sidebar-tab span {
        display: none;
    }
}

