/* QABILTU admin - emerald and gold, taken from the logo.
   Type: Cormorant Garamond (echoes the wordmark) for headings and figures, Plus Jakarta Sans for the interface. */

:root {
  --q-ink: #062a1e;
  --q-sidebar: #0a3d2a;
  --q-sidebar-2: #0d4a33;
  --q-emerald: #0f6b4a;
  --q-emerald-600: #0c5a3e;
  --q-gold: #c4922f;
  --q-gold-soft: #f7edd5;
  --q-cream: #fef5e8;

  --q-bg: #f2f5f3;
  --q-card: #ffffff;
  --q-line: #e2e8e4;
  --q-text: #17251f;
  --q-muted: #66756d;
  --q-hover: #f5f8f6;
  --q-shadow: 0 1px 2px rgba(10, 61, 42, .05), 0 6px 18px -10px rgba(10, 61, 42, .12);

  --bs-primary: #0f6b4a;
  --bs-primary-rgb: 15, 107, 74;
  --bs-link-color: #0c5a3e;
  --bs-link-color-rgb: 12, 90, 62;
  --bs-link-hover-color: #06402b;
  --bs-link-hover-color-rgb: 6, 64, 43;
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-font-size: .9rem;
  --bs-body-bg: var(--q-bg);
  --bs-body-color: var(--q-text);
  --bs-border-color: var(--q-line);
  --bs-border-radius: .6rem;
  --q-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
}

[data-bs-theme='dark'] {
  --q-bg: #0d1411;
  --q-card: #151f1a;
  --q-line: #24342c;
  --q-text: #e6efe9;
  --q-muted: #8fa399;
  --q-hover: #1a2721;
  --q-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --q-gold-soft: #2c2616;
  --bs-primary: #35b585;
  --bs-primary-rgb: 53, 181, 133;
  --bs-link-color: #5fd0a2;
  --bs-link-color-rgb: 95, 208, 162;
  --bs-link-hover-color: #8fe3bf;
  --bs-link-hover-color-rgb: 143, 227, 191;
  --bs-body-bg: var(--q-bg);
  --bs-body-color: var(--q-text);
  --bs-border-color: var(--q-line);
  --bs-secondary-bg: #1a2721;
  --bs-tertiary-bg: #1a2721;
}

html { scroll-padding-top: 80px; }
body { background: var(--q-bg); color: var(--q-text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted, .text-body-secondary { color: var(--q-muted) !important; }
.font-display { font-family: var(--q-display); }
/* Cormorant uses old-style numerals by default; figures must read as 0 1 2 3 */
.page-title, .stat .figure, .queue-item .n, .brand-name, .font-display { font-variant-numeric: lining-nums; font-feature-settings: 'lnum' 1; }
:focus-visible { outline: 2px solid var(--q-gold); outline-offset: 2px; }

/* ---------- buttons / forms ---------- */
.btn { font-weight: 600; border-radius: .6rem; }
.btn-primary { --bs-btn-bg: var(--q-emerald); --bs-btn-border-color: var(--q-emerald); --bs-btn-hover-bg: var(--q-emerald-600); --bs-btn-hover-border-color: var(--q-emerald-600);
  --bs-btn-active-bg: #084a33; --bs-btn-active-border-color: #084a33; --bs-btn-disabled-bg: var(--q-emerald); --bs-btn-disabled-border-color: var(--q-emerald); }
[data-bs-theme='dark'] .btn-primary { --bs-btn-bg: #1f9a6f; --bs-btn-border-color: #1f9a6f; --bs-btn-hover-bg: #27b080; --bs-btn-hover-border-color: #27b080; --bs-btn-color: #fff; }
.btn-outline-primary { --bs-btn-color: var(--q-emerald); --bs-btn-border-color: var(--q-emerald); --bs-btn-hover-bg: var(--q-emerald); --bs-btn-hover-border-color: var(--q-emerald); --bs-btn-active-bg: var(--q-emerald-600); }
.btn-gold { --bs-btn-bg: var(--q-gold); --bs-btn-border-color: var(--q-gold); --bs-btn-color: #2b1d02; --bs-btn-hover-bg: #d6a23d; --bs-btn-hover-border-color: #d6a23d; --bs-btn-hover-color: #2b1d02; }
.btn-soft { background: var(--q-hover); border: 1px solid var(--q-line); color: var(--q-text); }
.btn-soft:hover { background: var(--q-gold-soft); border-color: var(--q-gold); color: var(--q-text); }
.form-control, .form-select { border-color: var(--q-line); background-color: var(--q-card); }
.form-control:focus, .form-select:focus { border-color: var(--q-emerald); box-shadow: 0 0 0 .2rem rgba(15, 107, 74, .15); }
.form-label { font-weight: 600; font-size: .8rem; color: var(--q-muted); margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--q-emerald); border-color: var(--q-emerald); }

/* ---------- shell ---------- */
.sidebar { --bs-offcanvas-width: 272px; width: 272px; background: linear-gradient(180deg, var(--q-sidebar) 0%, var(--q-ink) 100%); color: #d8e6df; border: 0; }
@media (min-width: 992px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1030; }
  .main { margin-left: 272px; }
}
.sidebar .brand { display: flex; align-items: center; gap: .8rem; padding: 1.35rem 1.25rem 1.1rem; }
.brand-plate { width: 46px; height: 46px; border-radius: 13px; overflow: hidden; background: var(--q-cream); flex: none; box-shadow: 0 0 0 1px rgba(196, 146, 47, .55); }
.brand-plate img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-name { font-family: var(--q-display); font-size: 1.65rem; font-weight: 700; line-height: 1; color: #fff; letter-spacing: .01em; }
.brand-sub { font-size: .72rem; color: #9db8ac; margin-top: .2rem; }
.side-nav { padding: .25rem .75rem 1rem; overflow-y: auto; flex: 1; }
.side-group { font-size: .72rem; font-weight: 600; color: #7fa392; padding: 1rem .75rem .35rem; }
.side-link { display: flex; align-items: center; gap: .75rem; padding: .56rem .75rem; border-radius: .6rem; color: #c9dcd3; font-weight: 500; position: relative; }
.side-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.active { background: rgba(255, 255, 255, .1); color: #fff; }
.side-link.active::before { content: ''; position: absolute; left: -.75rem; top: 20%; bottom: 20%; width: 4px; border-radius: 0 4px 4px 0; background: var(--q-gold); }
.side-link .count { margin-left: auto; background: var(--q-gold); color: #2b1d02; font-size: .7rem; font-weight: 700; min-width: 1.4rem; text-align: center; border-radius: 99px; padding: .08rem .45rem; }
.side-foot { padding: .9rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .78rem; color: #8fb0a1; }

.topbar { position: sticky; top: 0; z-index: 1020; background: color-mix(in srgb, var(--q-bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--q-line); }
.topbar-inner { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.25rem; }
.global-search { position: relative; flex: 1; max-width: 420px; }
.global-search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--q-muted); }
.global-search input { padding-left: 2.4rem; border-radius: 99px; background: var(--q-card); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; border: 1px solid var(--q-line); background: var(--q-card); color: var(--q-text); }
.icon-btn:hover { background: var(--q-hover); }
.me-chip { display: flex; align-items: center; gap: .6rem; padding: .25rem .6rem .25rem .25rem; border: 1px solid var(--q-line); border-radius: 99px; background: var(--q-card); color: var(--q-text); }
.me-chip .av { width: 32px; height: 32px; font-size: .75rem; }
.content { padding: 1.5rem 1.25rem 3rem; max-width: 1480px; }
@media (min-width: 768px) { .content { padding: 1.9rem 2.1rem 3.5rem; } }

.page-head { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.4rem; }
.page-title { font-family: var(--q-display); font-weight: 700; font-size: clamp(1.9rem, 3vw, 2.5rem); line-height: 1.05; margin: 0; color: var(--q-text); }
.page-sub { color: var(--q-muted); margin: .35rem 0 0; max-width: 62ch; }

/* ---------- cards ---------- */
.q-card { background: var(--q-card); border: 1px solid var(--q-line); border-radius: 16px; box-shadow: var(--q-shadow); }
.q-card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--q-line); }
.q-card-head h2, .q-card-head h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.q-card-body { padding: 1.25rem; }
.q-card-foot { padding: .85rem 1.25rem; border-top: 1px solid var(--q-line); }

.stat { padding: 1.1rem 1.2rem; height: 100%; display: flex; flex-direction: column; gap: .15rem; }
.stat .stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--q-muted); font-weight: 600; font-size: .82rem; }
.stat .chip { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--q-gold-soft); color: #8a6212; font-size: 1.05rem; }
[data-bs-theme='dark'] .stat .chip { color: #e3b559; }
.stat .chip.green { background: #e1f1e9; color: var(--q-emerald); }
[data-bs-theme='dark'] .stat .chip.green { background: #17372b; color: #5fd0a2; }
.stat .chip.red { background: #fbe6e3; color: #b3372b; }
[data-bs-theme='dark'] .stat .chip.red { background: #3a1d1a; color: #ff9d92; }
.stat .figure { font-family: var(--q-display); font-weight: 700; font-size: 2.35rem; line-height: 1.05; margin-top: .35rem; }
.stat .foot { color: var(--q-muted); font-size: .8rem; }

/* queue rows on the dashboard */
.queue { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.queue-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid var(--q-line); background: var(--q-card); color: var(--q-text); transition: border-color .15s, transform .15s; }
.queue-item:hover { border-color: var(--q-gold); transform: translateY(-1px); color: var(--q-text); }
.queue-item .n { font-family: var(--q-display); font-size: 2.4rem; font-weight: 700; line-height: 1; min-width: 2.2rem; }
.queue-item.is-hot { background: var(--q-gold-soft); border-color: rgba(196, 146, 47, .5); }
.queue-item.is-clear .n { color: var(--q-muted); }
.queue-item small { color: var(--q-muted); display: block; }

/* ---------- tables ---------- */
.table-modern { --bs-table-bg: transparent; margin: 0; }
.table-modern thead th { font-size: .78rem; font-weight: 600; color: var(--q-muted); background: var(--q-hover); border-bottom: 1px solid var(--q-line); white-space: nowrap; padding: .7rem 1rem; }
.table-modern tbody td { padding: .8rem 1rem; vertical-align: middle; border-color: var(--q-line); }
.table-modern tbody tr:hover > * { background: var(--q-hover); }
.table-modern tbody tr:last-child td { border-bottom: 0; }
.sort-link { color: inherit; }
.sort-link i { font-size: .65rem; opacity: .5; }
.sort-link.is-on { color: var(--q-text); } .sort-link.is-on i { opacity: 1; color: var(--q-gold); }
.row-link { cursor: pointer; }
.cell-user { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.cell-user .meta { min-width: 0; }
.cell-user .name { font-weight: 600; color: var(--q-text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.cell-user .sub { color: var(--q-muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 260px; }

.av { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; display: inline-grid; place-items: center; background: var(--q-gold-soft); color: #8a6212; font-weight: 700; font-size: .85rem; border: 1px solid var(--q-line); }
.av-lg { width: 96px; height: 96px; font-size: 1.8rem; border-width: 3px; border-color: var(--q-card); box-shadow: 0 0 0 2px var(--q-gold); }

.badge-soft { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .65rem; border-radius: 99px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.tone-success { background: #e1f1e9; color: #0b6240; } .tone-warning { background: #fbf0d3; color: #8a5d00; } .tone-danger { background: #fbe6e3; color: #a6301f; }
.tone-primary { background: #dde9f7; color: #1b4f8f; } .tone-info { background: #dcf0f4; color: #0f6577; } .tone-secondary { background: #e9edeb; color: #50605a; }
.tone-gold { background: var(--q-gold-soft); color: #7d5710; }
[data-bs-theme='dark'] .tone-success { background: #17372b; color: #6fdcaa; } [data-bs-theme='dark'] .tone-warning { background: #3a2f12; color: #f0c565; }
[data-bs-theme='dark'] .tone-danger { background: #3c1f1b; color: #ff9d92; } [data-bs-theme='dark'] .tone-primary { background: #1c2d44; color: #8db9ee; }
[data-bs-theme='dark'] .tone-info { background: #14343b; color: #7fd0e0; } [data-bs-theme='dark'] .tone-secondary { background: #223029; color: #a9bbb2; }
[data-bs-theme='dark'] .tone-gold { background: #3a2f12; color: #f0c565; }
.verified-mark { color: var(--q-emerald); } [data-bs-theme='dark'] .verified-mark { color: #5fd0a2; }

/* filter bar */
.filter-bar { padding: 1rem 1.25rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.filter-bar .span-2 { grid-column: span 2; }
@media (max-width: 575px) { .filter-bar .span-2 { grid-column: auto; } }
.seg { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.seg a { padding: .42rem .9rem; border-radius: 99px; border: 1px solid var(--q-line); background: var(--q-card); color: var(--q-text); font-weight: 600; font-size: .83rem; }
.seg a:hover { border-color: var(--q-gold); }
.seg a.on { background: var(--q-ink); border-color: var(--q-ink); color: #fff; }
[data-bs-theme='dark'] .seg a.on { background: var(--q-gold); border-color: var(--q-gold); color: #231800; }
.seg .n { opacity: .65; font-weight: 500; margin-left: .25rem; }

/* detail pages */
.kv { display: grid; grid-template-columns: 11rem 1fr; gap: .55rem 1rem; margin: 0; }
.kv dt { color: var(--q-muted); font-weight: 500; } .kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 575px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dt { margin-top: .6rem; } }
.profile-hero { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.1rem 1.5rem; border-left: 2px solid var(--q-line); margin-left: .45rem; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: .25rem; width: 12px; height: 12px; border-radius: 50%; background: var(--q-card); border: 2px solid var(--q-gold); }
.timeline li:last-child { border-color: transparent; padding-bottom: 0; }
.nav-tabs-q { border-bottom: 1px solid var(--q-line); gap: .25rem; flex-wrap: nowrap; overflow-x: auto; }
.nav-tabs-q .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--q-muted); font-weight: 600; padding: .7rem 1rem; white-space: nowrap; border-radius: 0; }
.nav-tabs-q .nav-link.active { color: var(--q-text); border-bottom-color: var(--q-gold); background: transparent; }

/* photo grid */
.photo-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.photo-card { position: relative; border-radius: 14px; overflow: hidden; background: var(--q-card); border: 1px solid var(--q-line); }
.photo-card .thumb { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; display: block; cursor: zoom-in; background: var(--q-hover); }
.photo-card .pick { position: absolute; top: .6rem; left: .6rem; width: 1.2rem; height: 1.2rem; z-index: 2; }
.photo-card .tag { position: absolute; top: .6rem; right: .6rem; z-index: 2; }
.photo-card .body { padding: .75rem .85rem; }
.doc-frame { border: 1px solid var(--q-line); border-radius: 14px; background: var(--q-hover); display: grid; place-items: center; min-height: 260px; overflow: hidden; }
.doc-frame img { max-width: 100%; max-height: 520px; display: block; cursor: zoom-in; }
.lightbox-img { max-width: 100%; max-height: 80vh; border-radius: 10px; }

.chat { display: flex; flex-direction: column; gap: .5rem; }
.bubble { max-width: min(560px, 88%); padding: .55rem .85rem; border-radius: 14px; background: var(--q-hover); border: 1px solid var(--q-line); }
.bubble.reported { background: var(--q-gold-soft); border-color: rgba(196, 146, 47, .5); align-self: flex-end; }
.bubble small { color: var(--q-muted); display: block; font-size: .72rem; }

.empty { text-align: center; padding: 3rem 1.25rem; color: var(--q-muted); }
.empty i { font-size: 2.2rem; color: var(--q-gold); display: block; margin-bottom: .6rem; }
.empty h3 { font-size: 1.05rem; color: var(--q-text); }
.chart-box { position: relative; height: 280px; } .chart-box.sm { height: 220px; }
.mono-pre { white-space: pre-wrap; word-break: break-word; font-size: .8rem; background: var(--q-hover); border: 1px solid var(--q-line); border-radius: 10px; padding: .75rem; max-height: 320px; overflow: auto; }
.bar-row { display: grid; grid-template-columns: 7.5rem 1fr 3rem; gap: .6rem; align-items: center; margin-bottom: .55rem; font-size: .84rem; }
.bar-row .track { height: 8px; background: var(--q-hover); border-radius: 99px; overflow: hidden; }
.bar-row .fill { height: 100%; background: linear-gradient(90deg, var(--q-emerald), var(--q-gold)); border-radius: 99px; }
.funnel-step { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .7rem 0; border-bottom: 1px dashed var(--q-line); }
.funnel-step:last-child { border-bottom: 0; }
.flash-zone .alert { border-radius: 12px; border: 1px solid transparent; font-weight: 500; }

/* ---------- sign in ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--q-bg); }
@media (min-width: 992px) { .auth-wrap { grid-template-columns: 1.05fr 1fr; } }
.auth-art { display: none; background: radial-gradient(circle at 25% 15%, #14664a 0, transparent 45%), linear-gradient(160deg, var(--q-sidebar) 0, var(--q-ink) 100%); color: #e8f2ed; padding: 3rem; position: relative; overflow: hidden; }
@media (min-width: 992px) { .auth-art { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-art::after { content: ''; position: absolute; width: 520px; height: 620px; right: -190px; bottom: -190px; border: 2px solid rgba(196, 146, 47, .4); border-radius: 50% 50% 0 0 / 38% 38% 0 0; }
.auth-art h2 { font-family: var(--q-display); font-size: 2.9rem; line-height: 1.05; font-weight: 600; max-width: 14ch; }
.auth-art p { color: #a9c6b9; max-width: 38ch; }
.auth-card { width: 100%; max-width: 420px; margin: auto; padding: 2rem 1.5rem; }
.auth-logo { width: 190px; max-width: 70%; display: block; margin: 0 auto 1.5rem; background: var(--q-cream); border-radius: 18px; padding: .6rem 1rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .sidebar, .topbar, .no-print { display: none !important; } .main { margin: 0; } }
