/* Admin console — Event Booking marketplace */

:root {
    --ink: #1B2422;
    --ink-2: #26332F;
    --ink-soft: #8C9895;
    --canvas: #F8F6F1;
    --surface: #ffffff;
    --line: #E8E3D8;
    --line-strong: #CFC8B8;
    --text: #1B2422;
    --text-2: #4A5552;
    --text-3: #646E6B;
    --teal: #0E6E6B;
    --teal-ink: #0A5552;
    --teal-wash: #E2F0EE;
    --gold: #D9A441;
    --gold-wash: #F6EBD3;
    --red: #B3402E;
    --red-wash: #F9E3DE;
    --amber: #94591A;
    --amber-wash: #FAEED8;
    --green: #276B44;
    --green-wash: #E3F2E8;
    --radius-sm: 4px;
    --radius: 8px;
    --font: "Instrument Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
    --arabic: "IBM Plex Sans Arabic", "Instrument Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--canvas);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 600; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
a { color: var(--teal-ink); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
[lang="ar"], .ar { font-family: var(--arabic); }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Shell ─────────────────────────────────────────────── */

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.nav {
    background: var(--ink);
    color: #EEF1EE;
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto; /* long menu: scroll inside it */
}
.nav > * { flex-shrink: 0; }
.brand { padding: 0 10px 22px; }
.brand strong { display: block; color: #fff; font-size: 16px; font-weight: 600; }
.brand span { font-size: 13px; color: var(--ink-soft); }

.nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: #B9C4C0;
    text-decoration: none;
    font-weight: 500;
}
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--ink-2); color: #fff; box-shadow: inset 3px 0 0 var(--teal); }
.nav .group-label { margin: 16px 10px 4px; font-size: 12px; color: var(--ink-soft); }
.nav .count {
    min-width: 22px;
    padding: 0 7px;
    border-radius: 11px;
    background: var(--teal);
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.nav .spacer { flex: 1; }
.nav .who { padding: 10px; font-size: 13px; color: var(--ink-soft); border-top: 1px solid var(--ink-2); }
.nav .who button { margin-top: 6px; }

.main { padding: 28px 36px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--text-2); margin-top: 4px; max-width: 70ch; }

@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; gap: 4px; }
    .brand { width: 100%; padding: 0 6px 8px; }
    .nav .group-label, .nav .spacer { display: none; }
    .nav .who { width: 100%; border: 0; padding: 8px 6px 0; }
    .main { padding: 20px 16px 48px; }
}

/* ── Controls ──────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { border-color: var(--text-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-ink); }
.btn.danger { color: var(--red); border-color: #E7B8AE; }
.btn.danger:hover { background: var(--red-wash); }
.btn.quiet { border-color: transparent; background: transparent; color: inherit; }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }

.input, .select, textarea.input {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    min-width: 0;
}
textarea.input { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; }
.field { display: grid; gap: 4px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input[type="search"] { width: 280px; max-width: 100%; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a {
    padding: 9px 14px;
    color: var(--text-2);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--teal); }

/* ── Tables ────────────────────────────────────────────── */

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; font-weight: 500; color: var(--text-3); background: #FBFAF6; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: #F5F2EA; }
.sub { display: block; font-size: 13px; color: var(--text-3); }
td.right, th.right { text-align: end; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px 0; color: var(--text-3); font-size: 13px; }

.empty {
    padding: 40px 24px;
    text-align: center;
    color: var(--text-2);
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}

/* ── Status chips ──────────────────────────────────────── */

.chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 500;
    background: #EFEBE2;
    color: var(--text-2);
    white-space: nowrap;
}
.chip.good { background: var(--green-wash); color: var(--green); }
.chip.wait { background: var(--amber-wash); color: var(--amber); }
.chip.bad { background: var(--red-wash); color: var(--red); }
.chip.info { background: var(--teal-wash); color: var(--teal-ink); }
.chip.gold { background: var(--gold-wash); color: #85601A; }

.stars { color: var(--gold); letter-spacing: 1px; }

/* ── Overview ──────────────────────────────────────────── */

.queues { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 28px; }
.queue {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.queue .n { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.queue.clear .n { color: var(--text-3); }
.queue .what { color: var(--text-2); }
.queue .btn { align-self: flex-start; }

.money { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 28px; }
.money > div { padding: 16px; border-inline-start: 1px solid var(--line); }
.money > div:first-child { border-inline-start: 0; }
.money .v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.money .l { color: var(--text-3); font-size: 13px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 10px; }

.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); margin: 6px 0 10px; }
.bar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-inline-end: 6px; vertical-align: 0; }

@media (max-width: 1100px) {
    .money { grid-template-columns: repeat(2, 1fr); }
    .money > div:nth-child(3) { border-inline-start: 0; }
    .money > div:nth-child(n+3) { border-top: 1px solid var(--line); }
    .split { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .money { grid-template-columns: 1fr; }
    .money > div { border-inline-start: 0; border-top: 1px solid var(--line); }
    .money > div:first-child { border-top: 0; }
}

/* ── Drawer ────────────────────────────────────────────── */

.scrim { position: fixed; inset: 0; background: rgba(27, 36, 34, .38); z-index: 20; }
.drawer {
    position: fixed;
    top: 0;
    inset-inline-end: 0;
    bottom: 0;
    width: min(620px, 100%);
    background: var(--surface);
    z-index: 21;
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 40px rgba(27, 36, 34, .18);
    animation: drawer-in .18s ease-out;
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.drawer header p { color: var(--text-3); margin-top: 3px; }
.drawer .body { padding: 18px 22px 28px; overflow-y: auto; flex: 1; }
.drawer footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; background: #FBFAF6; }

dl.facts { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0 0 20px; }
dl.facts dt { color: var(--text-3); font-size: 13.5px; }
dl.facts dd { margin: 0; }
.block { margin-bottom: 22px; }
.block > h3 { margin-bottom: 8px; }
.prose { color: var(--text-2); max-width: 68ch; white-space: pre-line; }

/* The contact sheet: a provider's portfolio laid out like a strip of film. */
.contact-sheet {
    background: var(--ink);
    border-radius: var(--radius);
    padding: 14px 12px 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 8px;
}
.contact-sheet figure { margin: 0; }
.contact-sheet a { display: block; aspect-ratio: 1; background: var(--ink-2); border-radius: 2px; overflow: hidden; }
.contact-sheet img { width: 100%; height: 100%; object-fit: cover; display: block; }
.contact-sheet .video { display: grid; place-items: center; height: 100%; color: #B9C4C0; font-size: 13px; }
.contact-sheet figcaption { margin-top: 4px; font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; }
.contact-sheet .frame-note { grid-column: 1 / -1; color: var(--ink-soft); font-size: 12px; }
@media (max-width: 520px) { .contact-sheet { grid-template-columns: repeat(3, 1fr); } }

.timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--line); }
.timeline li { padding-block: 0 12px; padding-inline: 14px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--teal); }

/* ── Cards (reviews, ads) ──────────────────────────────── */

.cards { display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.flag { margin-top: 10px; padding: 8px 10px; background: var(--amber-wash); border-radius: var(--radius-sm); color: #6B4A12; font-size: 14px; }

.ad { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.ad-preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #FBFAF6; }
.ad-preview .img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--line); }
.ad-preview .txt { padding: 8px 10px 10px; }
.ad-preview .tag { font-size: 11px; color: var(--text-3); }
.ad-preview strong { display: block; font-size: 14px; }
.ad-preview p { font-size: 13px; color: var(--text-2); }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px 16px; margin-top: 10px; }
.metrics div span { display: block; font-size: 12.5px; color: var(--text-3); }
.metrics div b { font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .ad { grid-template-columns: 1fr; } }

/* ── Login ─────────────────────────────────────────────── */

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--ink); }
.login form { width: min(380px, 100%); background: var(--surface); border-radius: var(--radius); padding: 28px; }
.login h1 { font-size: 22px; margin-bottom: 4px; }
.login p { color: var(--text-3); margin-bottom: 20px; }
.login .btn { width: 100%; margin-top: 4px; }
.error { color: var(--red); font-size: 14px; margin-bottom: 12px; }

/* ── Dialog & toast ────────────────────────────────────── */

.dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(440px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(27, 36, 34, .3); }
.dialog::backdrop { background: rgba(27, 36, 34, .45); }
.dialog form { padding: 22px; }
.dialog h2 { margin-bottom: 6px; }
.dialog p { color: var(--text-2); margin-bottom: 14px; }
.dialog .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background: var(--ink);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; }
.toast.bad { background: var(--red); }

.loading { padding: 40px 0; color: var(--text-3); }

.quote { margin: 6px 0 0; padding: 8px 12px; border-inline-start: 3px solid var(--line-strong); background: #FBFAF6; color: var(--text-2); white-space: pre-line; }

/* ── Arabic (right-to-left) ───────────────────────────── */
[dir="rtl"] body, [dir="rtl"] .input, [dir="rtl"] .select, [dir="rtl"] .btn, [dir="rtl"] button, [dir="rtl"] textarea {
    font-family: "IBM Plex Sans Arabic", "Instrument Sans", Tahoma, sans-serif;
}
[dir="rtl"] .drawer { box-shadow: 12px 0 40px rgba(27, 36, 34, .18); animation-name: drawer-in-rtl; }
@keyframes drawer-in-rtl { from { transform: translateX(-24px); opacity: .6; } to { transform: none; opacity: 1; } }
[dir="rtl"] .num, [dir="rtl"] input[type=email], [dir="rtl"] input[type=url], [dir="rtl"] input[inputmode=decimal], [dir="rtl"] input[inputmode=numeric] { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] input[type=email], [dir="rtl"] input[type=url] { text-align: end; }
.lang-switch { font-family: "IBM Plex Sans Arabic", "Instrument Sans", sans-serif; }

/* Category photos */
.cat-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; display: block; border: 1px solid var(--line); }
.cat-thumb.empty { background: var(--teal-wash); }
.cat-photo { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cat-photo-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.cat-photo-preview { width: 96px; height: 96px; border-radius: 14px; border: 1.5px solid var(--teal); padding: 2px; display: grid; place-items: center; background: var(--teal-wash); flex: none; }
.cat-photo-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; display: block; }
.cat-photo-row .btn + .btn { margin-inline-start: 6px; }

/* Batch 4 */
span.bad, .num .bad { color: var(--red); font-weight: 600; }

/* Language switch at the top of the side menu, next to the name. */
.brand-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.brand-row > div { min-width: 0; }
.brand-row .lang-switch { flex: none; }
.brand-row { align-items: center; }
.brand-row .brand-text { flex: 1; min-width: 0; }
.brand-logo { width: 40px; height: 40px; flex: none; }

/* Long menus: the links scroll, while the account box (name + Sign out) stays
   pinned to the bottom of the screen so it's always reachable. */
@media (min-width: 861px) {
    .nav { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 0; }
    .nav .who {
        position: sticky;
        bottom: 0;
        margin: 8px -14px 0;
        padding: 12px 24px 16px;
        background: var(--ink);
        box-shadow: 0 -10px 16px -8px rgba(0, 0, 0, .45);
        z-index: 1;
    }
}

/* Verification documents */
.docs { display: grid; gap: 8px; }
.doc { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.doc-main { display: grid; gap: 3px; min-width: 0; flex: 1 1 260px; }
.doc-main .sub { display: block; font-size: 13px; overflow-wrap: anywhere; }
.doc-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { width: 34px; height: 20px; appearance: none; border-radius: 10px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; }
.switch input:checked { background: var(--teal); }
.switch input:checked::after { inset-inline-start: 16px; }
.switch input:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Notifications › one person picker */
.people-pick { margin-top: 8px; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.people-pick .person { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.people-pick .person:last-child { border-bottom: 0; }
.people-pick .person > span:nth-child(2) { flex: 1; min-width: 0; }
.people-pick .person:hover { background: var(--line); }
.people-pick .person.on { box-shadow: inset 3px 0 0 var(--teal); background: var(--line); }
.people-pick input { accent-color: var(--teal); }

.dialog.wide { width: min(680px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; }
.dialog code, .page code { font-size: 12px; background: var(--line); padding: 1px 5px; border-radius: 4px; }
