:root {
  --bg: #F5F6F8; --surface: #FFFFFF; --soft: #EEF0F3; --ink: #0F172A; --text: #334155; --muted: #64748B; --line: #E2E8F0;
  --side: #0F172A; --side-2: #1E293B; --side-ink: #CBD5E1; --side-muted: #94A3B8;
  --accent: #4F46E5; --accent-ink: #FFFFFF; --accent-soft: #EEF2FF; --accent-text: #4338CA;
  --blue: #2563EB; --blue-bg: #EFF6FF; --amber: #B45309; --amber-bg: #FEF3C7; --amber-soft: #FFFBEB; --amber-line: #FCD34D;
  --green: #16A34A; --green-text: #047857; --green-bg: #ECFDF5; --red: #DC2626; --red-text: #B91C1C; --red-bg: #FEF2F2; --red-line: #FECACA;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-decoration: none; } a:hover { color: var(--accent-text); }
h1, h2, p { margin: 0; }
h2 { font-size: 16px; font-weight: 600; }
.muted { color: var(--muted); }
.sr { position: absolute; left: -9999px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* shell */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 232px; max-width: 260px; background: var(--side); color: var(--side-ink); padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; }
.content { flex: 999 1 640px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: #fff; }
.brand:hover { color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; font-weight: 600; } .brand-text small { font-size: 12px; color: var(--side-muted); }
.logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; }
.logo.big { width: 52px; height: 52px; border-radius: 14px; font-size: 18px; margin: 0 auto 14px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--side-ink); font-size: 14px; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.on { background: var(--side-2); color: #fff; font-weight: 500; }
.grow { flex: 1; }
.badge { background: #F59E0B; color: #1C1917; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.conn { padding: 14px 12px; border-radius: 10px; background: var(--side-2); display: flex; flex-direction: column; gap: 4px; }
.muted-d { font-size: 12px; color: var(--side-muted); }
.conn-state { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 14px; font-weight: 500; }
.logout { width: 100%; background: transparent; border: 1px solid var(--side-2); color: var(--side-muted); border-radius: 8px; padding: 8px; font: inherit; font-size: 13px; cursor: pointer; }
.logout:hover { color: #fff; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #64748B; }
.dot.live { background: #22C55E; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border-radius: 10px; border: 0; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--accent-ink); } .btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn.green { background: var(--green); color: #fff; } .btn.green:hover { filter: brightness(1.08); }
.btn.outline-red { background: #fff; color: var(--red); border: 1px solid var(--line); } .btn.outline-red:hover { background: var(--red-bg); }
.btn.wide { width: 100%; margin-top: 18px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--text); }
input, textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; }
input { height: 44px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.alert { padding: 10px 14px; border-radius: 10px; margin: 14px 0; font-size: 14px; }
.alert.warn { background: var(--amber-soft); color: var(--amber); } .alert.bad { background: var(--red-bg); color: var(--red-text); } .alert.good { background: var(--green-bg); color: var(--green-text); }

/* login */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px; box-shadow: 0 10px 30px rgba(15,23,42,.06); text-align: center; }
.login-card h1 { font-size: 22px; } .login-card .muted { margin-top: 4px; font-size: 14px; }
.login-card form { text-align: left; margin-top: 20px; }

/* header */
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.eyebrow { font-size: 13px; color: var(--muted); }
.head h1 { margin-top: 4px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.head-actions input { width: 240px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stat-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); font-weight: 500; }
.ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; } .ico svg { width: 16px; height: 16px; stroke-width: 2.2; }
.i-blue { background: var(--blue-bg); color: var(--blue); } .i-amber { background: var(--amber-bg); color: var(--amber); }
.i-green { background: var(--green-bg); color: var(--green); } .i-red { background: var(--red-bg); color: var(--red); }
.num { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub.strong { font-weight: 600; }
.stat.warn { background: var(--amber-soft); border-color: var(--amber-line); } .stat.warn .stat-top { color: #92400E; font-weight: 600; }
.stat.warn .num { color: var(--amber); } .stat.warn .sub { color: #92400E; }
.stat.bad .num { color: var(--red); }

/* approvals */
.approvals { display: flex; flex-direction: column; gap: 10px; }
.approvals:empty { display: none; }
.approval { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.approval-text { flex: 1 1 320px; min-width: 0; }
.approval-text .t { font-size: 15px; font-weight: 600; } .approval-text .t a { color: var(--ink); }
.approval-text .s { margin-top: 2px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.approval-actions { display: flex; gap: 8px; }

/* avatars */
.av { position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-weight: 700; font-size: 14px; }
.approval .av { width: 40px; height: 40px; border-radius: 10px; font-size: 13px; }
.av .dot { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border: 2px solid #fff; }
.av-indigo { background: #EEF2FF; color: #4338CA; } .av-cyan { background: #ECFEFF; color: #0E7490; } .av-rose { background: #FFF1F2; color: #BE123C; }
.av-amber { background: var(--amber-bg); color: var(--amber); } .av-green { background: #F0FDF4; color: #15803D; } .av-violet { background: #F5F3FF; color: #6D28D9; }
.av-plain { background: #F1F5F9; color: var(--muted); font-size: 20px; font-weight: 400; }

/* blocks */
.block { display: flex; flex-direction: column; gap: 12px; }
.block-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.block-head a { font-size: 13px; font-weight: 500; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

/* agents */
.agents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.agent { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: center; color: var(--ink); min-width: 0; }
.agent:hover { border-color: #C7D2FE; color: var(--ink); }
.agent.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.agent.add { border-style: dashed; border-color: #CBD5E1; }
.agent-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.agent-text strong { font-size: 15px; font-weight: 600; } .agent-text small { font-size: 12px; color: var(--muted); }
.agent.add strong { color: var(--text); }
.agent-num { text-align: right; display: flex; flex-direction: column; } .agent-num b { font-size: 18px; } .agent-num small { font-size: 11px; color: var(--muted); }

/* segmented */
.seg { display: flex; gap: 6px; padding: 4px; background: var(--line); border-radius: 10px; flex-wrap: wrap; }
.seg a { padding: 6px 14px; border-radius: 7px; font-size: 13px; color: #475569; font-weight: 500; }
.seg a.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

/* board */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { background: var(--soft); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px; font-size: 13px; font-weight: 600; }
.col-head span { flex: 1; } .col-head small { font-size: 12px; color: var(--muted); font-weight: 500; }
.cdot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.c-queued { --c: #94A3B8; } .c-running { --c: var(--blue); } .c-done { --c: var(--green); } .c-failed { --c: var(--red); }
.task { background: var(--surface); border-radius: 10px; padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; color: var(--ink); transition: box-shadow .12s, transform .12s; }
.task:hover { color: var(--ink); box-shadow: 0 6px 16px rgba(15,23,42,.08); transform: translateY(-1px); }
.task .t { font-size: 14px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.task .r { font-size: 13px; color: #475569; overflow-wrap: anywhere; }
.task-bad { outline: 1px solid var(--red-line); } .task-bad .r { color: var(--red-text); }
.bar { display: block; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar i { display: block; width: 40%; height: 4px; border-radius: 4px; background: var(--blue); animation: jalan 1.6s ease-in-out infinite; }
@keyframes jalan { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.meta { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.chip { padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 12px; }
.time { margin-left: auto; }
.col-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 14px 0; }
.more { text-align: center; font-size: 13px; font-weight: 500; padding: 4px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F1F5F9; align-items: start; font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: #94A3B8; }
.k-created .tl-dot { background: var(--blue); } .k-updated .tl-dot { background: var(--accent); } .k-approved .tl-dot { background: var(--green); }
.k-rejected .tl-dot { background: var(--red); } .k-note .tl-dot { background: #F59E0B; }
.tl-body { min-width: 0; overflow-wrap: anywhere; } .tl-body p + p { font-size: 13px; margin-top: 2px; }
.timeline time { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* detail */
.back { font-size: 14px; font-weight: 500; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.detail-grid h2 { margin: 22px 0 8px; }
.detail-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 10px 0 6px; overflow-wrap: anywhere; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.card > .row:first-child { margin-top: 0; }
.pill { padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; }
.p-queued { background: #F1F5F9; color: #475569; } .p-running { background: var(--blue-bg); color: var(--blue); } .p-waiting_approval { background: var(--amber-bg); color: var(--amber); }
.p-done { background: var(--green-bg); color: var(--green-text); } .p-failed { background: var(--red-bg); color: var(--red-text); }
.facts { display: flex; flex-direction: column; gap: 14px; }
.facts div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; } .facts small { font-size: 12px; color: var(--muted); }
.textblock { white-space: pre-wrap; overflow-wrap: anywhere; background: #F8FAFC; border: 1px solid var(--line); padding: 12px 14px; border-radius: 10px; font-size: 14px; color: var(--text); }
.decide { margin-top: 16px; padding: 16px; border-radius: 12px; background: var(--amber-soft); border: 1px solid var(--amber-line); }
.decide label { margin-top: 10px; }
.narrow { max-width: 640px; }

/* responsive */
@media (max-width: 1100px) { .stats, .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .agents { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .side { max-width: none; min-width: 0; flex-basis: 100%; padding: 14px 16px; gap: 12px; position: static; height: auto; overflow: visible; }
  .nav { flex-direction: row; overflow-x: auto; gap: 2px; }
  .nav a { padding: 8px 10px; white-space: nowrap; font-size: 13px; }
  .nav svg { display: none; }
  .side-foot { display: none; }
  .content { padding: 20px 16px 40px; gap: 20px; }
  .head h1 { font-size: 21px; }
  .head-actions, .head-actions form { width: 100%; } .head-actions input { width: 100%; }
  .agents, .board { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .num { font-size: 28px; }
}

/* modul data toko */
.nav-label { margin: 18px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #64748B; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
select { height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; color: var(--ink); }
.small { font-size: 13px; }
.pad { padding: 18px 20px 12px; }
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: #F8FAFC; padding: 10px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid #F1F5F9; vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #FAFBFC; }
.num-c { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prod { display: flex; flex-direction: column; color: var(--ink); min-width: 200px; }
.prod small { font-size: 12px; color: var(--muted); }
.price { display: block; font-weight: 600; }
.margin { display: inline-block; margin-top: 2px; font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 6px; }
.margin.ok { background: var(--green-bg); color: var(--green-text); } .margin.low { background: var(--amber-bg); color: var(--amber); } .margin.neg { background: var(--red-bg); color: var(--red-text); }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.two-col h2 + p { margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.file { height: auto; padding: 10px; }
.chip-lg { padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.btn.ghost { height: 40px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.w-sm { width: 80px; height: 40px; }
.inline-label { margin: 0; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 14px; }
.calc { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #FCFCFD; }
.calc-head { display: flex; flex-direction: column; gap: 2px; }
.breakdown { margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.breakdown div { display: flex; justify-content: space-between; gap: 8px; }
.breakdown dt { color: var(--muted); } .breakdown dd { margin: 0; font-variant-numeric: tabular-nums; }
.breakdown .total { border-top: 1px dashed var(--line); padding-top: 8px; font-weight: 700; }
.breakdown .total dd { color: var(--green-text); } .breakdown dd.neg { color: var(--red-text) !important; }
.hint { margin-top: 12px; font-size: 13px; color: var(--text); background: var(--accent-soft); padding: 8px 10px; border-radius: 8px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .nav-label { display: none; } .grid2 { grid-template-columns: 1fr; } }

/* saran balasan */
.draft { display: flex; flex-direction: column; gap: 10px; }
.draft-head { display: flex; gap: 12px; align-items: center; }
.draft-head .grow { display: flex; flex-direction: column; }
.draft .av { width: 40px; height: 40px; border-radius: 50%; font-size: 13px; }
.bubble { align-self: flex-start; max-width: 680px; background: #F1F5F9; padding: 10px 14px; border-radius: 4px 14px 14px 14px; font-size: 14px; overflow-wrap: anywhere; }
.draft textarea { background: #F5F3FF; border-color: #DDD6FE; }
.draft .row input { height: 44px; min-width: 200px; }
.alt { margin-top: 6px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }
.linkish.red { color: var(--red); }
.bank { columns: 340px; column-gap: 16px; }
.bank > .card { break-inside: avoid; margin-bottom: 16px; }
.tpl { list-style: none; margin: 10px 0 0; padding: 0; }
.tpl li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid #F1F5F9; font-size: 14px; }
.tpl li:last-child { border-bottom: 0; }
.tpl code { font-size: 12px; background: var(--accent-soft); color: var(--accent-text); padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.tpl .rule { font-size: 11px; background: var(--amber-bg); color: var(--amber); padding: 2px 6px; border-radius: 6px; font-weight: 600; }
.tpl-text { overflow-wrap: anywhere; }
.tpl form { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* filter papan */
.filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.low-stock { color: var(--red-text); font-weight: 700; }
.red-t { color: var(--red-text); }
.chip-warn { background: var(--red-bg); border-color: var(--red-line); color: var(--red-text); }
.margin.na { background: #F1F5F9; color: var(--muted); }

/* penjualan, stok, pembelian */
.filters-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.date { width: 150px; height: 40px; }
.range-form .btn.ghost { height: 40px; }
.block { display: block; }
small.block { display: block; font-size: 11px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 160px; margin-top: 14px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar-col i { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.bar-col:hover i { opacity: 1; }
.bars-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.hbars { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.hbar { display: grid; grid-template-columns: 70px 1fr 130px; gap: 10px; align-items: center; font-size: 13px; }
.hbar i { display: block; height: 14px; background: var(--accent); border-radius: 4px; min-width: 2px; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.row-need { background: #FFFBFB; }
.tbl input[type=checkbox] { width: 18px; height: 18px; }
.tbl .w-sm { width: 80px; height: 34px; padding: 4px 8px; text-align: right; }
@media (max-width: 760px) { .hbar { grid-template-columns: 60px 1fr; } .hbar b { grid-column: 2; text-align: left; } .date { width: 100%; } }

/* Pilihan CV di sidebar */
.cv-switch { display: flex; flex-direction: column; gap: 6px; padding: 0 8px; }
.cv-switch label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--side-muted); margin: 0; }
.cv-switch select { width: 100%; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; }
.cv-switch select option { color: #0F172A; }

/* --- Perapian jarak (konsisten di semua halaman) --- */
.card > h2 + p, .card > h2 + .muted, .card .block-head + p { margin-top: 6px; }
.card > p + form, .card > p + .table-wrap, .card > .muted + form { margin-top: 14px; }
.card > form > label:first-of-type, .card > form > .grid2:first-child label { margin-top: 0; }
.card form select { width: 100%; }
.card form .inline-form select, .card form .w-sm, .inline-form select { width: auto; }
.grid2 { align-items: end; }
.grid2 > div > label { margin-top: 14px; }
.file { height: auto; padding: 8px; background: var(--bg, #F8FAFC); cursor: pointer; font-size: 14px; color: var(--muted); }
.file::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.file::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }
.card .row { margin-top: 18px; }
.block-head + .stats, .block-head + .board, .block-head + .agents, .block-head + .table-wrap { margin-top: 12px; }
section > .block-head:first-child + * { margin-top: 12px; }
.filters-row { row-gap: 12px; }
.calc-grid > .card { display: flex; flex-direction: column; }
.calc-grid > .card > .row { margin-top: auto; padding-top: 18px; }
.calc-grid > form.card > label:first-of-type { margin-top: 0; }
.card h2 + .table-wrap { margin-top: 12px; }
.card h2[style] { margin-bottom: 6px; }
.tbl td, .tbl th { vertical-align: middle; }
@media (max-width: 760px) { .card { padding: 16px; } .pad { padding: 14px 16px 10px; } }

/* Pengguna & akses */
.user-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; margin-top: 18px; align-items: start; }
.user-grid h2, .grid2.top h2 { font-size: 17px; margin-bottom: 6px; }
.grid2.top { margin-top: 18px; align-items: start; }
.block-head.pad { padding: 18px 20px 6px; }
.user-list { list-style: none; margin: 0; padding: 0; }
.user-row { display: flex; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); align-items: flex-start; }
.user-row.off { opacity: .6; }
.user-row .grow { flex: 1; min-width: 0; }
.user-row details { margin-top: 8px; }
.user-row summary { cursor: pointer; color: var(--accent-text); font-size: 13.5px; font-weight: 600; }
.user-row details form { margin-top: 8px; }
.small { font-size: 13px; margin-top: 2px; }
.menu-boxes { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 14px 0 4px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.menu-boxes legend { font-size: 13px; font-weight: 600; padding: 0 6px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 14px; margin: 0; }
label.check input { width: 16px; height: 16px; margin: 0; flex: none; }
.nav .me { color: #64748B; font-size: 11.5px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-h { font-size: 14px; margin: 16px 0 6px; }
.plain-list { margin: 0; padding-left: 18px; line-height: 1.8; }
@media (max-width: 960px) { .user-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .menu-boxes { grid-template-columns: 1fr; } }

/* Video promosi */
.video-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; margin-top: 18px; align-items: start; }
.video-grid h2 { font-size: 17px; margin-bottom: 6px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.video-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 14px; }
.vcard { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.vcard video, .vph { width: 100%; aspect-ratio: 9 / 16; background: #0F172A; display: block; object-fit: cover; }
.vph { display: flex; align-items: center; justify-content: center; color: #CBD5E1; font-weight: 600; }
.vph.gagal { background: var(--red-bg); color: var(--red-text); }
.vmeta { padding: 10px 12px 12px; }
.vmeta .t { font-weight: 600; font-size: 14px; }
.vmeta summary { cursor: pointer; font-size: 13px; color: var(--accent-text); margin-top: 6px; }
.pre { white-space: pre-wrap; }
.row.tight { margin-top: 10px; gap: 6px; flex-wrap: wrap; }
.row.tight form { margin: 0; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
@media (max-width: 960px) { .video-grid { grid-template-columns: 1fr; } }
select, input, textarea { max-width: 100%; }
.user-grid > *, .video-grid > *, .stack > * { min-width: 0; }

/* Sidebar per kategori (bisa dibuka-tutup) */
.nav { gap: 6px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; margin: 6px 0 2px; padding: 6px 12px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #64748B; user-select: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-top: -3px; transition: transform .15s; }
.nav-group:not([open]) > summary::after { transform: rotate(-45deg); margin-top: 0; }
.nav-group > summary:hover { color: #CBD5E1; }
.nav-group[open] > a + a { margin-top: 0; }
@media (max-width: 760px) {
  .nav { display: block; overflow-x: auto; white-space: nowrap; }
  .nav-group { display: inline-block; vertical-align: top; }
  .nav-group > a { display: inline-flex; }
  .nav-group > summary { display: none; }
}

/* Dropdown: panah sendiri dan jarak dalam yang rapi */
select {
  -webkit-appearance: none; appearance: none; height: 44px; padding: 0 40px 0 14px; line-height: 1.2;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden; cursor: pointer;
}
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cv-switch { padding: 0 4px; }
.cv-switch select {
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px;
  height: 42px; padding: 0 38px 0 12px; border-radius: 10px;
  background-color: rgba(255,255,255,.07);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23CBD5E1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.cv-switch select:hover { background-color: rgba(255,255,255,.12); }
.acc-list { list-style: none; margin: 12px 0 4px; padding: 0; }
.acc-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.acc-list li.off { opacity: .6; }
.acc-list li form { margin: 0 0 0 auto; }
.platform-alt { margin-top: 4px; }
form.card select, .card form select { width: 100%; }

/* Studio konten (Video promosi bertahap) */
.pick-list { display: grid; gap: 8px; margin-top: 8px; max-height: 320px; overflow: auto; }
.pick-list:empty { display: none; }
.pick-card, .pick-chosen { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; }
.pick-card:hover, .pick-card:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.pick-chosen { margin-top: 8px; border-color: var(--accent); background: var(--accent-soft); cursor: default; }
.pick-chosen .btn { margin-top: 4px; }
.pc-name { font-weight: 600; color: var(--ink); }
.pc-prices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip.strong { background: var(--accent); color: #fff; }
.proj-list { list-style: none; margin: 12px 0 0; padding: 0; }
.proj-list li + li { border-top: 1px solid var(--line); }
.proj-list a { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "th main chip" "th steps chip"; gap: 2px 12px; align-items: center; padding: 10px 2px; color: var(--text); }
.proj-list a:hover { background: var(--soft); }
.proj-thumb { grid-area: th; width: 44px; height: 56px; border-radius: 8px; background: var(--soft); overflow: hidden; }
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; }
.proj-main { grid-area: main; display: flex; flex-direction: column; min-width: 0; }
.proj-main b { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-list .chip { grid-area: chip; white-space: nowrap; }
.steps-mini { grid-area: steps; display: flex; gap: 3px; }
.steps-mini i { width: 18px; height: 4px; border-radius: 2px; background: var(--line); }
.steps-mini i.on { background: var(--accent); }
.st-selesai { background: var(--green-bg); color: var(--green-text); }
.st-produk, .st-storyboard_proses, .st-video_proses, .st-posting { background: var(--amber-bg); color: var(--amber); }
details.card.manual summary { cursor: pointer; }
details.card.manual[open] summary { margin-bottom: 8px; }

.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 16px 0 0; overflow-x: auto; }
.stepper li { flex: 1; min-width: 96px; }
.stepper a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.stepper a span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--soft); font-size: 12px; flex: none; }
.stepper li.done a { color: var(--green-text); } .stepper li.done a span { background: var(--green-bg); }
.stepper li.now a { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); } .stepper li.now a span { background: var(--accent); color: #fff; }
.task-note { margin-top: 12px; font-size: 13px; }
.task-note.live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-right: 6px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.studio { display: grid; gap: 18px; margin-top: 18px; }
.studio > .card { min-width: 0; scroll-margin-top: 16px; }
.studio .card.locked { opacity: .6; }
.studio h3 { font-size: 14px; margin: 18px 0 8px; color: var(--ink); }
.prod-sum .t { font-size: 16px; font-weight: 600; color: var(--ink); margin-top: 8px; }
.ticks { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
details.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.more > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent-text); }
.wait { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 14px; }
.agent-note { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--soft); font-size: 13px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.thumbs figure { margin: 0; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--soft); }
.thumbs.refs img { border-style: dashed; }
.thumbs figcaption { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 4px; flex-wrap: wrap; }
.thumbs form { display: inline; margin: 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; }
.upload-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.upload-row input.file { flex: 1; min-width: 180px; width: auto; }
.upload-row select { width: auto; }
.row.tight { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.sb-preview { margin-top: 12px; }
.sb-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.sb-scene { margin: 0; flex: 0 0 172px; scroll-snap-align: start; transition: opacity .2s, transform .2s; }
.sb-strip.playing .sb-scene { opacity: .35; } .sb-strip.playing .sb-scene.active { opacity: 1; transform: scale(1.03); }
.phone { position: relative; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #0F172A; container-type: inline-size; }
.phone .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(10px) brightness(.85); transform: scale(1.15); }
.phone .fg { position: absolute; left: 6%; right: 6%; top: 12%; width: 88%; height: 60%; object-fit: contain; }
.sb-strip.playing .sb-scene.active .fg { animation: zoom 4s linear forwards; }
@keyframes zoom { to { transform: scale(1.06); } }
.phone .ov { position: absolute; left: 7%; right: 7%; text-align: center; font-weight: 700; line-height: 1.2; padding: 4px 6px; border-radius: 6px; box-decoration-break: clone; }
.phone .head { top: 7%; background: var(--head-bg); color: var(--head-fg); font-size: 8.5cqw; }
.phone .text { bottom: 22%; background: var(--text-bg); color: var(--text-fg); font-size: 6.8cqw; }
.phone .price { bottom: 12%; left: 22%; right: 22%; background: var(--price-bg); color: var(--price-fg); font-size: 9cqw; }
.phone.end { background: var(--end); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8%; color: #fff; text-align: center; padding: 10%; }
.end-store { font-weight: 700; font-size: 10cqw; } .end-cta { font-size: 6.5cqw; background: rgba(255,255,255,.18); padding: 4px 8px; border-radius: 6px; }
.sb-scene figcaption { font-size: 12px; margin-top: 6px; color: var(--text); line-height: 1.4; }
.sb-scene .vo { color: var(--ink); }
.cap-prev { margin-top: 12px; padding: 10px 12px; background: var(--soft); border-radius: 10px; }
.scene-edit { border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px 14px; margin: 14px 0 0; min-width: 0; }
.scene-edit legend { font-weight: 600; font-size: 14px; padding: 0 6px; color: var(--ink); }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 90px; gap: 10px; }
.grid3 > * { min-width: 0; }
.video-final { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 16px; margin-top: 12px; align-items: start; }
.video-final video { width: 100%; aspect-ratio: 9 / 16; background: #0F172A; border-radius: 12px; }
.acc-pick { border: 0; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.acc-pick legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.post-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; font-size: 14px; }
.ps-terposting { color: var(--green-text); font-weight: 600; } .ps-gagal { color: var(--red-text); font-weight: 600; } .ps-menunggu { color: var(--amber); font-weight: 600; }
@media (max-width: 760px) {
  .grid3 { grid-template-columns: 1fr 1fr; } .grid3 > :last-child { grid-column: span 2; }
  .video-final { grid-template-columns: 1fr; } .video-final video { max-width: 260px; }
  .sb-scene { flex-basis: 150px; }
  .stepper li { min-width: auto; flex: none; } .stepper a { padding: 8px 10px; font-size: 13px; }
}
details.more > summary { text-align: left; }
.thumbs.refs figcaption form { display: flex; gap: 8px; width: 100%; }
.pick-chosen[hidden] { display: none; }
.rcic-field { margin-top: 14px; }
.rcic-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rcic-head label { margin: 0; }
.rcic-field textarea { margin-top: 6px; }
.rcic-field textarea::placeholder { color: #94A3B8; font-style: italic; }
/* RCIC: kartu alur cerita & tombol terapkan saran */
h3.sec { font-size: 15px; margin: 20px 0 10px; color: var(--ink); }
.alur-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.alur { position: relative; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; cursor: pointer; font-weight: 400; margin: 0; }
.alur:hover { border-color: #A5B4FC; }
.alur.on { border: 2px solid var(--accent); background: var(--accent-soft); padding: 13px; }
.alur input { position: absolute; opacity: 0; pointer-events: none; }
.alur:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.alur-name { font-weight: 600; font-size: 15px; color: var(--ink); }
.alur-desc { font-size: 13px; color: var(--text); }
.alur .beats { display: flex; flex-wrap: wrap; gap: 4px; }
.alur .beats i { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--soft); color: var(--text); }
.alur.on .beats i, .alur.on .alur-ex { background: #fff; }
.alur-ex { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; line-height: 1.45; color: var(--ink); background: var(--soft); border-radius: 8px; padding: 8px 10px; }
.alur-ex b { color: var(--accent-text); }
.alur-fit { font-size: 12px; color: var(--muted); }
.alur .rec { position: absolute; top: -9px; right: 12px; font-size: 11px; font-weight: 700; background: var(--green-bg); color: var(--green-text); padding: 2px 8px; border-radius: 999px; border: 1px solid #A7F3D0; }
.sug-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 10px; background: var(--soft); }
.sug-top p { margin: 0; font-size: 14px; }
.rcic-field .state { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.state.ok { background: var(--green-bg); color: var(--green-text); } .state.edit { background: var(--amber-bg); color: var(--amber); } .state.empty { background: var(--soft); color: var(--muted); }
.sug { margin-top: 8px; border: 1px dashed #A5B4FC; background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.sug.used { opacity: .6; }
.sug-lbl { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 4px; }
.sug p { margin: 0; font-size: 14px; color: var(--ink); line-height: 1.45; }
.sug-acts { display: flex; flex-direction: column; gap: 6px; }
.rcic-after { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rcic-after .ok { color: var(--green-text); font-weight: 600; }
.rcic-count { margin-top: 14px; font-size: 14px; }
.alert .retry { margin-top: 8px; }
@media (max-width: 900px) { .alur-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .alur-grid { grid-template-columns: 1fr; } .sug { grid-template-columns: 1fr; } .sug-acts { flex-direction: row; } }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.rcic-after .ok.self { color: var(--amber); }
