/* CCTV AI Console (basis gaya sama dengan Kasir AI Console) */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --line: #e4e8ec;
  --line-2: #d3d9df;
  --text: #17212b;
  --text-2: #4e5b68;
  --text-3: #8592a0;
  --brand: #0e7c66;
  --brand-600: #0b6955;
  --brand-50: #e7f5f1;
  --ok: #16a34a;     --ok-50: #e8f7ee;
  --warn: #d97706;   --warn-50: #fdf3e2;
  --bad: #dc2626;    --bad-50: #fdecec;
  --info: #2563eb;   --info-50: #eaf1fe;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hidden { display: none !important; }
.ico { width: 16px; height: 16px; display: inline-flex; flex: none; vertical-align: -3px; }
.ico svg { width: 100%; height: 100%; }
.kpi .k-label .ico { width: 15px; height: 15px; color: var(--text-3); }
.tabs .ico { width: 16px; height: 16px; }
.crumb .ico { width: 16px; height: 16px; }
.toast .ico { width: 18px; height: 18px; }
.cart-warn .ico { width: 15px; height: 15px; margin-top: 1px; }
.thumb > .ico { width: 20px; height: 20px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px;
  background: #0f1d1a; color: #c9d6d2; padding: 18px 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 18px; }
.brand-mark svg { width: 34px; height: 34px; }
.brand-mark rect { fill: var(--brand); }
.brand-mark path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linejoin: round; }
.brand-mark circle { fill: #fff; }
.brand b { display: block; font-size: 16px; }
.brand small { display: block; color: #8fb3aa; font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #c9d6d2; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: rgba(14, 124, 102, .35); color: #fff; }
.nav i { width: 18px; height: 18px; display: inline-flex; }
.nav i svg, .ico svg { width: 100%; height: 100%; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #8fb3aa; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }
.sidebar-foot.ready .dot { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
.sidebar-foot.down .dot { background: var(--bad); }

.main { padding: 26px 32px 48px; min-width: 0; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; margin-bottom: 8px; }
.crumb:hover { color: var(--brand); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; color: var(--text); }
.btn:hover { background: var(--surface-2); border-color: #c3cad1; }
.btn:focus-visible, .input:focus, .select:focus { outline: none; box-shadow: 0 0 0 3px rgba(14, 124, 102, .22); border-color: var(--brand); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-50); border-color: #f2b8b8; }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.04); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 48px; font-size: 16px; padding: 0 20px; }
.btn.block { width: 100%; }
.btn .ico { width: 16px; height: 16px; display: inline-flex; }
.input, .select { height: 38px; width: 100%; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); }
.input::placeholder { color: var(--text-3); }
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .select { width: 110px; border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); }
.prefix { position: relative; }
.prefix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-weight: 600; }
.prefix .input { padding-left: 40px; }
.search { position: relative; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.search .input { padding-left: 34px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 13px; }
.field label .req { color: var(--bad); }
.field .hint { font-size: 12px; color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; user-select: none; }
.switch input { display: none; }
.switch span { width: 34px; height: 20px; border-radius: 20px; background: var(--line-2); position: relative; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(14px); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; }
.card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); }
.card-body { padding: 18px; }
.card-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; }
.kpi .k-label { color: var(--text-2); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.kpi .k-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.kpi.warn .k-value { color: var(--warn); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ready, .badge.ok { background: var(--ok-50); color: #15803d; border-color: #c6ead3; }
.badge.fair, .badge.info { background: var(--info-50); color: var(--info); border-color: #cddcfb; }
.badge.noprice, .badge.weak, .badge.ragu, .badge.warn { background: var(--warn-50); color: #b45309; border-color: #f4dcb1; }
.badge.nophoto, .badge.unknown, .badge.bad { background: var(--bad-50); color: var(--bad); border-color: #f5c6c6; }
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; white-space: nowrap; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: rgba(15, 29, 26, .72); color: #fff; }

/* ---------- table ---------- */
.toolbar { display: flex; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.toolbar .search { flex: 1 1 260px; max-width: 380px; }
.toolbar .select { width: auto; min-width: 160px; }
.toolbar .count { margin-left: auto; color: var(--text-3); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background .1s; }
.table tbody tr:hover { background: #f6faf9; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.prod-cell { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.thumb { width: 44px; height: 44px; border-radius: 8px; background: #eef1f3 center/contain no-repeat; border: 1px solid var(--line); flex: none; display: grid; place-items: center; color: var(--text-3); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.lg { width: 64px; height: 64px; }
.prod-cell b { display: block; font-weight: 600; }
.prod-cell small { color: var(--text-3); font-family: var(--mono); font-size: 11.5px; }
.photo-meter { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.meter { flex: 1; height: 6px; background: #e9edf0; border-radius: 6px; overflow: hidden; min-width: 50px; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.meter.warn > span { background: var(--warn); }
.meter.bad > span { background: var(--bad); }
.price-edit { border: 1px dashed transparent; background: none; padding: 4px 6px; border-radius: 6px; cursor: text; font-weight: 600; }
.price-edit:hover { border-color: var(--line-2); background: #fff; }
.price-edit.empty { color: var(--warn); }
.price-input { width: 110px; height: 30px; text-align: right; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--text-2); }
.empty-state > .ico { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--text-3); display: block; }
.empty-state h3 { color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* ---------- layouts ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* tabs */
.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 13px 10px; font-weight: 600; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; font-size: 11.5px; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.gimg { position: relative; aspect-ratio: 1; border-radius: 10px; background: #eef1f3; border: 1px solid var(--line); overflow: hidden; }
.gimg img { width: 100%; height: 100%; object-fit: contain; }
.gimg .chip { position: absolute; left: 6px; bottom: 6px; }
.gimg .del { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(255,255,255,.95); color: var(--bad); cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .12s; box-shadow: var(--shadow); }
.gimg:hover .del { opacity: 1; }
.gimg .del svg { width: 15px; height: 15px; }
.gimg.new { animation: pop .35s ease-out; border-color: var(--brand); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* readiness */
.ready-box { display: flex; gap: 14px; align-items: center; }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--ring-color, var(--brand)) calc(var(--p) * 1%), #e9edf0 0); }
.ring > span { width: 50px; height: 50px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.tips { margin: 12px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.tips li { margin: 3px 0; }
.src-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* camera */
.cam { position: relative; background: #0b1412; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; }
.cam video { width: 100%; height: 100%; object-fit: contain; display: block; }
.cam canvas.overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.cam .cam-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #b8c9c4; text-align: center; padding: 20px; font-size: 14px; }
.cam .cam-hud { position: absolute; left: 12px; top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.cam-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.cam-bar .select { width: auto; max-width: 260px; height: 36px; }
.strip { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; min-height: 0; }
.strip .gimg { width: 72px; flex: none; }
.burst-progress { height: 4px; background: rgba(255,255,255,.15); position: absolute; left: 0; right: 0; bottom: 0; }
.burst-progress > span { display: block; height: 100%; background: #34d399; width: 0; }

/* dropzone */
.drop { border: 2px dashed var(--line-2); border-radius: 12px; padding: 34px 20px; text-align: center; color: var(--text-2); cursor: pointer; transition: border-color .12s, background .12s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-50); }
.drop > .ico { width: 34px; height: 34px; margin: 0 auto 8px; color: var(--brand); display: block; }
.drop b { color: var(--text); }

/* OFF results */
.off-list { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow: auto; }
.off-item { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); text-align: left; width: 100%; }
.off-item:hover { border-color: var(--brand); background: var(--brand-50); }
.off-item.selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,124,102,.15); }
.off-item b { display: block; }
.off-item small { color: var(--text-3); }

.preview-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 10px; }
.preview-line b { font-size: 15px; }

/* stepper */
.steps { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; color: var(--text-3); font-weight: 600; font-size: 13px; }
.steps .s { display: inline-flex; align-items: center; gap: 8px; }
.steps .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--text-2); font-size: 12px; }
.steps .s.on { color: var(--text); }
.steps .s.on .n { background: var(--brand); color: #fff; }
.steps .sep { width: 32px; height: 1px; background: var(--line-2); }

/* ---------- kasir ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.pos .cam { aspect-ratio: auto; height: calc(100vh - 190px); min-height: 420px; }
.pos-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pos-bar .select { width: auto; max-width: 240px; height: 36px; }
.state-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(11, 20, 18, .78); color: #fff; font-weight: 600; font-size: 13px; backdrop-filter: blur(4px); }
.state-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.state-pill.idle .dot { background: #34d399; }
.state-pill.moving .dot { background: #fbbf24; }
.state-pill.scanning .dot { background: #60a5fa; animation: pulse 1s infinite; }
.state-pill.error .dot { background: #f87171; }
@keyframes pulse { 50% { opacity: .3; } }
.roi-hint { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); background: rgba(11,20,18,.85); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.cart { display: flex; flex-direction: column; height: calc(100vh - 136px); min-height: 520px; position: sticky; top: 20px; }
.cart-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.line { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.line.sel { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,124,102,.14); }
.line.ragu { border-left: 4px solid var(--warn); }
.line.unknown { border-left: 4px solid var(--bad); }
.line.ok { border-left: 4px solid var(--ok); }
.line-main { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.line-main .thumb { width: 48px; height: 48px; }
.line-info { flex: 1; min-width: 0; }
.line-info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-info .meta { display: flex; gap: 6px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.line-price { font-weight: 700; text-align: right; white-space: nowrap; }
.line-price.missing { color: var(--warn); font-size: 12px; }
.idx { width: 22px; height: 22px; border-radius: 6px; background: var(--text); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }
.line.ragu .idx { background: var(--warn); } .line.unknown .idx { background: var(--bad); } .line.ok .idx { background: var(--ok); }
.cands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.cand { border: 1px solid var(--line-2); border-radius: 8px; padding: 6px; background: var(--surface); cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cand:hover { border-color: var(--brand); background: var(--brand-50); }
.cand .thumb { width: 100%; height: 52px; }
.cand span { font-size: 11.5px; font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cand em { font-style: normal; font-size: 11px; color: var(--text-3); }
.cand kbd { font-family: var(--mono); font-size: 10px; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; margin-right: 4px; color: var(--text-2); }
.line-actions { display: flex; gap: 6px; margin-top: 8px; }
.picker { position: relative; flex: 1; }
.picker .menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; z-index: 20; padding: 4px; }
.picker .menu.up { top: auto; bottom: calc(100% + 4px); }
.picker .opt { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.picker .opt:hover, .picker .opt.hl { background: var(--brand-50); }
.picker .opt .thumb { width: 32px; height: 32px; }
.picker .opt span { flex: 1; font-size: 13px; font-weight: 500; }
.picker .opt em { font-style: normal; color: var(--text-3); font-size: 12px; }
.cart-foot { border-top: 1px solid var(--line); padding: 14px 16px; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.total-row .t { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.cart-warn { font-size: 12.5px; color: #b45309; margin: -4px 0 10px; display: flex; gap: 6px; align-items: flex-start; }
.kbd-hints { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-top: 10px; }
.kbd-hints kbd { font-family: var(--mono); font-size: 11px; background: #fff; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--text-2); }

/* ---------- modal ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(15, 23, 30, .45); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: rise .16s ease-out; }
.modal.wide { width: min(720px, 100%); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.modal-head { padding: 18px 20px 6px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 10px 20px 18px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.receipt { font-size: 13px; }
.receipt .r { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.receipt .r span:first-child { min-width: 0; }
.receipt .tot { display: flex; justify-content: space-between; font-weight: 800; font-size: 18px; padding-top: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 14px; }
.seg button { border: 0; background: none; height: 34px; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.qris { border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.qris svg { width: 150px; height: 150px; margin: 0 auto; display: block; }
.qris small { display: block; color: var(--text-3); margin-top: 8px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.change { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--ok-50); display: flex; justify-content: space-between; font-weight: 700; }
.change.neg { background: var(--bad-50); color: var(--bad); }
.success { text-align: center; padding: 18px 10px 6px; }
.success > .ico { width: 56px; height: 56px; color: var(--ok); margin: 0 auto 10px; display: block; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: #17212b; color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 380px; font-weight: 500; display: flex; gap: 10px; align-items: flex-start; animation: rise .16s ease-out; }
.toast.ok { background: #0f5132; } .toast.bad { background: #8a1c1c; } .toast.warn { background: #7c4a03; }

/* ---------- sistem ---------- */
.spec { display: grid; grid-template-columns: 180px 1fr; gap: 0; }
.spec > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.spec > div:nth-child(odd) { color: var(--text-2); font-weight: 600; font-size: 13px; }
.spec > div:nth-last-child(-n+2) { border-bottom: 0; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eef1f3 25%, #f6f8f9 37%, #eef1f3 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 6px; height: 14px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (max-width: 1180px) {
  .pos { grid-template-columns: 1fr; }
  .cart { height: auto; position: static; }
  .pos .cam { height: 56vh; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px 12px; }
  .brand { padding: 0 8px 0 0; } .brand small { display: none; }
  .nav { flex-direction: row; } .sidebar-foot { display: none; }
  .main { padding: 18px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; }
  .pay-grid { grid-template-columns: 1fr; }
}
.cam-msg .ico { width: 32px; height: 32px; display: block; margin: 0 auto 6px; }

/* ================= CCTV AI tambahan ================= */
.thumb.round, .thumb.round img { border-radius: 50%; }
.thumb.round img { object-fit: cover; }
.gimg.face img { object-fit: cover; }
.consent { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid #f4dcb1; background: var(--warn-50); border-radius: 10px; font-size: 13px; color: #7c4a03; cursor: pointer; }
.consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }

/* live */
.live { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.live .cam { aspect-ratio: auto; height: calc(100vh - 210px); min-height: 420px; }
.live-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.live-bar .select { width: auto; max-width: 260px; height: 36px; }
.cam .cam-hud.right { left: auto; right: 12px; }
.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 20px; }
.side .card-body { padding: 12px 14px; }
.facelist { display: flex; flex-direction: column; gap: 8px; }
.frow { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); border-left-width: 4px; }
.frow.ok { border-left-color: var(--ok); } .frow.ragu { border-left-color: var(--warn); } .frow.unknown { border-left-color: var(--bad); }
.frow .info { flex: 1; min-width: 0; }
.frow .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .info small { color: var(--text-3); font-size: 12px; }
.frow .score { font-weight: 700; font-variant-numeric: tabular-nums; }
.sizebar { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.sizebar .meter { height: 5px; min-width: 60px; }
.seen { display: flex; flex-direction: column; }
.seen .r { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.seen .r:last-child { border-bottom: 0; }
.seen .r .info { flex: 1; min-width: 0; }
.seen .r small { display: block; color: var(--text-3); font-size: 12px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.guide { position: absolute; left: 50%; top: 50%; width: 34%; aspect-ratio: 3 / 4; transform: translate(-50%, -54%); border: 2px dashed rgba(255,255,255,.45); border-radius: 50%; pointer-events: none; }
.pose { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.pose span { font-size: 12px; text-align: center; padding: 6px 4px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
@media (max-width: 1180px) {
  .live { grid-template-columns: 1fr; }
  .live .cam { height: 56vh; }
  .side { position: static; }
}
.seen .r .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow.visitor { border-left-color: var(--info); }
.cam img#ipimg { width: 100%; height: 100%; object-fit: contain; display: block; }
.live-bar #camsel { max-width: 200px; } .live-bar #res { max-width: 215px; }
.seen .r .badge { flex: none; }
.thumb.avatar { color: #fff; font-weight: 700; font-size: 14px; border: 0; letter-spacing: .02em; }
.thumb.lg.avatar { font-size: 22px; }
.schip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 999px; background: var(--ok-50); color: #15803d; font-weight: 600; font-size: 12px; flex: none; }
.schip .ico { width: 14px; height: 14px; }
.schip.new { animation: pop .35s ease-out; }
.tbl-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tbl-wrap td:first-child { white-space: nowrap; }
.role-viewer .admin-only { display: none !important; }
.sidebar-foot .who { color: #c9d6d2; display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.sidebar-foot .who .ico { width: 13px; height: 13px; }
.sidebar-foot a { color: #8fd3c1; text-decoration: underline; }
/* notifikasi di kanan atas: selalu terlihat walau jendela lebih tinggi dari layar */
.toasts { top: 20px; bottom: auto; }
.btn.saved { background: var(--ok) !important; border-color: var(--ok) !important; color: #fff !important; opacity: 1 !important; }
