@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Inter:wght@400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ============================================================
   BLOOD BOT DASHBOARD — PREMIUM REDESIGN v3.0
   Dark Prism · Glassmorphism · Neon Accents
   ============================================================ */

:root {
    /* === Core Palette === */
    --primary: #ff3c41;
    --primary-alt: #e62d32;
    --primary-glow: rgba(255, 60, 65, 0.18);
    --primary-rgb: 255, 60, 65;

    --accent-purple: #7c3aed;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-gold: #f59e0b;

    /* === Backgrounds === */
    --bg-root: #08080d;
    --bg-surface: #0e0e16;
    --bg-card: rgba(255, 255, 255, 0.028);
    --bg-card-hover: rgba(255, 255, 255, 0.048);
    --bg-sidebar: rgba(10, 10, 16, 0.96);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-input: rgba(0, 0, 0, 0.25);

    /* === Text === */
    --text-white: #ffffff;
    --text-main: #d4d4e0;
    --text-dim: #7878a0;
    --text-muted: #50506a;

    /* === Borders === */
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 60, 65, 0.25);
    --border-subtle: rgba(255, 255, 255, 0.03);

    /* === Radius === */
    --radius-full: 9999px;
    --radius-2xl: 28px;
    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 7px;

    /* === Transitions === */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --t-fast: 0.18s var(--ease);
    --t-base: 0.3s var(--ease);
    --t-slow: 0.5s var(--ease);

    /* === Shadows === */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(255, 60, 65, 0.12);
    --shadow-premium: 0 30px 80px -15px rgba(0, 0, 0, 0.8);

    /* === Blur === */
    --blur-sm: 8px;
    --blur-md: 20px;
    --blur-lg: 40px;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html { scroll-behavior: smooth; }

html, body {
    width: 100%;
    overflow-x: hidden;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', 'Outfit', 'Cairo', sans-serif;
    background: var(--bg-root);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
}

/* Ambient background glow */
body::before {
    content: '';
    position: fixed;
    top: -30%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 60, 65, 0.04) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    left: 10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.03) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.app-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR — Slick & Refined
   ═══════════════════════════════════════════════════════════ */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border-left: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 1000;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* Sidebar top gradient line */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

/* Brand */
.sidebar-brand {
    padding: 32px 28px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}
.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-alt));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 6px 20px rgba(255, 60, 65, 0.35);
    flex-shrink: 0;
}
.sidebar-brand-text {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, #fff 30%, rgba(255,255,255,0.5) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Nav Section Label */
.nav-section-label {
    padding: 16px 28px 6px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Nav Links */
.nav-group { list-style: none; padding: 0 12px; }
.nav-item { margin-bottom: 2px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--t-fast);
    position: relative;
    border-radius: var(--radius-md);
    letter-spacing: 0.1px;
}

.nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    transition: var(--t-fast);
    flex-shrink: 0;
}

.nav-link .nav-text { flex: 1; }

.nav-link .nav-badge {
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

.nav-link:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.04);
}
.nav-link:hover i { color: var(--text-white); }

.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 60, 65, 0.15) 0%, rgba(255, 60, 65, 0.06) 100%);
    border: 1px solid rgba(255, 60, 65, 0.12);
}
.nav-link.active i { color: var(--primary); }

.nav-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px var(--primary);
}

/* Sidebar footer (user card) */
.sidebar-footer {
    margin-top: auto;
    padding: 16px 12px;
    border-top: 1px solid var(--border-subtle);
}
.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-glass);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--t-fast);
}
.sidebar-user-card:hover { background: rgba(255,255,255,0.06); }
.sidebar-user-card img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-username { font-size: 0.82rem; font-weight: 700; color: var(--text-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-guild { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* ═══════════════════════════════════════════════════════════
   MAIN WRAPPER & HEADER
   ═══════════════════════════════════════════════════════════ */
.main-wrapper {
    margin-right: 260px; /* Space for fixed sidebar */
    width: calc(100% - 260px);
    background: var(--bg-root);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    height: 72px;
    padding: 0 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 8, 13, 0.7);
    backdrop-filter: blur(var(--blur-md));
    -webkit-backdrop-filter: blur(var(--blur-md));
    position: sticky;
    top: 0;
    z-index: 900;
    width: 100%;
}

.header-left-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mobile-toggle {
    display: none;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-dim);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--t-fast);
    font-size: 1.1rem;
}
.mobile-toggle:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.08);
}

.server-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text-white);
    font-size: 0.9rem;
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.header-btn {
    width: 38px; height: 38px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-dim);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--t-fast);
    font-size: 0.9rem;
    text-decoration: none;
}
.header-btn:hover { color: var(--text-white); border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); }

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--t-fast);
}
.user-box:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
.user-box img {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}
.user-box-name { font-size: 0.82rem; font-weight: 700; color: var(--text-white); }

/* ═══════════════════════════════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════════════════════════════ */
.content-area {
    padding: 48px 60px;
    max-width: 1920px; /* Premium 1080p width on a 4K monitor */
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Page Title */
.page-title { 
    margin-bottom: 44px; 
    text-align: center;
    width: 100%;
}
.page-title h1 {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    color: var(--text-white);
    line-height: 1.1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}
.title-accent {
    height: 4px;
    width: 80px;
    background: var(--primary);
    border-radius: 2px;
    margin: 20px auto;
}
.page-title.text-center { text-align: center; }
.page-title.text-center .title-accent { margin: 20px auto; }
.page-eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--primary);
    margin-bottom: 10px;
    display: block;
}
.page-subtitle {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-top: 10px;
    font-weight: 500;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   CARDS & SECTION CARDS
   ═══════════════════════════════════════════════════════════ */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px;
    margin-bottom: 28px;
    transition: var(--t-base);
    position: relative;
    overflow: hidden;
}
.section-container {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
}
.responsive-padding { padding: 40px; }
.header-flex-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
@media (max-width: 900px) {
    .responsive-padding { padding: 24px; }
    .header-flex-mobile {
        flex-direction: column;
        align-items: center; /* Centered on mobile */
        text-align: center;
        gap: 15px;
    }
}

/* Tabs System */
.tabs-container {
    display: inline-flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--border);
    justify-content: center;
    margin: 10px auto;
}
.section-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}
.section-card:hover {
    border-color: rgba(255,255,255,0.09);
    background: var(--bg-card-hover);
}

/* Responsive Table Wrapper */
.table-box {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    scrollbar-width: thin;
}
.table-box::-webkit-scrollbar { height: 4px; }
.table-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

/* Stat / Quick Card */
.card-3d {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    transition: var(--t-base);
    position: relative;
    overflow: hidden;
}
.card-3d::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 120px; height: 120px;
    background: radial-gradient(circle at bottom right, var(--primary-glow), transparent 70%);
    opacity: 0;
    transition: var(--t-base);
}
.card-3d:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 60, 65, 0.15);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    background: var(--bg-card-hover);
}
.card-3d:hover::after { opacity: 1; }

.card-3d i { font-size: 2.2rem; color: var(--primary); margin-bottom: 22px; display: block; opacity: 0.85; }
.card-3d .stat { font-size: 3.4rem; font-weight: 950; margin-bottom: 6px; color: var(--text-white); letter-spacing: -2.5px; font-variant-numeric: tabular-nums; }
.card-3d .label { font-size: 0.75rem; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 2.5px; }

/* ═══════════════════════════════════════════════════════════
   TABLE SYSTEM
   ═══════════════════════════════════════════════════════════ */
.table-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
    position: relative;
}
table { width: 100%; border-collapse: collapse; }
th {
    text-align: right;
    padding: 16px 28px;
    background: rgba(255, 255, 255, 0.015);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 18px 28px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--t-fast);
}
tr:last-child td { border-bottom: none; }
tr { transition: var(--t-fast); }
tr:hover td { background: rgba(255, 255, 255, 0.025); }

/* ═══════════════════════════════════════════════════════════
   BUTTON SYSTEM
   ═══════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 26px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: var(--t-fast);
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: var(--t-fast);
}
.btn:hover::before { background: rgba(255,255,255,0.08); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-alt) 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 60, 65, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255, 60, 65, 0.45);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-white);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
}

.btn-icon {
    width: 40px; height: 40px; padding: 0;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-dim);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}
.btn-icon:hover { color: var(--primary); border-color: rgba(255, 60, 65, 0.3); background: rgba(255, 60, 65, 0.06); transform: translateY(-2px); }

/* ═══════════════════════════════════════════════════════════
   SAVE BAR — Floating Pill
   ═══════════════════════════════════════════════════════════ */
.save-bar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    z-index: 3000;
    width: auto;
    max-width: 800px;
    min-width: 520px;
    background: rgba(12, 12, 20, 0.92);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 60, 65, 0.18);
    padding: 12px 16px 12px 20px;
    border-radius: 99px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 60, 65, 0.08);
    opacity: 0;
    pointer-events: none;
    transition: all 0.45s var(--ease);
}
.save-bar.active {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.save-bar-content {
    display: flex;
    align-items: center;
    gap: 14px;
}
.save-bar-icon {
    width: 36px; height: 36px;
    background: rgba(255, 60, 65, 0.12);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    font-size: 0.95rem;
    flex-shrink: 0;
}
.save-bar h3 { font-size: 0.88rem; font-weight: 700; color: #fff; margin: 0; }
.save-bar p { font-size: 0.72rem; color: var(--text-dim); margin: 3px 0 0; }

/* ═══════════════════════════════════════════════════════════
   TABS SYSTEM
   ═══════════════════════════════════════════════════════════ */
.tabs-nav {
    display: flex;
    gap: 6px;
    padding: 5px;
    margin-bottom: 32px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: fit-content;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    padding: 10px 22px;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--t-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-family: inherit;
}
.tab-btn:hover { color: var(--text-white); background: rgba(255, 255, 255, 0.04); }
.tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 60, 65, 0.2), rgba(255, 60, 65, 0.08));
    border-color: rgba(255, 60, 65, 0.18);
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeInUp 0.35s var(--ease); }

/* ═══════════════════════════════════════════════════════════
   INPUTS & FORM ELEMENTS
   ═══════════════════════════════════════════════════════════ */
input, textarea, select {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-white);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: var(--t-fast);
    line-height: 1.5;
    appearance: none;
    -webkit-appearance: none;
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%237878a0' stroke-width='2' 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 14px center; /* RTL: arrow on the left */
    background-size: 18px;
    padding-left: 42px !important;
}
input:focus, textarea:focus, select:focus {
    border-color: rgba(255, 60, 65, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 60, 65, 0.07);
    background: rgba(0, 0, 0, 0.35);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

.input-group { margin-bottom: 2.4rem; }
.input-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--text-white);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}
.input-hint { color: var(--text-muted); font-size: 0.77rem; margin-top: 10px; font-weight: 500; line-height: 1.5; }

/* Range slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border: none;
    border-radius: 4px;
    height: 6px;
    padding: 0;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
    cursor: pointer;
    transition: var(--t-fast);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }

/* ═══════════════════════════════════════════════════════════
   ROLE MULTISELECT
   ═══════════════════════════════════════════════════════════ */
.select-trigger, .roles-multiselect {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-height: 52px;
    padding: 12px 18px;
    cursor: pointer;
    transition: var(--t-fast);
}
.select-trigger:hover, .roles-multiselect:hover { border-color: rgba(255,255,255,0.12); }
.roles-multiselect.active { border-color: rgba(255, 60, 65, 0.35); box-shadow: 0 0 0 3px rgba(255, 60, 65, 0.07); }

.roles-multiselect { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: relative; }
.selected-tags { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }

.role-tag {
    background: rgba(255, 60, 65, 0.1);
    border: 1px solid rgba(255, 60, 65, 0.2);
    border-radius: var(--radius-sm);
    padding: 5px 11px;
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-white);
    transition: var(--t-fast);
}
.role-tag:hover { border-color: var(--primary); background: rgba(255, 60, 65, 0.15); }
.role-tag i { font-size: 0.7rem; opacity: 0.4; cursor: pointer; transition: var(--t-fast); }
.role-tag i:hover { opacity: 1; color: var(--primary); transform: scale(1.15); }
.role-tag-icon { font-size: 0.85rem; opacity: 0.7; color: var(--primary); }
.role-color-dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 6px currentColor; flex-shrink: 0; }

.placeholder { color: var(--text-muted); font-size: 0.88rem; pointer-events: none; }
.placeholder.hidden { display: none; }

.dropdown-menu {
    background: #0d0d15;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 2000;
    position: absolute;
    width: 100%;
    top: calc(100% + 6px);
    right: 0;
    display: none;
    backdrop-filter: blur(var(--blur-md));
}
.roles-multiselect.active .dropdown-menu { display: block; animation: dropdownIn 0.2s var(--ease); }

.search-input-field {
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 12px 16px;
    width: 100%;
    color: #fff;
    outline: none;
    font-size: 0.86rem;
    margin: 0;
}
.search-input-field:focus { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 60, 65, 0.2); box-shadow: none; }

.options-list { max-height: 260px; overflow-y: auto; padding: 6px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }
.options-list::-webkit-scrollbar { width: 4px; }
.options-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.option-item, .role-option {
    padding: 9px 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--t-fast);
    color: var(--text-main);
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
    font-weight: 500;
}
.option-item:hover, .role-option:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-white); }
.option-item.selected, .role-option.selected { color: var(--primary); background: rgba(255, 60, 65, 0.08); font-weight: 700; }
.role-option.separator {
    padding: 8px 13px;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-align: center;
    pointer-events: none;
    opacity: 0.5;
    letter-spacing: 2px;
    background: rgba(255,255,255,0.02) !important;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 8px 0;
}

.search-select { position: relative; width: 100%; }
.select-trigger { display: flex; align-items: center; justify-content: space-between; overflow: hidden; }
.selected-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--text-white); }
.select-trigger i { opacity: 0.5; font-size: 0.75rem; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   TOGGLE SWITCH
   ═══════════════════════════════════════════════════════════ */
.switch { position: relative; display: inline-block; width: 42px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: 0.35s var(--ease);
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.08);
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 2px; bottom: 2px;
    background-color: rgba(255,255,255,0.6);
    transition: 0.35s var(--ease);
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-green); border-color: transparent; box-shadow: 0 0 12px rgba(16, 185, 129, 0.4); }
input:checked + .slider:before { transform: translateX(20px); background-color: white; }

/* ═══════════════════════════════════════════════════════════
   SETTINGS GRID
   ═══════════════════════════════════════════════════════════ */
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px 40px; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: 1fr; } }

.section-header {
    margin: 60px 0 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 60, 65, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
}
.section-header h2 { font-size: 1.4rem; color: var(--text-white); margin: 0; font-weight: 900; }
.section-header i { color: var(--primary); font-size: 1.2rem; }

/* ═══════════════════════════════════════════════════════════
   SweetAlert2 Overrides
   ═══════════════════════════════════════════════════════════ */
.swal2-popup {
    background: rgba(10, 10, 18, 0.97) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 22px !important;
    padding: 2rem !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7) !important;
}
.swal2-title { color: #fff !important; font-family: 'Cairo', sans-serif !important; font-weight: 800 !important; font-size: 1.5rem !important; margin-bottom: 0.7rem !important; }
.swal2-html-container { color: rgba(255, 255, 255, 0.65) !important; font-family: 'Inter', sans-serif !important; font-size: 0.95rem !important; }
.swal2-confirm { background: var(--primary) !important; border-radius: 10px !important; padding: 11px 30px !important; font-weight: 700 !important; box-shadow: 0 8px 20px rgba(255, 60, 65, 0.35) !important; transition: all 0.3s ease !important; }
.swal2-confirm:hover { transform: translateY(-2px); box-shadow: 0 14px 26px rgba(255, 60, 65, 0.45) !important; }
.swal2-icon { border-color: rgba(255, 255, 255, 0.08) !important; }
.swal2-success-circular-line-left, .swal2-success-circular-line-right, .swal2-success-fix { background-color: transparent !important; }
.swal2-icon.swal2-success [class^='swal2-success-line'] { background-color: var(--primary) !important; }
.swal2-icon.swal2-success { border-color: var(--primary) !important; }

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
.fade-in { animation: fadeInUp 0.4s var(--ease) both; }
.fade-in:nth-child(2) { animation-delay: 0.06s; }
.fade-in:nth-child(3) { animation-delay: 0.12s; }
.fade-in:nth-child(4) { animation-delay: 0.18s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Instant Reveal (FOUC prevention) */
.app-container { opacity: 0.15; transition: opacity 0.12s ease-out; }
.app-container.loaded { opacity: 1 !important; }

/* ═══════════════════════════════════════════════════════════
   RTL OVERRIDES
   ═══════════════════════════════════════════════════════════ */
[dir="rtl"] { text-align: right; }
[dir="rtl"] .sidebar { border-left: none; border-right: 1px solid var(--border); }
[dir="rtl"] .nav-link.active::after { left: auto; right: 0; border-radius: 4px 0 0 4px; }
[dir="rtl"] .main-wrapper { margin-right: 260px; margin-left: 0; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN (Mobile & Tablet)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
    .mobile-toggle { display: flex; }
    
    .sidebar { 
        position: fixed; 
        right: 0; 
        top: 0; 
        height: 100vh;
        width: 280px;
        z-index: 2000;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        flex-direction: column;
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }
    [dir="ltr"] .sidebar { right: auto; left: 0; transform: translateX(-100%); box-shadow: 10px 0 30px rgba(0,0,0,0.5); }
    
    body.sidebar-open .sidebar { transform: translateX(0) !important; }
    body.sidebar-open { overflow: hidden; } /* Prevent background scroll */
    
    .main-wrapper { width: 100% !important; padding-right: 0 !important; margin-right: 0 !important; }
    .top-header { padding: 0 20px; height: 64px; }
    
    /* Table Responsive Refinements */
    th, td { padding: 14px 18px !important; font-size: 0.78rem !important; }
    table { min-width: 850px !important; }
    .table-box { border-radius: 12px; margin-bottom: 30px; }
    
    .content-area { padding: 24px 16px !important; }
}

@media (max-width: 600px) {
    .top-header { height: 64px; }
    .header-right .user-box-name { display: none; }
    .header-right .user-box { padding: 6px; }
    .header-right .btn-icon { width: 36px; height: 36px; }
    .content-area { padding: 20px 12px; }
    .page-title h1 { font-size: 1.8rem; }
}

@media (max-width: 800px) {
    .responsive-table, 
    .responsive-table thead, 
    .responsive-table tbody, 
    .responsive-table th, 
    .responsive-table td, 
    .responsive-table tr {
        display: block;
        width: 100%;
    }
    .responsive-table thead { display: none; } /* Hide headers on mobile */
    .responsive-table tr {
        margin-bottom: 20px;
        background: rgba(255, 255, 255, 0.02);
        padding: 20px;
        border-radius: 18px;
        border: 1px solid var(--border);
    }
    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0 !important;
        border: none !important;
        text-align: left;
    }
    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 800;
        color: var(--text-dim);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    .delete-btn:hover {
        background: rgba(255, 60, 65, 0.15) !important;
        color: #ff3c41 !important;
        border-color: #ff3c41 !important;
    }
}    
@media (max-width: 600px) {
    .top-header { height: 64px; }
    .header-right .user-box-name { display: none; }
    .header-right .user-box { padding: 6px; }
    
    .content-area { padding: 24px 16px; }
    .section-card { padding: 24px; }
    
    .card-grid { grid-template-columns: 1fr; }
    
    .page-title h1 { font-size: 1.6rem; overflow-wrap: break-word; word-wrap: break-word; }
    .page-subtitle { font-size: 0.85rem; }
}

@media (max-width: 400px) {
    .content-area { padding: 20px 12px; }
    .page-title h1 { font-size: 1.4rem; }
    .page-subtitle { font-size: 0.8rem; }
    .top-header { padding: 0 12px; }
}

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR — Minimal
   ═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.06) transparent; }
