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

:root {
    /* === Core Palette — KSHK === */
    --primary: #FF5C2B;
    --primary-alt: #FF5833;
    --primary-glow: rgba(255, 92, 43, 0.15);
    --primary-rgb: 255, 92, 43;

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

    /* === Backgrounds === */
    --bg-root: #F7F5F2;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FFF8F4;
    --bg-sidebar: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(0, 0, 0, 0.03);
    --bg-input: #FFFFFF;

    /* === Text === */
    --text-white: #1A1A1A;
    --text-main: #3D3D3D;
    --text-dim: #6B6B6B;
    --text-muted: #9A9A9A;

    /* === Borders === */
    --border: #E8E4DE;
    --border-hover: rgba(255, 92, 43, 0.35);
    --border-subtle: #F0ECE6;

    /* === 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.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 40px rgba(255, 92, 43, 0.1);
    --shadow-glow: 0 0 28px rgba(255, 92, 43, 0.12);
    --shadow-premium: 0 24px 60px -12px rgba(0, 0, 0, 0.1);

    /* === Blur === */
    --blur-sm: 8px;
    --blur-md: 16px;
    --blur-lg: 28px;
}

/* ── 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: 'IBM Plex Sans Arabic', 'Inter', Tahoma, sans-serif;
    background: var(--bg-root);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
}

/* Ambient orange orbs */
body::before {
    content: '';
    position: fixed;
    top: -25%;
    right: -8%;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(255, 92, 43, 0.12) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: '';
    position: fixed;
    bottom: -15%;
    left: 8%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(255, 138, 92, 0.08) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

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

/* ═══════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════ */
.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::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.7;
}

.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, 92, 43, 0.35);
    flex-shrink: 0;
}
.sidebar-brand-text {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text-white);
}
.sidebar-brand-text span { color: var(--primary); }

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

.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-dim);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--t-fast);
    position: relative;
    border-radius: var(--radius-md);
}

.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, 92, 43, 0.06);
}
.nav-link:hover i { color: var(--primary); }

.nav-link.active {
    color: var(--primary);
    background: linear-gradient(135deg, rgba(255, 92, 43, 0.12) 0%, rgba(255, 92, 43, 0.04) 100%);
    border: 1px solid rgba(255, 92, 43, 0.18);
}
.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 10px rgba(255, 92, 43, 0.4);
}

.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, 92, 43, 0.05); border-color: var(--border-hover); }
.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;
    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(247, 245, 242, 0.9);
    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: #fff;
    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(--primary);
    border-color: var(--border-hover);
    background: rgba(255, 92, 43, 0.05);
}

.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 10px rgba(16, 185, 129, 0.5);
    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: #fff;
    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(--primary);
    border-color: var(--border-hover);
    background: rgba(255, 92, 43, 0.05);
}

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--t-fast);
}
.user-box:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.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;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
}

.page-title {
    margin-bottom: 44px;
    text-align: center;
    width: 100%;
}
.page-title h1 {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--text-white);
    line-height: 1.15;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}
.title-accent {
    height: 4px;
    width: 72px;
    background: linear-gradient(90deg, var(--primary), var(--primary-alt));
    border-radius: 2px;
    margin: 18px auto;
}
.page-title.text-center { text-align: center; }
.page-title.text-center .title-accent { margin: 18px auto; }
.page-eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    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-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;
    box-shadow: var(--shadow-sm);
}
.section-container {
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--border);
    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;
        text-align: center;
        gap: 15px;
    }
}

.tabs-container {
    display: inline-flex;
    gap: 8px;
    background: rgba(0, 0, 0, 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: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 92, 43, 0.25), transparent);
}
.section-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.table-box {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    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(0,0,0,0.1); border-radius: 10px; }

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

.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;
    box-shadow: var(--shadow-sm);
}
.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(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
    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.9; }
.card-3d .stat { font-size: 3.2rem; font-weight: 900; margin-bottom: 6px; color: var(--text-white); letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.card-3d .label { font-size: 0.75rem; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 2px; }

/* ═══════════════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════════════ */
table { width: 100%; border-collapse: collapse; }
th {
    text-align: right;
    padding: 16px 28px;
    background: rgba(0, 0, 0, 0.015);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    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, 92, 43, 0.03); }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.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.12); }

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

.btn-secondary {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-white);
}
.btn-secondary:hover {
    border-color: var(--border-hover);
    color: var(--primary);
    background: rgba(255, 92, 43, 0.04);
    transform: translateY(-2px);
}

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

.btn-icon {
    width: 40px; height: 40px; padding: 0;
    background: #fff;
    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: var(--border-hover);
    background: rgba(255, 92, 43, 0.05);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════
   SAVE BAR
   ═══════════════════════════════════════════════════════════ */
.save-bar {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(-150px);
    z-index: 5000;
    width: auto;
    min-width: 560px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 92, 43, 0.2);
    padding: 10px 10px 10px 24px;
    border-radius: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 0 30px rgba(255, 92, 43, 0.08);
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.save-bar.active {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.save-bar-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.save-bar-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 92, 43, 0.12);
    border: 1px solid rgba(255, 92, 43, 0.22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.save-bar-text h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-white);
    margin: 0;
}

.save-bar-text p {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin: 4px 0 0;
    font-weight: 500;
}

.save-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.save-bar .btn {
    padding: 0 24px;
    font-size: 0.85rem;
    border-radius: 12px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
}

.btn-undo {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
    color: var(--text-white);
}
.btn-undo:hover {
    background: rgba(0, 0, 0, 0.07);
    border-color: #d4cfc7;
}

.btn-save-vibrant {
    background: linear-gradient(135deg, #FF5C2B 0%, #FF5833 100%);
    color: #fff;
    border: none;
    box-shadow: 0 8px 22px rgba(255, 92, 43, 0.35);
}
.btn-save-vibrant:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 92, 43, 0.45);
}
.btn-save-vibrant i { margin-right: 8px; }

/* ═══════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════ */
.tabs-nav {
    display: flex;
    gap: 6px;
    padding: 5px;
    margin-bottom: 32px;
    background: rgba(0, 0, 0, 0.03);
    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-dim);
    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(0, 0, 0, 0.03); }
.tab-btn.active {
    color: var(--primary);
    background: linear-gradient(135deg, rgba(255, 92, 43, 0.12), rgba(255, 92, 43, 0.04));
    border-color: rgba(255, 92, 43, 0.2);
}

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

/* ═══════════════════════════════════════════════════════════
   INPUTS
   ═══════════════════════════════════════════════════════════ */
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='%236B6B6B' 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;
    background-size: 18px;
    padding-left: 42px !important;
}
input:focus, textarea:focus, select:focus {
    border-color: rgba(255, 92, 43, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 92, 43, 0.1);
    background: #fff;
}
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: 0.8px;
}
.input-hint { color: var(--text-muted); font-size: 0.77rem; margin-top: 10px; font-weight: 500; line-height: 1.5; }

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 10px var(--primary-glow);
    cursor: pointer;
    transition: var(--t-fast);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }

/* ═══════════════════════════════════════════════════════════
   ROLE MULTISELECT
   ═══════════════════════════════════════════════════════════ */
.select-trigger, .roles-multiselect {
    background: #fff;
    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: #d4cfc7; }
.roles-multiselect.active {
    border-color: rgba(255, 92, 43, 0.45);
    box-shadow: 0 0 0 3px rgba(255, 92, 43, 0.1);
}

.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, 92, 43, 0.1);
    border: 1px solid rgba(255, 92, 43, 0.22);
    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, 92, 43, 0.15); }
.role-tag i { font-size: 0.7rem; opacity: 0.45; cursor: pointer; transition: var(--t-fast); }
.role-tag i:hover { opacity: 1; color: var(--primary); transform: scale(1.12); }
.role-tag-icon { font-size: 0.85rem; opacity: 0.75; 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: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    z-index: 2000;
    position: absolute;
    width: 100%;
    top: calc(100% + 6px);
    right: 0;
    display: none;
}
.roles-multiselect.active .dropdown-menu { display: block; animation: dropdownIn 0.2s var(--ease); }

.search-input-field {
    background: var(--bg-root);
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 12px 16px;
    width: 100%;
    color: var(--text-white);
    outline: none;
    font-size: 0.86rem;
    margin: 0;
}
.search-input-field:focus {
    background: #fff;
    border-color: rgba(255, 92, 43, 0.25);
    box-shadow: none;
}

.options-list { max-height: 260px; overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.options-list::-webkit-scrollbar { width: 4px; }
.options-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); 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, 92, 43, 0.05); color: var(--text-white); }
.option-item.selected, .role-option.selected {
    color: var(--primary);
    background: rgba(255, 92, 43, 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.6;
    letter-spacing: 2px;
    background: rgba(0,0,0,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 { 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: #e8e4de;
    transition: 0.35s var(--ease);
    border-radius: 22px;
    border: 1px solid var(--border);
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 2px; bottom: 2px;
    background-color: #fff;
    transition: 0.35s var(--ease);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
input:checked + .slider {
    background-color: var(--primary);
    border-color: transparent;
    box-shadow: 0 0 10px rgba(255, 92, 43, 0.3);
}
input:checked + .slider:before { transform: translateX(20px); background-color: white; }

/* ═══════════════════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════════════════ */
.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, 92, 43, 0.15);
    display: flex;
    align-items: center;
    gap: 16px;
}
.section-header h2 { font-size: 1.35rem; color: var(--text-white); margin: 0; font-weight: 900; }
.section-header i { color: var(--primary); font-size: 1.15rem; }

/* ═══════════════════════════════════════════════════════════
   SweetAlert2
   ═══════════════════════════════════════════════════════════ */
.swal2-popup {
    background: #fff !important;
    border: 1px solid var(--border) !important;
    border-radius: 20px !important;
    padding: 2rem !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12) !important;
}
.swal2-title {
    color: #1A1A1A !important;
    font-family: 'IBM Plex Sans Arabic', sans-serif !important;
    font-weight: 800 !important;
    font-size: 1.45rem !important;
}
.swal2-html-container {
    color: #6B6B6B !important;
    font-family: 'IBM Plex Sans Arabic', sans-serif !important;
    font-size: 0.95rem !important;
}
.swal2-confirm {
    background: linear-gradient(135deg, #FF5C2B, #FF5833) !important;
    border-radius: 10px !important;
    padding: 11px 30px !important;
    font-weight: 700 !important;
    box-shadow: 0 8px 20px rgba(255, 92, 43, 0.3) !important;
}
.swal2-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(255, 92, 43, 0.4) !important;
}
.swal2-icon { border-color: var(--border) !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(12px); }
    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); } }

.app-container { opacity: 0.15; transition: opacity 0.12s ease-out; }
.app-container.loaded { opacity: 1 !important; }

/* ═══════════════════════════════════════════════════════════
   RTL
   ═══════════════════════════════════════════════════════════ */
[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
   ═══════════════════════════════════════════════════════════ */
@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.12);
    }
    [dir="ltr"] .sidebar { right: auto; left: 0; transform: translateX(-100%); box-shadow: 10px 0 30px rgba(0,0,0,0.12); }

    body.sidebar-open .sidebar { transform: translateX(0) !important; }
    body.sidebar-open { overflow: hidden; }

    .main-wrapper { width: 100% !important; padding-right: 0 !important; margin-right: 0 !important; }
    .top-header { padding: 0 20px; height: 64px; }

    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.7rem; }
}

@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; }
    .responsive-table tr {
        margin-bottom: 20px;
        background: #fff;
        padding: 20px;
        border-radius: 16px;
        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, 92, 43, 0.1) !important;
        color: #FF5C2B !important;
        border-color: #FF5C2B !important;
    }
}

@media (max-width: 600px) {
    .content-area { padding: 24px 16px; }
    .section-card { padding: 24px; }
    .card-grid { grid-template-columns: 1fr; }
    .page-title h1 { font-size: 1.55rem; }
    .page-subtitle { font-size: 0.85rem; }
    .save-bar { min-width: auto; width: calc(100% - 24px); border-radius: 18px; flex-direction: column; gap: 12px; padding: 14px; }
}

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

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