﻿/* ==========================================================================
   NTFC Admin — "ledger glass" design system
   Bootstrap 5.3 base + tokens below. Dark is default; light via [data-bs-theme="light"].
   All spacing uses logical properties so Arabic (dir="rtl") needs no extra CSS.
   ========================================================================== */

:root {
    --brand: #c72027;
    --brand-600: #a9161d;
    --brand-300: #e5595e;
    --brand-soft: rgba(199, 32, 39, .12);
    --brand-glow: rgba(199, 32, 39, .45);
    --gold: #d4a64a;
    --gold-soft: rgba(212, 166, 74, .14);
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --sidebar-w: 268px;
    --topbar-h: 68px;
    --ease: cubic-bezier(.2, .8, .2, 1);

    --font-latin: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-arabic: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

[data-bs-theme="dark"] {
    --bg: #070b16;
    --bg-2: #0b1122;
    --surface: rgba(255, 255, 255, .035);
    --surface-2: rgba(255, 255, 255, .06);
    --surface-solid: #0f1629;
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .14);
    --text: #e8ebf4;
    --text-muted: #8f98ae;
    --grid-line: rgba(255, 255, 255, .035);
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 40px -18px rgba(0, 0, 0, .7);
    --shadow-hover: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 30px 60px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(199, 32, 39, .25);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-secondary-color: var(--text-muted);
    --bs-tertiary-bg: var(--surface-2);
}

[data-bs-theme="light"] {
    --bg: #f3f5fa;
    --bg-2: #eaeef6;
    --surface: #ffffff;
    --surface-2: #f6f8fc;
    --surface-solid: #ffffff;
    --border: #e3e8f1;
    --border-strong: #cfd7e6;
    --text: #0f172a;
    --text-muted: #5b6579;
    --grid-line: rgba(15, 23, 42, .04);
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -16px rgba(15, 23, 42, .18);
    --shadow-hover: 0 2px 4px rgba(15, 23, 42, .05), 0 24px 48px -18px rgba(15, 23, 42, .28), 0 0 0 1px rgba(199, 32, 39, .18);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-secondary-color: var(--text-muted);
}

/* ---------- base ---------- */
html, body { min-height: 100%; }

body.adm {
    font-family: var(--font-latin);
    background:
        radial-gradient(1200px 600px at 110% -10%, var(--brand-soft), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, var(--gold-soft), transparent 60%),
        linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 32px,
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] body.adm { font-family: var(--font-arabic); }

.num, .kpi-value, table td.num, .tabular { font-variant-numeric: tabular-nums; }

a { color: var(--brand-300); }
[data-bs-theme="light"] a { color: var(--brand); }
a:hover { color: var(--brand); }

:focus-visible {
    outline: 2px solid var(--brand-300);
    outline-offset: 2px;
    border-radius: 6px;
}

.text-muted, .form-text { color: var(--text-muted) !important; }

::selection { background: var(--brand); color: #fff; }

/* ---------- layout ---------- */
.adm-shell { display: flex; min-height: 100vh; }

.adm-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--sidebar-w);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(199, 32, 39, .10), transparent 30%),
        var(--surface-solid);
    border-inline-end: 1px solid var(--border);
    transition: transform .35s var(--ease);
}

.adm-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    height: var(--topbar-h);
    padding-inline: 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

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

.adm-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .8rem;
    letter-spacing: .02em;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-300), var(--brand-600));
    box-shadow: 0 8px 20px -6px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .25);
    transform: perspective(200px) rotateX(8deg) rotateY(-8deg);
}

.adm-brand-name { font-weight: 700; line-height: 1.1; }
.adm-brand-name small { display: block; font-weight: 500; font-size: .72rem; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; }

.adm-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem .75rem;
    scrollbar-width: thin;
}

.adm-nav-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 1rem .75rem .4rem;
}

html[dir="rtl"] .adm-nav-label { letter-spacing: 0; }

.adm-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    margin-bottom: 2px;
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: .93rem;
    text-decoration: none;
    transition: background .2s, color .2s, transform .2s var(--ease);
}

.adm-nav a i { font-size: 1.1rem; width: 1.25rem; text-align: center; }

.adm-nav a:hover { color: var(--text); background: var(--surface-2); transform: translateX(2px); }
html[dir="rtl"] .adm-nav a:hover { transform: translateX(-2px); }

.adm-nav a.active {
    color: var(--text);
    background: linear-gradient(90deg, var(--brand-soft), transparent);
}

html[dir="rtl"] .adm-nav a.active { background: linear-gradient(270deg, var(--brand-soft), transparent); }

.adm-nav a.active::before {
    content: "";
    position: absolute;
    inset-inline-start: -.75rem;
    inset-block: 20%;
    width: 3px;
    border-radius: 3px;
    background: var(--brand);
    box-shadow: 0 0 12px var(--brand-glow);
}

.adm-nav a.active i { color: var(--brand-300); }

.adm-nav .badge { margin-inline-start: auto; }

.adm-sidebar-foot {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.adm-main {
    flex: 1;
    min-width: 0;
    margin-inline-start: var(--sidebar-w);
    display: flex;
    flex-direction: column;
}

.adm-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-inline: 1.5rem;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}

.adm-page-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.adm-breadcrumb { font-size: .8rem; color: var(--text-muted); }
.adm-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.adm-breadcrumb a:hover { color: var(--text); }

.adm-content { padding: 1.75rem 1.5rem 3rem; flex: 1; }

.adm-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: border-color .2s, background .2s, transform .2s var(--ease);
}

.adm-icon-btn:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }

.adm-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    font-weight: 700;
    font-size: .85rem;
    color: #fff;
    background: linear-gradient(135deg, var(--gold), var(--brand));
}

.adm-backdrop { display: none; }

@media (max-width: 991.98px) {
    .adm-sidebar { transform: translateX(-100%); }
    html[dir="rtl"] .adm-sidebar { transform: translateX(100%); }
    .adm-main { margin-inline-start: 0; }
    body.sidebar-open .adm-sidebar { transform: none; }
    body.sidebar-open .adm-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(3, 6, 14, .6);
        backdrop-filter: blur(2px);
    }
    .adm-content { padding: 1.25rem 1rem 2.5rem; }
    .adm-topbar { padding-inline: 1rem; }
}

/* ---------- cards / glass ---------- */
.glass {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.glass-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--border);
}

.glass-head h2, .glass-head h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.glass-body { padding: 1.35rem; }

/* ---------- 3D KPI cards ---------- */
.kpi {
    position: relative;
    display: block;
    height: 100%;
    padding: 1.25rem 1.35rem;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 45%),
        var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: var(--text);
    text-decoration: none;
    transform-style: preserve-3d;
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
    transition: transform .25s var(--ease), box-shadow .3s, border-color .3s;
    overflow: hidden;
    isolation: isolate;
}

.kpi::after {
    /* moving specular highlight, driven by --mx/--my from admin.js */
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .09), transparent 40%);
    opacity: 0;
    transition: opacity .3s;
}

.kpi:hover { box-shadow: var(--shadow-hover); border-color: var(--border-strong); color: var(--text); }
.kpi:hover::after { opacity: 1; }

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    color: #fff;
    background: linear-gradient(135deg, var(--c1, var(--brand-300)), var(--c2, var(--brand-600)));
    box-shadow: 0 12px 24px -10px var(--c-glow, var(--brand-glow)), inset 0 1px 0 rgba(255, 255, 255, .3);
    transform: translateZ(40px);
}

.kpi-label { color: var(--text-muted); font-size: .82rem; font-weight: 600; margin-top: 1rem; transform: translateZ(20px); }
.kpi-value { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; transform: translateZ(30px); }
.kpi-foot { font-size: .78rem; color: var(--text-muted); margin-top: .35rem; transform: translateZ(15px); }

.kpi--gold { --c1: #f0c56c; --c2: #b8862b; --c-glow: rgba(212, 166, 74, .5); }
.kpi--blue { --c1: #60a5fa; --c2: #2563eb; --c-glow: rgba(59, 130, 246, .5); }
.kpi--green { --c1: #4ade80; --c2: #16a34a; --c-glow: rgba(34, 197, 94, .45); }
.kpi--violet { --c1: #a78bfa; --c2: #7c3aed; --c-glow: rgba(124, 58, 237, .45); }
.kpi--slate { --c1: #94a3b8; --c2: #475569; --c-glow: rgba(71, 85, 105, .5); }

/* ---------- 3D hero banner ---------- */
.adm-hero {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background:
        radial-gradient(600px 300px at 85% 30%, rgba(199, 32, 39, .35), transparent 60%),
        linear-gradient(135deg, #0b1122, #070b16);
    color: #fff;
    box-shadow: var(--shadow);
}

.adm-hero .f3d-host { position: absolute; inset: 0; }
.adm-hero .f3d-canvas { width: 100% !important; height: 100% !important; display: block; }

.adm-hero-content {
    position: relative;
    z-index: 1;
    padding: 2rem 2.25rem;
    max-width: 560px;
    background: linear-gradient(90deg, rgba(7, 11, 22, .85), rgba(7, 11, 22, 0));
    height: 100%;
}

html[dir="rtl"] .adm-hero-content { background: linear-gradient(270deg, rgba(7, 11, 22, .85), rgba(7, 11, 22, 0)); }

.adm-hero h1 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: .35rem; }
.adm-hero p { color: rgba(255, 255, 255, .72); margin-bottom: 1.25rem; }
.adm-hero .eyebrow { color: var(--gold); font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
html[dir="rtl"] .adm-hero .eyebrow { letter-spacing: 0; }

.f3d-fallback {
    background:
        radial-gradient(500px 260px at 80% 40%, rgba(199, 32, 39, .45), transparent 60%),
        radial-gradient(400px 200px at 60% 90%, rgba(212, 166, 74, .25), transparent 60%);
}

/* ---------- buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; padding: .55rem 1rem; transition: transform .15s var(--ease), box-shadow .2s, background .2s; }
.btn:active { transform: translateY(1px); }

.btn-brand {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, var(--brand-300), var(--brand) 55%, var(--brand-600));
    box-shadow: 0 10px 22px -10px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.btn-brand:hover { color: #fff; box-shadow: 0 14px 28px -10px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .3); transform: translateY(-1px); }

.btn-ghost {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }

.btn-glass {
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(8px);
}

.btn-glass:hover { color: #fff; background: rgba(255, 255, 255, .14); }

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
}

.btn-icon:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.btn-icon.danger:hover { color: #fff; background: var(--brand); border-color: var(--brand); }

/* ---------- forms ---------- */
.form-control, .form-select {
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: .6rem .85rem;
}

.form-control:focus, .form-select:focus {
    background-color: var(--surface-2);
    color: var(--text);
    border-color: var(--brand-300);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.form-control::placeholder { color: var(--text-muted); opacity: .7; }
.form-label { font-weight: 600; font-size: .86rem; margin-bottom: .4rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 4px var(--brand-soft); border-color: var(--brand-300); }
.field-validation-error, .validation-summary-errors { color: #f87171; font-size: .82rem; }
.validation-summary-errors ul { margin: 0; padding-inline-start: 1.1rem; }
.input-validation-error { border-color: #f87171 !important; }

textarea.form-control { min-height: 120px; }
[dir="rtl"] .form-control.ltr, .form-control[dir="ltr"] { direction: ltr; text-align: left; }

.lang-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .7rem;
    font-weight: 700;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    margin-inline-start: .35rem;
    vertical-align: middle;
}

/* image upload with live preview */
.dropzone {
    position: relative;
    display: grid;
    place-items: center;
    gap: .5rem;
    min-height: 180px;
    padding: 1.25rem;
    text-align: center;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color .2s, background .2s;
    overflow: hidden;
}

.dropzone:hover, .dropzone.is-dragover { border-color: var(--brand-300); background: var(--brand-soft); color: var(--text); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone i { font-size: 2rem; color: var(--brand-300); }
.dropzone img.preview { max-height: 160px; max-width: 100%; border-radius: 10px; box-shadow: var(--shadow); }

/* ---------- tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); --bs-table-hover-bg: var(--surface-2); --bs-table-hover-color: var(--text); margin: 0; }
.table > thead th {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom-width: 1px;
    white-space: nowrap;
    padding-block: .85rem;
}
html[dir="rtl"] .table > thead th { letter-spacing: 0; }
.table > tbody td { padding-block: .85rem; vertical-align: middle; }
.table-wrap { overflow-x: auto; }

.thumb {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.thumb-round { border-radius: 50%; }

.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* status chips */
.chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-success { color: var(--success); background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .25); }
.chip-warning { color: var(--warning); background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .25); }
.chip-danger { color: var(--brand-300); background: var(--brand-soft); border-color: rgba(199, 32, 39, .3); }
.chip-info { color: var(--info); background: rgba(59, 130, 246, .1); border-color: rgba(59, 130, 246, .25); }
.chip-gold { color: var(--gold); background: var(--gold-soft); border-color: rgba(212, 166, 74, .3); }

/* ---------- toolbar / search ---------- */
.search-box { position: relative; min-width: 240px; }
.search-box i { position: absolute; inset-inline-start: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-box .form-control { padding-inline-start: 2.4rem; }

/* ---------- media grid ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }

.media-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}

.media-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.media-card .media-img { aspect-ratio: 4 / 3; width: 100%; object-fit: contain; background: repeating-conic-gradient(var(--surface-2) 0 25%, transparent 0 50%) 0 0 / 16px 16px; padding: .75rem; }
.media-card .media-meta { padding: .6rem .75rem; font-size: .78rem; border-top: 1px solid var(--border); }
.media-card .media-actions { position: absolute; inset-block-start: .5rem; inset-inline-end: .5rem; display: flex; gap: .35rem; opacity: 0; transition: opacity .2s; }
.media-card:hover .media-actions, .media-card:focus-within .media-actions { opacity: 1; }
.media-card .media-actions .btn-icon { background: rgba(7, 11, 22, .75); color: #fff; backdrop-filter: blur(6px); }

/* ---------- messages ---------- */
.msg-row.unread td { font-weight: 700; }
.msg-row.unread td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
html[dir="rtl"] .msg-row.unread td:first-child { box-shadow: inset -3px 0 0 var(--brand); }
.msg-body { white-space: pre-wrap; line-height: 1.8; }

/* ---------- tabs ---------- */
.nav-tabs-glass { gap: .35rem; border: 0; }
.nav-tabs-glass .nav-link {
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 600;
    padding: .5rem .9rem;
}
.nav-tabs-glass .nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-tabs-glass .nav-link.active { color: var(--text); background: var(--surface-2); border-color: var(--border); box-shadow: inset 0 -2px 0 var(--brand); }

/* ---------- empty state ---------- */
.empty {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--text-muted);
}
.empty .empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    color: var(--brand-300);
    background: var(--brand-soft);
    transform: perspective(300px) rotateX(12deg);
    box-shadow: 0 16px 30px -16px var(--brand-glow);
}
.empty h3 { font-size: 1.05rem; color: var(--text); font-weight: 700; }

/* ---------- activity feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: .85rem; padding: .75rem 0; border-bottom: 1px dashed var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed .dot { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.feed .dot.create { color: var(--success); }
.feed .dot.update { color: var(--info); }
.feed .dot.delete { color: var(--brand-300); }
.feed .dot.login { color: var(--gold); }

/* ---------- login ---------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}

.auth-visual { position: relative; overflow: hidden; background: linear-gradient(135deg, #0b1122, #05070f); color: #fff; }
.auth-visual .f3d-host { position: absolute; inset: 0; }
.auth-visual .f3d-canvas { width: 100% !important; height: 100% !important; display: block; }
.auth-visual-copy { position: absolute; inset-inline: 3rem; bottom: 3rem; z-index: 1; max-width: 460px; }
.auth-visual-copy h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; }
.auth-visual-copy p { color: rgba(255, 255, 255, .7); }

.auth-panel { display: grid; place-items: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .glass-body { padding: 2rem; }

@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-visual { min-height: 240px; }
    .auth-visual-copy { inset-inline: 1.5rem; bottom: 1.5rem; }
}

/* ---------- toasts ---------- */
.adm-toasts { position: fixed; inset-block-end: 1.25rem; inset-inline-end: 1.25rem; z-index: 2000; display: grid; gap: .5rem; }
.adm-toast {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 260px;
    max-width: 380px;
    padding: .8rem 1rem;
    border-radius: 12px;
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-hover);
    color: var(--text);
    animation: toast-in .35s var(--ease);
}
.adm-toast.success i { color: var(--success); }
.adm-toast.error i { color: var(--brand-300); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- misc ---------- */
.dropdown-menu { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-hover); padding: .4rem; }
.dropdown-item { border-radius: 8px; color: var(--text); padding: .5rem .75rem; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-2); color: var(--text); }
.dropdown-divider { border-color: var(--border); }
.modal-content { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.pagination { --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--border); --bs-pagination-color: var(--text); --bs-pagination-hover-bg: var(--surface-2); --bs-pagination-hover-color: var(--text); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-disabled-bg: var(--surface); --bs-pagination-disabled-color: var(--text-muted); --bs-pagination-disabled-border-color: var(--border); }

/* SweetAlert2 theming */
.swal2-popup { background: var(--surface-solid) !important; color: var(--text) !important; border: 1px solid var(--border); border-radius: var(--radius-lg) !important; }
.swal2-title, .swal2-html-container { color: var(--text) !important; }

/* entrance animation for page content */
.reveal { animation: reveal .5s var(--ease) both; }
.reveal-2 { animation-delay: .06s; }
.reveal-3 { animation-delay: .12s; }
.reveal-4 { animation-delay: .18s; }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .kpi { transform: none !important; }
}

/* ---------- shared bits ---------- */
.eyebrow { display: inline-block; color: var(--gold); font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .5rem; }
html[dir="rtl"] .eyebrow { letter-spacing: 0; }

.toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.toolbar .spacer { flex: 1; }
.toolbar h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.toolbar p { margin: 0; color: var(--text-muted); font-size: .9rem; }

.stat-inline { display: inline-flex; align-items: baseline; gap: .35rem; font-weight: 700; }
.stat-inline small { color: var(--text-muted); font-weight: 500; }

.preview-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.preview-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.sticky-side { position: sticky; top: calc(var(--topbar-h) + 1.5rem); }
.min-w-0 { min-width: 0; }
.preview-card img:not([src]), .preview-card img[src=""] { visibility: hidden; }

/* ---------- Team module ---------- */
.person-card { padding: 1.25rem; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.person-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.person-card .person-photo { width: 64px; height: 64px; flex: none; box-shadow: 0 10px 22px -12px var(--brand-glow); }
.person-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-2);
    border: 3px solid var(--surface-solid);
    box-shadow: 0 0 0 2px var(--brand), 0 18px 36px -16px var(--brand-glow);
}
.person-preview[src=""] { visibility: hidden; }

/* ---------- Contact cards module ---------- */
.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-300), var(--brand-600));
    box-shadow: 0 10px 20px -10px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.card-icon-lg { width: 52px; height: 52px; font-size: 1.4rem; flex: none; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.icon-choice {
    display: grid;
    place-items: center;
    gap: .25rem;
    padding: .65rem .5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 600;
    transition: border-color .2s, color .2s, background .2s;
}
.icon-choice i { font-size: 1.25rem; }
.icon-choice:hover { color: var(--text); border-color: var(--border-strong); }
.icon-choice.active { color: var(--text); border-color: var(--brand); background: var(--brand-soft); }
.icon-choice.active i { color: var(--brand-300); }

/* ---------- Translations module ---------- */
.tr-key { color: var(--gold); background: var(--gold-soft); padding: .15rem .45rem; border-radius: 6px; font-size: .8rem; word-break: break-word; }
.tr-table .tr-input { min-height: 0; resize: vertical; font-size: .88rem; }
.tr-table tr.is-dirty td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
html[dir="rtl"] .tr-table tr.is-dirty td:first-child { box-shadow: inset -3px 0 0 var(--gold); }
.tr-table tr.is-dirty [data-save] { color: var(--gold); border-color: var(--gold); }
