/* SSC Content Engine — dark-mode inspection dashboard */
:root {
  --bg: #0B0F17;
  --card: #131A26;
  --card-2: #182130;
  --border: #233044;
  --border-soft: #1a2434;
  --text: #E6EDF7;
  --muted: #8b98ad;
  --emerald: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --sky: #38bdf8;
  --violet: #a78bfa;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --bn: "Noto Sans Bengali", "Inter", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Noto Sans Bengali", system-ui, sans-serif;
  font-size: 14px;
  display: flex; flex-direction: column;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 14px 20px;
  background: linear-gradient(180deg, #101725 0%, #0d1320 100%);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #34d39922, #38bdf822);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-family: var(--bn); font-weight: 600; font-size: 18px; color: var(--emerald);
}
.brand h1 { font-size: 16px; font-weight: 600; letter-spacing: .2px; }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.kpis { display: flex; gap: 8px; flex-wrap: wrap; }
.kpi {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; min-width: 86px;
}
.kpi .n { font-size: 18px; font-weight: 700; font-family: var(--mono); }
.kpi .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.kpi.s-queued .n { color: var(--amber); }
.kpi.s-processed .n { color: var(--sky); }
.kpi.s-validated .n, .kpi.s-applied .n { color: var(--emerald); }
.kpi.s-needs_review .n { color: var(--rose); }
.kpi.s-failed .n { color: var(--rose); }

.budget { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.budget-num { text-align: right; }
.budget-num span:first-child { font-family: var(--mono); font-weight: 600; font-size: 14px; }
.budget-split { display: block; font-size: 10px; color: var(--muted); font-family: var(--mono); }
.budget-bar { width: 170px; height: 8px; border-radius: 6px; background: var(--card); border: 1px solid var(--border); overflow: hidden; }
.budget-fill { height: 100%; width: 0%; border-radius: 6px;
  background: linear-gradient(90deg, var(--emerald), var(--amber) 75%, var(--rose));
  transition: width .4s; }

.ghost-btn {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 5px 10px; font-size: 11px; font-weight: 600; letter-spacing: .8px;
  cursor: pointer; font-family: inherit;
}
.ghost-btn:hover { color: var(--text); border-color: #33445e; }

/* ---------- chips ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px 4px; }
.chip {
  border: 1px solid var(--border); background: var(--card);
  color: var(--muted); border-radius: 999px;
  padding: 6px 13px; font-size: 12.5px; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all .15s;
}
.chip .cnt { font-family: var(--mono); font-size: 11px; background: #0e141f; padding: 1px 7px; border-radius: 999px; }
.chip:hover { border-color: #33445e; color: var(--text); }
.chip.active { background: #1b2a3f; border-color: #3b82f6aa; color: #dbeafe; }
.chip.active .cnt { background: #0b1220; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 340px 1fr; gap: 14px; padding: 14px 20px 24px; flex: 1; min-height: 0; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }

.list-pane { display: flex; flex-direction: column; min-height: 0; }
.list-head { display: flex; justify-content: space-between; padding: 2px 4px 8px; font-size: 12px; color: var(--muted); }
.items { overflow-y: auto; padding-right: 4px; }
.item-card {
  background: var(--card); border: 1px solid var(--border-soft); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s;
  display: flex; gap: 10px; align-items: center;
}
.item-card:hover { border-color: #33445e; }
.item-card.selected { border-color: #3b82f6; background: var(--card-2); }
.item-thumb { width: 44px; height: 58px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); flex: none; }
.item-thumb.placeholder { display: grid; place-items: center; color: var(--muted); font-size: 16px; background: #0e141f; font-family: var(--bn); }
.item-main { min-width: 0; flex: 1; }
.item-title { font-weight: 600; font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.item-title .pg { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.item-sub { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }

.tag { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 5px; letter-spacing: .3px; }
.tag.queued { background: #78350f33; color: var(--amber); }
.tag.processed { background: #0c4a6e40; color: var(--sky); }
.tag.validated, .tag.applied { background: #064e3b40; color: var(--emerald); }
.tag.needs_review, .tag.failed { background: #88133738; color: var(--rose); }
.tag.neutral { background: #1e293b66; color: var(--muted); }
.tag.await { background: #4c1d9533; color: var(--violet); }

/* ---------- detail ---------- */
.detail-pane { min-width: 0; display: flex; flex-direction: column; }
.empty-state { flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; }
.empty-icon { font-size: 34px; margin-bottom: 8px; opacity: .5; }
.detail-content { overflow-y: auto; padding-right: 4px; }
.hidden { display: none !important; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
.card-head h3 { font-size: 13px; font-weight: 600; color: #c7d2e2; letter-spacing: .3px; }

.badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 6px; }
.badge.ok { background: #064e3b55; color: var(--emerald); border: 1px solid #065f4666; }
.badge.bad { background: #88133744; color: var(--rose); border: 1px solid #9f123955; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 14px; }
@media (max-width: 1300px) { .detail-grid { grid-template-columns: 1fr; } }
.col-left, .col-right { min-width: 0; }

/* English preview */
.preview-text { line-height: 1.9; font-size: 14.5px; max-height: 420px; overflow-y: auto; padding-right: 6px; }
.preview-text p { margin-bottom: 10px; color: #d5deec; }
.preview-text u.hl {
  text-decoration-color: var(--amber); text-decoration-thickness: 2.5px;
  background: #fbbf241a; border-radius: 3px; padding: 0 2px;
  text-underline-offset: 3px;
}
.preview-text .noimg { color: var(--muted); font-size: 12.5px; }

.validation { font-size: 12.5px; }
.validation .vrow { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--border-soft); font-family: var(--mono); font-size: 11.5px; }
.validation .vrow:last-child { border-bottom: 0; }
.validation .ok { color: var(--emerald); }
.validation .bad { color: var(--rose); }

.raw-json summary { cursor: pointer; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.raw-json pre {
  margin-top: 10px; font-size: 11.5px; line-height: 1.6;
  background: #0a0f18; border: 1px solid var(--border-soft); border-radius: 8px;
  padding: 12px; overflow: auto; max-height: 380px; color: #b6c2d6;
}

/* image viewer */
.image-card { display: flex; flex-direction: column; height: 100%; }
.image-viewport {
  overflow: hidden; border-radius: 8px; border: 1px solid var(--border-soft);
  background: #060a11; cursor: grab; position: relative; min-height: 560px;
}
.image-viewport:active { cursor: grabbing; }
.image-viewport img {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0; user-select: none; will-change: transform;
}
.zoom-controls { display: flex; gap: 6px; }
.small { font-size: 11px; }
.mono { font-family: var(--mono); }

/* Bangla diff */
.detail-bangla .card { padding-bottom: 18px; }
.bn-meta { font-size: 11.5px; margin-bottom: 12px; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .diff-grid { grid-template-columns: 1fr; } }
.diff-col h4 { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.diff-col .para {
  background: var(--card-2); border: 1px solid var(--border-soft); border-radius: 8px;
  padding: 9px 12px; margin-bottom: 7px; font-family: var(--bn);
  font-size: 14.5px; line-height: 1.85; color: #d5deec; position: relative;
}
.diff-col.right .para { border-color: #065f4640; }
.split-badge {
  position: absolute; top: -7px; right: 8px;
  background: #064e3b; color: var(--emerald);
  border: 1px solid #10b98155; border-radius: 999px;
  font-size: 9.5px; font-weight: 700; padding: 1px 8px; letter-spacing: .5px;
}

/* drawer */
.scrim { position: fixed; inset: 0; background: #000a; opacity: 0; pointer-events: none; transition: .2s; z-index: 90; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: -560px; width: min(540px, 92vw); height: 100%;
  background: #0e1522; border-left: 1px solid var(--border); z-index: 100;
  transition: right .25s; display: flex; flex-direction: column;
}
.drawer.show { right: 0; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 14px; }
.drawer-body { overflow-y: auto; padding: 14px 18px; }
.log-row { border: 1px solid var(--border-soft); border-radius: 9px; padding: 10px 12px; margin-bottom: 9px; background: var(--card); font-size: 12px; }
.log-row .lr-top { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-bottom: 5px; }
.log-row .lr-job { font-weight: 600; }
.log-row .lr-notes { color: var(--muted); margin-top: 4px; word-break: break-word; }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #22304a; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
