/* =====================================================================
   زاحف تيك توك — لوحة الإدارة العربية (RTL)
   admin.css — Premium dark Arabic admin design system
   Palette: deep dark #0B0F1A · cards #111827/#151B2C · gold #D4AF37
   Font: Tajawal (Google Fonts) — RTL-first, no frameworks, no build tools
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------------ */
:root {
    /* Surfaces */
    --bg: #0B0F1A;
    --bg-soft: #0D1322;
    --bg-deep: #070A12;
    --card: #111827;
    --card-2: #151B2C;
    --border: #1F2A44;
    --border-soft: #182238;

    /* Text */
    --text: #E5E7EB;
    --muted: #94A3B8;
    --faint: #64748B;

    /* Accents */
    --gold: #D4AF37;
    --gold-2: #E5C158;
    --gold-3: #F5D77A;
    --gold-dark: #221A04;
    --success: #22C55E;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;

    /* Gradients */
    --grad-gold: linear-gradient(135deg, #D4AF37, #F5D77A);

    /* Shape & depth */
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow: 0 4px 16px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
    --ring: 0 0 0 3px rgba(212, 175, 55, .16);

    /* Typography */
    --font: 'Tajawal', 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;

    /* Layout */
    --sidebar-w: 272px;
    --topbar-h: 64px;
}

/* ---------------------------------------------------------------------
   2. Reset & base
   ------------------------------------------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 800;
    line-height: 1.35;
}

p {
    margin: 0;
}

a {
    color: var(--gold-3);
    text-decoration: none;
    transition: color .2s ease;
}

a:hover {
    color: var(--gold);
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
}

::selection {
    background: rgba(212, 175, 55, .32);
    color: #fff;
}

[hidden] {
    display: none !important;
}

/* Generic inline SVG icon (contextual rules may override size) */
.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

:focus-visible {
    outline: 2px solid rgba(212, 175, 55, .75);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Scrollbars (WebKit + Firefox) */
* {
    scrollbar-width: thin;
    scrollbar-color: #26334F transparent;
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #26334F;
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: #35486F;
    background-clip: padding-box;
}

/* ---------------------------------------------------------------------
   3. App layout — fixed sidebar (right in RTL) + main column
   ------------------------------------------------------------------ */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: var(--sidebar-w);
    z-index: 90;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0E1424 0%, #0B0F1A 100%);
    border-inline-end: 1px solid var(--border);
    transition: transform .28s ease;
}

.main {
    min-height: 100vh;
    margin-inline-start: var(--sidebar-w);
    background:
        radial-gradient(1100px 420px at 85% -120px, rgba(212, 175, 55, .07), transparent 60%),
        radial-gradient(900px 420px at 8% -160px, rgba(59, 130, 246, .05), transparent 60%),
        var(--bg);
}

.content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 24px 60px;
}

/* Brand -------------------------------------------------------------- */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--border-soft);
}

.brand-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--grad-gold);
    color: var(--gold-dark);
    box-shadow: 0 6px 18px rgba(212, 175, 55, .3);
}

.brand-icon .icon {
    width: 22px;
    height: 22px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-size: 17px;
    font-weight: 800;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.brand-sub {
    font-size: 11.5px;
    color: var(--faint);
}

.sidebar-close {
    display: none;
    margin-inline-start: auto;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-xs);
}

.sidebar-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .05);
}

/* Navigation ---------------------------------------------------------- */
.nav {
    flex: 1;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-section {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    color: var(--faint);
    padding: 8px 12px 6px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    transition: background .2s ease, color .2s ease;
}

.nav-link .icon {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

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

.nav-link.active {
    color: var(--gold-3);
    font-weight: 700;
    background: linear-gradient(90deg, rgba(212, 175, 55, .16), rgba(212, 175, 55, .04));
}

.nav-link.active::before {
    content: '';
    position: absolute;
    inset-inline-start: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    border-radius: 99px;
    background: var(--grad-gold);
}

.sidebar-foot {
    padding: 14px 16px;
    border-top: 1px solid var(--border-soft);
}

.sidebar-foot-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 11.5px;
    color: var(--faint);
}

.status-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-weight: 700;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(4, 7, 14, .66);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Topbar (glass) ------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: var(--topbar-h);
    padding: 10px 24px;
    background: rgba(11, 15, 26, .72);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.topbar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    place-items: center;
    transition: border-color .2s, color .2s;
}

.topbar-toggle:hover {
    color: var(--gold-3);
    border-color: var(--gold);
}

.topbar-title {
    min-width: 0;
}

.topbar-title h1 {
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-tagline {
    display: block;
    font-size: 11.5px;
    color: var(--faint);
}

.topbar-meta {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-date {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--muted);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 99px;
}

.topbar-date .icon {
    width: 14px;
    height: 14px;
    color: var(--gold);
}

/* ---------------------------------------------------------------------
   4. Page head
   ------------------------------------------------------------------ */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    animation: fadeIn .3s ease;
}

.page-head h2 {
    font-size: 21px;
}

.page-desc {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
    max-width: 640px;
}

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

.count-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(212, 175, 55, .1);
    border: 1px solid rgba(212, 175, 55, .3);
    color: var(--gold-3);
    font-size: 13px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 99px;
    white-space: nowrap;
}

/* ---------------------------------------------------------------------
   5. Cards
   ------------------------------------------------------------------ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: fadeIn .35s ease;
}

.card + .card,
.sec-card + .sec-card {
    margin-top: 18px;
}

.card-pad {
    padding: 20px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 800;
}

.card-title .icon {
    width: 18px;
    height: 18px;
    color: var(--gold);
}

.card-sub {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
}

.card-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.sec-num {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: var(--radius-xs);
    background: var(--grad-gold);
    color: var(--gold-dark);
    font-size: 13px;
    font-weight: 800;
}

/* Hero CTA (dashboard) -------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 26px 26px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background:
        radial-gradient(500px 200px at 90% -40px, rgba(212, 175, 55, .14), transparent 65%),
        var(--card);
    margin-bottom: 20px;
    animation: fadeIn .35s ease;
}

.hero-text h2 {
    font-size: 20px;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.hero-text p {
    color: var(--muted);
    font-size: 13.5px;
    margin-top: 5px;
    max-width: 560px;
}

/* ---------------------------------------------------------------------
   6. KPI grid & stat chips
   ------------------------------------------------------------------ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.kpi {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: border-color .2s ease, transform .2s ease;
    animation: fadeIn .35s ease;
}

.kpi:hover {
    border-color: rgba(212, 175, 55, .38);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
}

.kpi-icon .icon {
    width: 20px;
    height: 20px;
}

.kpi-body {
    min-width: 0;
}

.kpi-value {
    display: block;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.25;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.kpi-value.kpi-muted {
    background: none;
    color: var(--faint);
}

.kpi-label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Icon tints */
.tint-gold    { background: rgba(212, 175, 55, .13); color: var(--gold); }
.tint-success { background: rgba(34, 197, 94, .13);  color: var(--success); }
.tint-danger  { background: rgba(239, 68, 68, .13);  color: var(--danger); }
.tint-warning { background: rgba(245, 158, 11, .13); color: var(--warning); }
.tint-info    { background: rgba(59, 130, 246, .13); color: var(--info); }

/* Stat chips row (progress page) */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.stat-chip {
    flex: 1 1 120px;
    min-width: 120px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 15px;
    transition: border-color .2s ease;
}

.stat-chip:hover {
    border-color: rgba(212, 175, 55, .35);
}

.stat-value {
    display: block;
    font-size: 19px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.3;
}

.stat-label {
    display: block;
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 2px;
}

/* ---------------------------------------------------------------------
   7. Buttons
   ------------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    background: var(--card-2);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease, border-color .2s ease,
                box-shadow .2s ease, transform .15s ease;
}

.btn .icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.btn:active {
    transform: translateY(1px);
}

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

.btn-gold {
    background: var(--grad-gold);
    color: var(--gold-dark);
    box-shadow: 0 6px 18px rgba(212, 175, 55, .25);
}

.btn-gold:hover {
    background: linear-gradient(135deg, #E5C158, #F5D77A);
    box-shadow: 0 8px 24px rgba(212, 175, 55, .38);
    color: var(--gold-dark);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--gold);
    color: var(--gold-3);
    background: rgba(212, 175, 55, .06);
}

.btn-danger {
    background: rgba(239, 68, 68, .12);
    border-color: rgba(239, 68, 68, .35);
    color: #FCA5A5;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, .2);
    color: #FECACA;
}

.btn-lg {
    padding: 13px 28px;
    font-size: 15.5px;
    border-radius: 13px;
}

.btn-lg .icon {
    width: 20px;
    height: 20px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: var(--radius-xs);
}

.btn-sm .icon {
    width: 14px;
    height: 14px;
}

.btn-block {
    width: 100%;
}

/* ---------------------------------------------------------------------
   8. Badges, dots & tags
   ------------------------------------------------------------------ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3.5px 11px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}

.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-success { background: rgba(34, 197, 94, .12);  border-color: rgba(34, 197, 94, .35);  color: #86EFAC; }
.badge-danger  { background: rgba(239, 68, 68, .12);  border-color: rgba(239, 68, 68, .35);  color: #FCA5A5; }
.badge-warning { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .35); color: #FCD34D; }
.badge-info    { background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .35); color: #93C5FD; }
.badge-gold    { background: rgba(212, 175, 55, .12); border-color: rgba(212, 175, 55, .4);  color: var(--gold-3); }
.badge-muted   { background: rgba(148, 163, 184, .1); border-color: rgba(148, 163, 184, .28); color: var(--muted); }

.dot-pending   { background: var(--warning); }
.dot-running   { background: var(--info);    animation: pulse 1.5s ease-in-out infinite; }
.dot-completed { background: var(--success); }
.dot-failed    { background: var(--danger); }
.dot-cancelled { background: var(--faint); }

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--grad-gold);
    color: var(--gold-dark);
    vertical-align: middle;
}

.verified-badge .icon {
    width: 11px;
    height: 11px;
    stroke-width: 3;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    max-width: 100%;
}

.tag-gold {
    background: rgba(212, 175, 55, .1);
    border-color: rgba(212, 175, 55, .35);
    color: var(--gold-3);
}

.tag .icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------------------------------------------------------------------
   9. Banners
   ------------------------------------------------------------------ */
.banner {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid;
    font-size: 13.5px;
    margin-bottom: 16px;
    animation: fadeIn .3s ease;
}

.banner .icon {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    margin-top: 1px;
}

.banner-danger {
    background: rgba(239, 68, 68, .08);
    border-color: rgba(239, 68, 68, .32);
    color: #FCA5A5;
}

.banner-success {
    background: rgba(34, 197, 94, .08);
    border-color: rgba(34, 197, 94, .32);
    color: #86EFAC;
}

.banner-warning {
    background: rgba(245, 158, 11, .08);
    border-color: rgba(245, 158, 11, .32);
    color: #FCD34D;
}

.banner-info {
    background: rgba(59, 130, 246, .08);
    border-color: rgba(59, 130, 246, .32);
    color: #93C5FD;
}

/* ---------------------------------------------------------------------
   10. Forms
   ------------------------------------------------------------------ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 16px 16px;
}

.form-grid .span-2 {
    grid-column: span 2;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field-full {
    margin-top: 16px;
}

.label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.optional {
    color: var(--faint);
    font-size: 11px;
    font-weight: 400;
}

.input,
.select {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.input::placeholder {
    color: var(--faint);
}

.input:hover,
.select:hover {
    border-color: #2A3A5F;
}

.input:focus,
.select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: var(--ring);
    background: #0E1526;
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-inline-end: 13px;
    padding-inline-start: 34px;
    cursor: pointer;
}

.input-sm {
    padding: 7px 10px;
    font-size: 13px;
    border-radius: var(--radius-xs);
}

.field-hint {
    font-size: 11.5px;
    color: var(--faint);
}

.field-error {
    font-size: 12px;
    font-weight: 500;
    color: #FCA5A5;
}

/* Checkbox chips ------------------------------------------------------- */
.chip-check {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    user-select: none;
}

.chip-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip-check span {
    display: inline-flex;
    align-items: center;
    padding: 7px 15px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 99px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    transition: all .2s ease;
}

.chip-check:hover span {
    border-color: #2A3A5F;
    color: var(--text);
}

.chip-check input:checked + span {
    background: rgba(212, 175, 55, .12);
    border-color: var(--gold);
    color: var(--gold-3);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .3);
}

.chip-check input:focus-visible + span {
    outline: 2px solid rgba(212, 175, 55, .75);
    outline-offset: 2px;
}

/* Toggle switch -------------------------------------------------------- */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 16px;
}

.switch-title {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
}

.switch-desc {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    cursor: pointer;
}

.switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch .track {
    display: block;
    width: 46px;
    height: 26px;
    border-radius: 99px;
    background: #22304F;
    position: relative;
    transition: background .25s ease;
}

.switch .track::after {
    content: '';
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform .25s ease, background .25s ease;
}

.switch input:checked + .track {
    background: rgba(212, 175, 55, .35);
}

.switch input:checked + .track::after {
    transform: translateX(-20px); /* RTL: knob slides to the visual left */
    background: var(--gold);
}

.switch input:focus-visible + .track {
    outline: 2px solid rgba(212, 175, 55, .75);
    outline-offset: 2px;
}

/* Inline checkbox (filters) */
.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    padding: 8px 0;
}

.checkbox-inline input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--gold);
    cursor: pointer;
}

/* Sticky submit bar ----------------------------------------------------- */
.submit-bar {
    position: sticky;
    bottom: 16px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 14px 18px;
    background: rgba(17, 24, 39, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: fadeIn .35s ease;
}

.submit-note {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: var(--muted);
}

.submit-note .icon {
    width: 15px;
    height: 15px;
    color: var(--gold);
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   11. Tables
   ------------------------------------------------------------------ */
.table-wrap {
    overflow-x: auto;
    border-radius: 0 0 var(--radius) var(--radius);
}

.table-wrap.bordered {
    border: 1px solid var(--border);
    border-radius: 12px;
}

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

.table th {
    text-align: start;
    padding: 11px 14px;
    background: var(--bg-soft);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .4px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}

.table tbody tr {
    transition: background .15s ease;
}

.table tbody tr:hover {
    background: rgba(212, 175, 55, .04);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table .num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cell-muted {
    color: var(--faint);
}

.account-cell {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 210px;
}

.name-stack {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.name-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.username-line {
    font-size: 12px;
    color: var(--muted);
    direction: ltr;
    text-align: end;
    white-space: nowrap;
}

/* Avatars --------------------------------------------------------------- */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-soft);
}

.avatar-fallback {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(212, 175, 55, .25), rgba(212, 175, 55, .08));
    border: 1px solid rgba(212, 175, 55, .35);
    color: var(--gold-3);
    font-weight: 800;
    font-size: 15px;
}

.avatar-sm,
.avatar-sm.avatar-fallback {
    width: 30px;
    height: 30px;
    font-size: 13px;
}

.avatar-lg,
.avatar-lg.avatar-fallback {
    width: 76px;
    height: 76px;
    font-size: 30px;
    border-width: 2px;
}

/* Mini list (dashboard latest profiles) ---------------------------------- */
.mini-list {
    padding: 6px 20px 12px;
}

.mini-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-soft);
}

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

.mini-body {
    min-width: 0;
    flex: 1;
}

.mini-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-sub {
    font-size: 11.5px;
    color: var(--muted);
    direction: ltr;
    text-align: end;
}

.mini-meta {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------
   12. Progress (bar + percent)
   ------------------------------------------------------------------ */
.progress-block {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.progress-percent {
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    min-width: 118px;
    font-variant-numeric: tabular-nums;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.progress-main {
    flex: 1;
    min-width: 240px;
}

.progress {
    height: 14px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: var(--grad-gold);
    position: relative;
    overflow: hidden;
    transition: width .6s cubic-bezier(.25, .8, .3, 1);
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
    animation: progressShine 1.6s ease-in-out infinite;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
}

.spinner {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, .25);
    border-top-color: var(--gold);
    animation: spin .8s linear infinite;
    display: inline-block;
    vertical-align: -3px;
    margin-inline-end: 8px;
}

/* ---------------------------------------------------------------------
   13. Log terminal
   ------------------------------------------------------------------ */
.log-terminal {
    direction: ltr;
    text-align: left;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 15px;
    max-height: 340px;
    min-height: 120px;
    overflow-y: auto;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.9;
}

.log-line {
    display: flex;
    gap: 12px;
    align-items: baseline;
    animation: fadeIn .25s ease;
}

.log-time {
    color: #5B6B87;
    flex-shrink: 0;
    font-size: 11.5px;
}

.log-msg {
    color: #B9C4D8;
    word-break: break-word;
}

.log-info    .log-msg { color: #93C5FD; }
.log-success .log-msg { color: #86EFAC; }
.log-warning .log-msg { color: #FCD34D; }
.log-error   .log-msg { color: #FCA5A5; }
.log-debug   .log-msg { color: #94A3B8; }

.log-empty {
    color: var(--faint);
    font-family: var(--font);
    text-align: center;
    padding: 28px 0;
}

.raw-json {
    direction: ltr;
    text-align: left;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    max-height: 460px;
    overflow: auto;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.7;
    color: #B9C4D8;
    margin: 0;
    white-space: pre;
}

/* ---------------------------------------------------------------------
   14. Toasts
   ------------------------------------------------------------------ */
.toast-container {
    position: fixed;
    bottom: 18px;
    inset-inline-end: 18px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: calc(100% - 36px);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    background: var(--card-2);
    border: 1px solid var(--border);
    border-inline-start: 3px solid var(--info);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    animation: toastIn .3s ease;
}

.toast.leaving {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease;
}

.toast .icon {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    margin-top: 1px;
}

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

.toast ul {
    margin: 6px 0 0;
    padding-inline-start: 18px;
}

.toast-success { border-inline-start-color: var(--success); }
.toast-success .icon { color: var(--success); }
.toast-danger  { border-inline-start-color: var(--danger); }
.toast-danger .icon { color: var(--danger); }
.toast-warning { border-inline-start-color: var(--warning); }
.toast-warning .icon { color: var(--warning); }
.toast-info    { border-inline-start-color: var(--info); }
.toast-info .icon { color: var(--info); }

.toast-close {
    margin-inline-start: auto;
    background: none;
    border: none;
    color: var(--faint);
    cursor: pointer;
    padding: 3px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color .2s;
}

.toast-close:hover {
    color: var(--text);
}

.toast-close .icon {
    width: 15px;
    height: 15px;
    margin: 0;
}

/* ---------------------------------------------------------------------
   15. Empty states & skeletons
   ------------------------------------------------------------------ */
.empty {
    text-align: center;
    padding: 52px 20px;
    color: var(--muted);
}

.empty-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(212, 175, 55, .07);
    border: 1px solid rgba(212, 175, 55, .2);
    color: var(--gold);
}

.empty-icon .icon {
    width: 32px;
    height: 32px;
}

.empty-title {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.empty-text {
    font-size: 13px;
    color: var(--muted);
    max-width: 380px;
    margin: 0 auto;
}

.skeleton {
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, #151B2C 25%, #1D2742 50%, #151B2C 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    min-height: 14px;
}

.skeleton-line {
    height: 13px;
    margin: 10px 0;
}

.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }

/* ---------------------------------------------------------------------
   16. Pagination (restyles Laravel default markup, no Tailwind needed)
   ------------------------------------------------------------------ */
.pagination-wrap {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination-wrap nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pagination-wrap a,
.pagination-wrap [aria-current="page"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    transition: all .2s ease;
}

.pagination-wrap a:hover {
    border-color: var(--gold);
    color: var(--gold-3);
}

.pagination-wrap [aria-current="page"] {
    background: var(--grad-gold);
    border-color: transparent;
    color: var(--gold-dark);
}

.pagination-wrap svg {
    width: 15px;
    height: 15px;
}

/* ---------------------------------------------------------------------
   17. Tabs
   ------------------------------------------------------------------ */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    padding: 13px 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .2s ease, border-color .2s ease;
}

.tab .icon {
    width: 16px;
    height: 16px;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--gold-3);
    border-bottom-color: var(--gold);
}

.tab-count {
    background: #22304F;
    border-radius: 99px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.tab.active .tab-count {
    background: rgba(212, 175, 55, .18);
    color: var(--gold-3);
}

.tab-panel {
    display: none;
    padding-top: 20px;
}

.tab-panel.active {
    display: block;
    animation: fadeIn .25s ease;
}

/* ---------------------------------------------------------------------
   18. Dropdown (export menu)
   ------------------------------------------------------------------ */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 7px);
    inset-inline-start: 0;
    min-width: 170px;
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    display: none;
    z-index: 70;
    box-shadow: var(--shadow-lg);
}

.dropdown.open .dropdown-menu {
    display: block;
    animation: fadeIn .18s ease;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}

.dropdown-item .icon {
    width: 15px;
    height: 15px;
    color: var(--muted);
    flex-shrink: 0;
}

.dropdown-item:hover {
    background: rgba(212, 175, 55, .1);
    color: var(--gold-3);
}

.dropdown-item:hover .icon {
    color: var(--gold);
}

/* ---------------------------------------------------------------------
   19. Profile detail (results/show)
   ------------------------------------------------------------------ */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 16px;
    transition: color .2s ease;
}

.back-link:hover {
    color: var(--gold-3);
}

.back-link .icon {
    width: 16px;
    height: 16px;
}

.profile-head {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.profile-id {
    flex: 1;
    min-width: 240px;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-name {
    font-size: 21px;
    font-weight: 800;
}

.profile-username {
    display: inline-block;
    direction: ltr;
    font-size: 13.5px;
    color: var(--gold-3);
    font-weight: 700;
}

.profile-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 9px;
}

.profile-bio {
    margin-top: 12px;
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.8;
    max-width: 720px;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    margin-inline-start: auto;
}

/* Meta grid (overview tab) */
.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 10px;
}

.meta-item {
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    transition: border-color .2s ease;
}

.meta-item:hover {
    border-color: rgba(212, 175, 55, .3);
}

.meta-label {
    display: block;
    font-size: 11px;
    color: var(--faint);
    font-weight: 700;
}

.meta-value {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    margin-top: 3px;
    word-break: break-word;
}

.overview-section + .overview-section {
    margin-top: 22px;
}

.overview-section > .label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12.5px;
}

.overview-section > .label .icon {
    width: 15px;
    height: 15px;
    color: var(--gold);
}

/* Contacts grid */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 12px;
}

.contact-card {
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 15px;
    transition: border-color .2s ease;
}

.contact-card:hover {
    border-color: rgba(212, 175, 55, .35);
}

.contact-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 8px;
}

.contact-type .icon {
    width: 16px;
    height: 16px;
    color: var(--gold);
    flex-shrink: 0;
}

.contact-value {
    direction: ltr;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    word-break: break-all;
    display: block;
}

.contact-value:hover {
    color: var(--gold-3);
}

.work-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--gold-3);
    background: rgba(212, 175, 55, .1);
    border: 1px solid rgba(212, 175, 55, .3);
    padding: 2px 8px;
    border-radius: 99px;
}

/* ---------------------------------------------------------------------
   20. Two-column dashboard grid
   ------------------------------------------------------------------ */
.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

/* ---------------------------------------------------------------------
   21. Utilities
   ------------------------------------------------------------------ */
.grad-text {
    background: var(--grad-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.ltr { direction: ltr; unicode-bidi: embed; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------------
   22. Animations
   ------------------------------------------------------------------ */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes progressShine {
    0%   { transform: translateX(-100%); }
    55%  { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .45; transform: scale(.82); }
}

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

/* ---------------------------------------------------------------------
   23. Responsive
   ------------------------------------------------------------------ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%); /* RTL: hide off-screen to the right */
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main {
        margin-inline-start: 0;
    }

    .topbar-toggle {
        display: grid;
    }

    .sidebar-close {
        display: inline-flex;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 18px 16px 48px;
    }
}

@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .kpi {
        padding: 13px;
        gap: 10px;
    }

    .kpi-icon {
        width: 36px;
        height: 36px;
    }

    .kpi-value {
        font-size: 16.5px;
    }

    .form-grid .span-2 {
        grid-column: span 1;
    }

    .card-pad {
        padding: 15px;
    }

    .hero {
        padding: 20px 16px;
    }

    .progress-percent {
        font-size: 34px;
        min-width: 92px;
    }

    .topbar {
        padding: 10px 14px;
    }

    .topbar-date {
        display: none;
    }

    .page-head h2 {
        font-size: 18px;
    }

    .submit-bar {
        bottom: 10px;
    }

    .submit-bar .btn {
        width: 100%;
    }

    .profile-actions {
        width: 100%;
        margin-inline-start: 0;
        flex-direction: row;
    }

    .profile-actions .btn {
        flex: 1;
    }
}
