/* Barbershop Dashboard — token desain mengikuti kefir-clinic-dashboard ("Midnight Clinical") */
:root {
  --bg: #1a1613; --bg-elev: #221d19;
  --surface: rgba(38,33,28,.76); --surface-2: rgba(52,45,39,.5); --surface-hover: rgba(64,56,48,.85); --surface-solid: #221d19;
  --border: rgba(214,207,199,.12); --border-strong: rgba(214,207,199,.24); --hairline: inset 0 1px 0 rgba(255,255,255,.05);
  --text: #f4f1ed; --text-soft: #d6cfc7; --text-muted: #a79e94;
  --accent: #f0a35e; --accent-soft: rgba(240,163,94,.14);
  --ok: #85c5b3; --warn: #dfbe79; --bad: #e0a4ac; --info: #93c1cb;
  --shadow-md: 0 16px 36px -20px rgba(0,0,0,.85);
  --radius: 18px; --sidebar-w: 17rem;
}
body.theme-light {
  --bg: #f7f4f0; --bg-elev: #fff; --surface: rgba(255,255,255,.9); --surface-2: #faf7f3; --surface-hover: #f2ece5; --surface-solid: #fff;
  --border: rgba(61,56,51,.09); --border-strong: rgba(61,56,51,.18); --hairline: inset 0 1px 0 rgba(255,255,255,.9);
  --text: #2a2622; --text-soft: #57514b; --text-muted: #7d766e;
  --accent: #c2691f; --accent-soft: rgba(194,105,31,.10);
  --ok: #2f7d68; --warn: #9a7418; --bad: #b4414f; --info: #3a6d7a;
  --shadow-md: 0 2px 4px rgba(74,60,50,.04), 0 16px 34px -20px rgba(74,60,50,.3);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Geist', system-ui, -apple-system, sans-serif; font-size: 14px; letter-spacing: -.006em;
  color: var(--text); background-color: var(--bg); overflow: hidden;
  background-image:
    radial-gradient(900px 620px at 6% -10%, rgba(240,163,94,.09), transparent 62%),
    radial-gradient(820px 560px at 94% -4%, rgba(224,164,172,.07), transparent 60%);
  background-attachment: fixed;
}
h1, h2, h3 { font-family: 'Geist', system-ui, -apple-system, sans-serif; font-weight: 600; letter-spacing: -.012em; margin: 0; }
.mono { font-family: 'Geist Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.app { display: flex; height: 100vh; }
#sidebar { width: var(--sidebar-w); flex-shrink: 0; padding: 16px 12px; overflow-y: auto; border-right: 1px solid var(--border);
  background: var(--surface); backdrop-filter: blur(22px); display: flex; flex-direction: column; gap: 14px; }
main { flex: 1; min-width: 0; overflow-y: auto; padding: 22px 26px 60px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.brand-logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.brand h1 { font-size: 17px; line-height: 1.1; }
.brand p { margin: 2px 0 0; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.nav-caption { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.nav-caption button { background: none; border: 0; cursor: pointer; font-size: 10px; color: var(--accent); padding: 2px 5px; border-radius: 6px; }
.nav-caption button:hover { background: var(--surface-hover); }
nav { display: flex; flex-direction: column; gap: 8px; }

/* ---------- sektor accordion (sama seperti kefir) ---------- */
.sector-card { border-radius: 12px; overflow: hidden; background: var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--sector-accent) 22%, transparent); transition: border-color .2s, background .2s; }
.sector-card.is-open { background: var(--surface); border-color: color-mix(in srgb, var(--sector-accent) 38%, transparent); }
.sector-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 7px 10px; cursor: pointer; user-select: none; background: none; border: 0; text-align: left; }
.sector-head:hover { background: var(--surface-hover); }
.sector-card.is-open > .sector-head { background: color-mix(in srgb, var(--sector-accent) 10%, transparent); }
.sector-head:focus-visible { outline: 2px solid var(--sector-accent); outline-offset: -2px; }
.sector-head .l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sector-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; flex-shrink: 0;
  color: var(--sector-accent); background: color-mix(in srgb, var(--sector-accent) 16%, transparent); border: 1px solid color-mix(in srgb, var(--sector-accent) 30%, transparent); }
.sector-title { font-size: 12px; font-weight: 700; line-height: 1.2; display: block; }
.sector-sub { font-size: 9.5px; font-weight: 600; margin-top: 2px; display: block; color: color-mix(in srgb, var(--sector-accent) 70%, var(--text-muted)); }
.sector-chev { font-size: 10px; color: var(--text-muted); transform: rotate(-90deg); transition: transform .24s; }
.sector-card.is-open .sector-chev { transform: none; color: var(--sector-accent); }
.sector-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .24s, box-shadow .24s; }
.sector-card.is-open > .sector-body { grid-template-rows: 1fr; box-shadow: inset 0 1px 0 var(--border); }
.sector-inner { overflow: hidden; min-height: 0; padding: 0 6px; transition: padding .24s; }
.sector-card.is-open .sector-inner { padding: 4px 6px 6px; }
.sector-inner > * + * { margin-top: 2px; }
.nav-btn { width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 9px; border: 0;
  background: none; cursor: pointer; font-size: 12px; color: var(--text-soft); transition: background .15s, color .15s; }
.nav-btn:hover { background: var(--surface-hover); color: var(--text); }
.nav-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-btn i { width: 16px; text-align: center; }

.user-box { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.user-box .av { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.user-box .nm { font-size: 12px; font-weight: 700; } .user-box .rl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--text-muted); padding: 6px; border-radius: 8px; }
.icon-btn:hover { color: var(--text); background: var(--surface-hover); }

/* ---------- komponen ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md), var(--hairline); padding: 18px; }
.page { display: flex; flex-direction: column; gap: 20px; max-width: 1180px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.page-head h2 { font-size: 22px; } .page-head p { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.kpi .lb { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.kpi .vl { font-size: 22px; font-weight: 800; margin-top: 4px; white-space: nowrap; }
.kpi .sb { font-size: 11px; color: var(--text-muted); margin-top: 2px; min-height: 14px; }
.kpi.hl .vl { color: var(--accent); }
.field, select.field { background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 10px; padding: 7px 10px; font-size: 12.5px; min-width: 0; }
.field:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 0; }
.btn { border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); border-radius: 10px; padding: 7px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.btn:hover { background: var(--surface-hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1613; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.form-grid .span { grid-column: 1 / -1; }
.lbl { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; display: block; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: var(--accent-soft); }
.r { text-align: right; } .muted { color: var(--text-muted); } .small { font-size: 11px; }
.table-wrap { overflow-x: auto; }
.bar-row { display: grid; grid-template-columns: 46px 1fr 112px 34px; gap: 8px; align-items: center; font-size: 11.5px; }
.bar { height: 14px; border-radius: 5px; background: var(--surface-2); } .bar > i { display: block; height: 100%; border-radius: 5px; background: var(--accent); opacity: .8; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 700; border: 1px solid var(--border-strong); }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.empty { text-align: center; color: var(--text-muted); padding: 26px 10px; font-size: 12.5px; }
.notice { border-radius: 12px; padding: 11px 14px; font-size: 12.5px; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); color: var(--warn); }
.toast { position: fixed; right: 18px; bottom: 18px; padding: 10px 14px; border-radius: 12px; font-size: 12.5px; font-weight: 600; z-index: 80;
  background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow-md); }
.toast.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.toast.ok { color: var(--ok); }

/* ---------- login ---------- */
#login { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--bg); padding: 20px; }
#login .box { width: 100%; max-width: 360px; }
#login h2 { font-size: 24px; margin-bottom: 4px; }
#login form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
#login .err { color: var(--bad); font-size: 12px; min-height: 16px; }

/* ---------- mobile ---------- */
.menu-btn { display: none; }
@media (max-width: 860px) {
  #sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .25s; background: var(--surface-solid); }
  body.menu-open #sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.5); }
  main { padding: 16px 14px 60px; }
  .menu-btn { display: inline-flex; }
  .bar-row { grid-template-columns: 40px 1fr 96px 28px; }
}
@media (prefers-reduced-motion: reduce) { .sector-body, .sector-inner, .sector-chev, #sidebar { transition: none; } }

/* ---------- tambahan modul ---------- */
.tab { display: flex; flex-direction: column; gap: 20px; }
.tab.hidden { display: none !important; }
.card h3 { font-size: 15px; margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.w100 { width: 100%; }
.toolbar.between { justify-content: space-between; }
.row-between { display: flex; justify-content: space-between; gap: 10px; }
.progress { height: 18px; border-radius: 9px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--ok)); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.pill.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); }
.btn.sm { padding: 4px 9px; font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.readonly-note { font-size: 11.5px; color: var(--text-muted); }

/* ---------- modul tambahan ---------- */
.check-row { display: flex; gap: 10px; align-items: center; padding: 6px 2px; cursor: pointer; font-size: 13px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.row-active td { background: var(--accent-soft); }
.modal-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 18px; padding: 22px; width: min(460px, 100%); max-height: 90vh; overflow: auto; }
.btn.sm { white-space: nowrap; }
a.btn { text-decoration: none; display: inline-block; }
@media print {
  body > *:not(#slip-overlay) { display: none !important; }
  #slip-overlay { position: static; background: none; padding: 0; display: block; }
  .modal { border: 0; box-shadow: none; width: 100%; background: #fff; color: #000; }
  .modal * { color: #000 !important; }
  .no-print { display: none !important; }
}

/* ---------- asisten AI: panel menempel di kanan ---------- */
.ai-dock { display: none; flex-shrink: 0; flex-direction: column; height: 100vh; width: 380px; padding: 12px 12px 12px 0; }
body.ai-open .ai-dock { display: flex; }
@media (min-width: 1280px) { .ai-dock { width: 420px; } }
@media (min-width: 1536px) { .ai-dock { width: 460px; } }
.ai-card { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; background: var(--surface-solid);
  border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-md); }
.ai-card.thinking { animation: ai-glow 2.2s ease-in-out infinite; }
@keyframes ai-glow {
  0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 22px -6px color-mix(in srgb, var(--accent) 35%, transparent); }
  50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 30px -4px color-mix(in srgb, var(--accent) 55%, transparent); }
}
.ai-top { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px 20px; flex-shrink: 0; }
.ai-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: #fff;
  background: linear-gradient(135deg, #f0a35e, #d46a8a 60%, #8d7be0); font-size: 16px; }
.ai-avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.ai-name { flex: 1; min-width: 0; font-size: 17px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-top-actions { display: flex; gap: 2px; flex-shrink: 0; }
.ai-ico { width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 15px; }
.ai-ico:hover { background: var(--surface-hover); color: var(--text); }
.ai-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.ai-empty { min-height: 100%; display: flex; flex-direction: column; padding: 0 24px 8px; }
.ai-empty-hero { flex: 1; display: grid; place-items: center; text-align: center; padding: 40px 0; }
.ai-empty-hero h2 { font-size: 28px; font-weight: 500; line-height: 1.2; margin: 0;
  background: linear-gradient(90deg, #f0a35e, #d46a8a, #8d7be0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ai-suggest { display: flex; flex-direction: column; gap: 4px; }
.ai-suggest button { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 0; background: none; color: var(--text);
  padding: 10px 12px; border-radius: 16px; font-size: 14px; cursor: pointer; }
.ai-suggest button:hover { background: var(--surface-hover); }
.ai-suggest i { color: var(--text-muted); margin-top: 3px; transform: scaleX(-1); }
.ai-msgs { padding: 14px 20px 8px; display: flex; flex-direction: column; gap: 20px; }
.ai-row-user { display: flex; flex-direction: column; align-items: flex-end; animation: ai-rise .3s ease-out both; }
.ai-bubble-user { max-width: 82%; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 24px 24px 6px 24px; padding: 10px 16px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.ai-row-bot { display: flex; gap: 12px; align-items: flex-start; animation: ai-rise .3s ease-out both; }
.ai-bot-col { min-width: 0; flex: 1; max-width: 92%; }
.ai-bubble-bot { background: var(--surface-2); border: 1px solid var(--border); border-radius: 24px 24px 24px 6px; padding: 12px 16px; font-size: 14px; line-height: 1.55; }
.ai-bubble-bot.err { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 8%, transparent); }
.ai-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: flex; justify-content: space-between; gap: 8px; }
@keyframes ai-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ai-fmt > * + * { margin-top: 8px; }
.ai-fmt h4 { margin: 10px 0 4px; font-size: 14.5px; font-weight: 700; }
.ai-fmt ul, .ai-fmt ol { margin: 4px 0; padding-left: 20px; } .ai-fmt li { margin: 3px 0; }
.ai-fmt code { background: var(--surface-hover); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
.ai-fmt strong { font-weight: 700; } .ai-fmt em { color: var(--text-muted); }
.ai-table { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.ai-table table { font-size: 12px; } .ai-table th, .ai-table td { padding: 5px 7px; white-space: nowrap; } .ai-table th { font-size: 10px; letter-spacing: .03em; }
.ai-actions { display: flex; gap: 2px; margin: 4px 0 0 -8px; }
.ai-actions button { border: 0; background: none; color: var(--text-muted); font-size: 12px; padding: 5px 10px; border-radius: 99px; cursor: pointer; }
.ai-actions button:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.ai-actions button:disabled { opacity: .4; cursor: not-allowed; }
.ai-thinking-row { display: flex; gap: 12px; align-items: flex-start; }
.ai-dots { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 24px 24px 24px 6px; padding: 10px 16px; font-size: 12.5px; color: var(--text-muted); }
.ai-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: .75; animation: ai-bounce 1s infinite; }
.ai-dots i:nth-child(2) { animation-delay: .15s; } .ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px); } }
.ai-composer { flex-shrink: 0; padding: 8px 16px 12px; }
.ai-input-card { border: 1px solid var(--border-strong); border-radius: 24px; padding: 12px 14px; background: var(--surface-solid); transition: border-color .15s; }
.ai-input-card:focus-within { border-color: var(--accent); }
.ai-input-card textarea { width: 100%; resize: none; border: 0; outline: 0; background: none; font-size: 15px; max-height: 140px; padding: 0 4px; }
.ai-input-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.ai-scope { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--text-muted); }
.ai-scope i { color: var(--accent); font-size: 11px; }
.ai-send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: #1a1613; cursor: pointer; font-size: 15px; }
.ai-send:hover:not(:disabled) { filter: brightness(1.08); }
.ai-send:disabled { background: var(--surface-2); color: var(--text-muted); cursor: not-allowed; }
.ai-send.stop { background: var(--text); color: var(--bg); }
.ai-disclaimer { margin: 8px 0 0; text-align: center; font-size: 11.5px; color: var(--text-muted); }
.ai-usage { margin: 2px 0 0; text-align: center; font-size: 10.5px; color: var(--text-muted); min-height: 13px; }
.ai-hist { padding: 4px 12px 12px; }
.ai-hist-head { display: flex; align-items: center; gap: 8px; padding: 4px 8px 10px; font-weight: 600; }
.ai-hist-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 16px; cursor: pointer; }
.ai-hist-item:hover { background: var(--surface-hover); }
.ai-hist-item .t { flex: 1; min-width: 0; }
.ai-hist-item .t b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-hist-item .t span { font-size: 11.5px; color: var(--text-muted); }
.ai-backdrop { position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
.ai-backdrop[hidden] { display: none; }
.ai-dock[hidden] { display: none; }

/* layar kecil / tablet: panel jadi laci dari kanan */
@media (max-width: 1023px) {
  body.ai-open .ai-dock { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); padding: 0; height: 100dvh; }
  body.ai-open .ai-card { border-radius: 0; border-width: 0 0 0 1px; }
}
@media (prefers-reduced-motion: reduce) { .ai-card.thinking, .ai-dots i, .ai-row-bot, .ai-row-user { animation: none; } }

@media (max-width: 480px) { .kpi .vl { font-size: 18px; } }

/* ---------- Pusat Kendali ---------- */
.bell-wrap { position: relative; }
.bell { position: relative; }
.bell-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--info); color: #fff;
  font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.bell-badge.crit { background: var(--bad); }
.bell-badge[hidden] { display: none; }
.notif-pop { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 28px)); z-index: 60; background: var(--surface-solid);
  border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.45); overflow: hidden; }
.notif-pop[hidden] { display: none; }
.notif-head, .notif-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; }
.notif-head { border-bottom: 1px solid var(--border); } .notif-foot { border-top: 1px solid var(--border); justify-content: center; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-item:hover { background: var(--surface-hover); }
.notif-item.unread { background: var(--accent-soft); }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.notif-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12.5px; }
.notif-txt b { font-size: 13px; } .notif-txt span { color: var(--text-muted); } .notif-txt em { font-style: normal; font-size: 11px; color: var(--text-muted); }
.stat-card { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.stat-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }
.stat-lb { font-size: 11.5px; font-weight: 600; color: var(--text-muted); } .stat-vl { font-size: 22px; font-weight: 800; } .stat-vl span { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.stat-card.crit { border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 7%, var(--surface)); } .stat-card.crit .stat-ico { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.stat-card.warn { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); } .stat-card.warn .stat-ico { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.stat-card.info { border-color: color-mix(in srgb, var(--info) 35%, transparent); background: color-mix(in srgb, var(--info) 7%, var(--surface)); } .stat-card.info .stat-ico { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }
.stat-card.ok .stat-ico { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.alert-card { border: 1px solid var(--border); border-left-width: 4px; border-radius: 16px; padding: 14px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.alert-card.sev-critical { border-left-color: var(--bad); } .alert-card.sev-warning { border-left-color: var(--warn); } .alert-card.sev-info { border-left-color: var(--info); }
.alert-card.is-resolved { opacity: .6; }
.alert-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-block; padding: 1px 9px; border-radius: 8px; background: var(--surface-2); font-size: 11px; color: var(--text-muted); }
.chip.strong { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.alert-title { font-size: 15px; font-weight: 700; } .alert-detail { font-size: 13px; color: var(--text-soft); }
.alert-action { font-size: 12.5px; color: var(--accent); }
.alert-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; transition: background .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--ok); } .switch input:checked + span::before { transform: translateX(18px); }
.switch input:disabled + span { opacity: .4; cursor: not-allowed; } .switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rule-row { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
@media (prefers-reduced-motion: reduce) { .switch span, .switch span::before { transition: none; } }

/* header halaman: judul di kiri; filter tanggal lalu bel + asisten AI di ujung kanan.
   Mengikuti lebar area konten (bukan layar): saat panel chat terbuka & area menyempit,
   filter turun ke baris kedua sementara bel + asisten tetap di kanan atas. */
main { container-type: inline-size; }
.page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px 14px; }
.page-head > div:first-child { grid-column: 1; grid-row: 1; min-width: 0; }
.page-head #range-bar { grid-column: 2; grid-row: 1; }
.page-head .head-actions { grid-column: 3; grid-row: 1; justify-content: flex-end; }
@container (max-width: 880px) {
  .page-head { grid-template-columns: minmax(0, 1fr) auto; }
  .page-head .head-actions { grid-column: 2; grid-row: 1; }
  .page-head #range-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Dashboard ---------- */
.grid.tops { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.top-row { display: flex; gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.top-row:last-child { border-bottom: 0; } .top-row[data-act]:hover { background: var(--surface-hover); border-radius: 12px; }
.top-rank { width: 28px; text-align: center; font-size: 17px; flex-shrink: 0; color: var(--text-muted); font-weight: 700; }
.top-main { flex: 1; min-width: 0; }
.top-label { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-sub { font-size: 11.5px; color: var(--text-muted); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-val { font-weight: 800; font-size: 13px; white-space: nowrap; }
.dash-alert { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 9px 10px; border-left: 3px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); margin-bottom: 8px; }
.dash-alert.sev-critical { border-left-color: var(--bad); } .dash-alert.sev-warning { border-left-color: var(--warn); } .dash-alert.sev-info { border-left-color: var(--info); }
.dash-alert-main { min-width: 0; }
#db-notifs .notif-item { border-radius: 12px; border-bottom: 0; margin-bottom: 4px; }

/* ---------- dikerjain v2: halaman modul berbasis spec ---------- */
.sector-sub.persona { font-weight: 600; }
.nav-footer { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.nav-footer .nav-btn i { color: var(--text-muted); }
.sec-title { font-size: 15px; margin: 0 0 12px; }
.trend { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.trend .col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.trend .bars { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.trend .b { flex: 1; max-width: 34px; border-radius: 6px 6px 0 0; background: var(--accent); opacity: .85; min-height: 3px; }
.trend .b.b2 { background: var(--ok); }
.trend .b.proj { background: repeating-linear-gradient(45deg, var(--accent), var(--accent) 4px, transparent 4px, transparent 8px); opacity: .6; }
.trend .lb { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
.trend .v { font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.note-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-left: 3px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); margin-bottom: 8px; cursor: pointer; }
.note-row.critical { border-left-color: var(--bad); } .note-row.warning { border-left-color: var(--warn); } .note-row.info { border-left-color: var(--info); }
.note-row:hover { background: var(--surface-hover); }
.note-row .area { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.cell-wa { max-width: 340px; color: var(--text-muted); font-size: 11.5px; }
.tone-ok { color: var(--ok); } .tone-warn { color: var(--warn); } .tone-bad { color: var(--bad); }
.period-input { width: 150px; }

/* ---------- karakter karyawan AI ---------- */
.sector-icon.has-img { overflow: hidden; padding: 0; }
.sector-icon img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ai-avatar { overflow: hidden; }
.ai-face { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 50%; }
.team-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.persona-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; background: color-mix(in srgb, var(--pc) 7%, var(--surface)); }
.persona-photo { background: linear-gradient(180deg, #fbfaf7 0%, #fbfaf7 62%, color-mix(in srgb, var(--pc) 16%, #fbfaf7) 100%); display: flex; justify-content: center; padding-top: 12px; }
.persona-photo img { height: 190px; width: auto; max-width: 100%; object-fit: contain; mix-blend-mode: multiply; }
.persona-body { padding: 8px 18px 4px; flex: 1; }
.persona-name { font-family: 'Geist', system-ui, sans-serif; font-size: 22px; font-weight: 700; text-align: center; }
.persona-role { text-align: center; color: var(--pc); font-weight: 700; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.persona-intro { font-size: 12.5px; color: var(--text-muted); text-align: center; margin: 10px 0 8px; min-height: 54px; }
.persona-card ul { padding: 0 0 8px; }
.persona-card .ask { margin: 4px 16px 16px; width: calc(100% - 32px); }

/* ---------- karakter di panel chat ---------- */
.ai-persona-row { display: flex; gap: 6px; padding: 4px 0 6px; overflow-x: auto; }
.ai-pchip { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 58px; padding: 6px 4px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); cursor: pointer; font-size: 10.5px; font-weight: 700; }
.ai-pchip img, .ai-pchip i { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--surface-hover); display: grid; place-items: center; }
.ai-pchip:hover { background: var(--surface-hover); color: var(--text); }
.ai-pchip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ai-hero-char { text-align: center; }
.ai-hero-char img { width: 150px; height: 150px; object-fit: contain; border-radius: 28px; background: #fbfaf7; mix-blend-mode: normal; box-shadow: 0 0 0 4px color-mix(in srgb, var(--pc) 28%, transparent); }
.ai-hero-char h2 { margin: 14px 0 6px; }
.ai-hero-char p { margin: 0 auto; max-width: 290px; font-size: 13px; color: var(--text-muted); }
.ai-empty-hero:has(.ai-hero-char) h2 { background: none; color: var(--text); -webkit-text-fill-color: currentColor; font-size: 22px; }

/* lonceng: di layar sempit popup menempel ke tepi layar agar tidak terpotong */
@media (max-width: 760px) { .notif-pop { position: fixed; left: 14px; right: 14px; top: 68px; width: auto; } }

/* =====================================================================
   SKIN KEFIR — konten mengikuti design system "Midnight Clinical" KEFIR:
   aksen eucalyptus/jade, kartu kaca (blur + sheen + hover lift), angka gradien,
   header tabel uppercase di atas surface-2, tombol utama gradien hijau.
   ===================================================================== */
:root {
  --accent: #99c5bb; --accent-2: #85c5b3; --accent-soft: rgba(153, 197, 187, .14); --accent-glow: rgba(153, 197, 187, .32);
  --ok: #85c5b3; --warn: #dfbe79; --bad: #e0a4ac; --info: #93c1cb; --on-accent: #12201c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 38px 68px -32px rgba(0, 0, 0, .9);
  --ring: 0 0 0 3px rgba(153, 197, 187, .24); --radius: 22px; --sidebar-w: 17.25rem;
}
body.theme-light {
  --accent: #518c7e; --accent-2: #398c76; --accent-soft: rgba(81, 140, 126, .10); --accent-glow: rgba(81, 140, 126, .30);
  --ok: #2f7d68; --warn: #9a7418; --bad: #b4414f; --info: #3a6d7a; --on-accent: #fff;
  --surface: rgba(255, 255, 255, .88); --surface-2: #faf7f3; --shadow-lg: 0 10px 16px rgba(74, 60, 50, .05), 0 38px 64px -30px rgba(74, 60, 50, .36);
  --ring: 0 0 0 3px rgba(81, 140, 126, .18);
}
body {
  background-image:
    radial-gradient(900px 620px at 6% -10%, rgba(153, 197, 187, .10), transparent 62%),
    radial-gradient(820px 560px at 94% -4%, rgba(224, 164, 172, .09), transparent 60%),
    radial-gradient(1100px 720px at 50% 112%, rgba(223, 190, 121, .07), transparent 62%);
}
body.theme-light {
  background-image:
    radial-gradient(900px 620px at 6% -12%, rgba(81, 140, 126, .10), transparent 60%),
    radial-gradient(820px 560px at 96% -6%, rgba(205, 119, 132, .09), transparent 58%),
    radial-gradient(1000px 700px at 50% 114%, rgba(207, 161, 78, .08), transparent 60%);
}
::selection { background: var(--accent-soft); color: var(--text); }
::-webkit-scrollbar { width: 9px; height: 9px; } ::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: content-box; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
#sidebar { width: var(--sidebar-w); box-shadow: var(--shadow-md); background: var(--surface-solid); backdrop-filter: none; }

/* kartu kaca */
.card { position: relative; backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease, transform .3s cubic-bezier(.2, .7, .3, 1); }
.card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 1px; pointer-events: none; opacity: .8; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .16), transparent); }
body.theme-light .card::before { display: none; }
main .card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg), var(--hairline); transform: translateY(-2px); }
.login .card:hover, #login .card:hover, .ai-card:hover, .notif-pop:hover { transform: none; }

/* KPI: angka gradien, aksen jade pada kartu utama */
.kpi .vl { font-size: clamp(1.15rem, 1.42vw, 1.62rem); letter-spacing: -.03em;
  background: linear-gradient(180deg, var(--text) 35%, color-mix(in srgb, var(--text) 60%, transparent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.kpi.hl { border-color: color-mix(in srgb, var(--accent) 38%, transparent); box-shadow: var(--shadow-md), var(--hairline), 0 22px 44px -30px var(--accent-glow); }
.kpi.hl .vl { background: linear-gradient(180deg, var(--accent) 20%, color-mix(in srgb, var(--accent) 65%, var(--text))); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* tabel */
table { border-collapse: separate; border-spacing: 0; }
th { font-size: 10px; letter-spacing: .09em; font-weight: 800; background: var(--surface-2); padding: .7rem .65rem; border-bottom: 1px solid var(--border); }
th:first-child { border-top-left-radius: 12px; } th:last-child { border-top-right-radius: 12px; }
td { border-bottom: 1px solid var(--border); }
tbody tr { transition: background .16s ease; }
tr:hover td { background: var(--surface-hover); }

/* tombol & input */
.btn.primary { background: linear-gradient(135deg, #5f9b8c, #407065); border-color: transparent; color: #fff;
  box-shadow: 0 12px 26px -14px rgba(64, 112, 101, .95), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn.primary:hover { filter: brightness(1.06); }
input:focus, select:focus, textarea:focus, .field:focus { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
.nav-btn.active { box-shadow: inset 2px 0 0 var(--accent); }
.pill.ok { background: color-mix(in srgb, var(--ok) 10%, transparent); } .pill.warn { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.pill.bad { background: color-mix(in srgb, var(--bad) 10%, transparent); } .pill.info { background: color-mix(in srgb, var(--info) 10%, transparent); }
.bar > i { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, transparent), var(--accent)); opacity: 1; }
.trend .b { background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, transparent)); }
.ai-send, .brand-logo { background-color: var(--accent-soft); }
.ai-send { background: var(--accent); color: var(--on-accent); }
@media (prefers-reduced-motion: reduce) { .card, main .card:hover { transition: none; transform: none; } }
td.r.mono, td.mono { white-space: nowrap; }

.cell-link { color: var(--accent); font-weight: 700; text-decoration: none; }
.cell-link:hover { text-decoration: underline; }

/* ---------- highlight poin ---------- */
.hl-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.hl-chip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.hl-chip i { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 13px; color: var(--text-muted); background: var(--surface-hover); }
.hl-chip b { display: block; font-size: 13px; } .hl-chip span { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.hl-chip.ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); } .hl-chip.ok i { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.hl-chip.warn { border-color: color-mix(in srgb, var(--warn) 35%, transparent); } .hl-chip.warn i { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.hl-chip.bad { border-color: color-mix(in srgb, var(--bad) 35%, transparent); } .hl-chip.bad i { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.hl-chip.info i { color: var(--info); background: color-mix(in srgb, var(--info) 14%, transparent); }

/* ---------- konfigurasi AI & token ---------- */
.cfg-av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: top; flex-shrink: 0; }
.cfg-av.sm { width: 20px; height: 20px; } .cfg-av.lg { width: 46px; height: 46px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-soft); cursor: pointer; font-size: 12px; font-weight: 600; }
.chip-btn:hover { background: var(--surface-hover); } .chip-btn.on { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.cfg-field { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-soft); }
.cfg-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.av-toggle { width: 34px; height: 34px; border-radius: 50%; padding: 0; border: 2px solid var(--border-strong); background: none; cursor: pointer; overflow: hidden; opacity: .45; display: inline-block; }
.av-toggle.on { opacity: 1; border-color: var(--accent); } .av-toggle img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.block { display: block; }
.rcpt { position: relative; } .rcpt summary { list-style: none; cursor: pointer; }
.rcpt-list { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 240px; max-height: 260px; overflow: auto; padding: 8px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); }
.wa-sim { border-radius: 18px; overflow: hidden; border: 1px solid var(--border-strong); max-width: 420px; }
.wa-head { background: #075e54; color: #fff; padding: 10px 14px; font-weight: 700; font-size: 13px; }
.wa-stream { background: #efeae2; height: 300px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.wa-msg { max-width: 85%; background: #fff; color: #1c1c1c; padding: 7px 11px; border-radius: 12px 12px 12px 2px; font-size: 13px; white-space: pre-wrap; }
.wa-msg.me { align-self: flex-end; background: #d9fdd3; border-radius: 12px 12px 2px 12px; }
.wa-form { display: flex; gap: 8px; padding: 8px; background: var(--surface-2); }
.wa-form .field { flex: 1; min-width: 0; }
.token-chip { font-size: 12px; } .token-chip.menipis { color: var(--warn); } .token-chip.habis { color: var(--bad); }
.switch.row { display: inline-block; }

/* =====================================================================
   Shell mengikuti ai-dashboard-klinik (branch design-template):
   sidebar 264px + logo, bar header 64px, tema "Lampu", tombol AI bergradien.
   ===================================================================== */
:root {
  --sidebar-w: 264px;
  --ai-fill-1: #0b7f9c; --ai-fill-2: #7358ea; --ai-fill-3: #b52bc4;
}
#sidebar { padding: 0 12px 12px; gap: 8px; }
.brand.brand-img { height: 64px; padding: 0 8px 0 8px; flex-shrink: 0; display: flex; align-items: center; }
.brand-img img { width: 100%; height: auto; display: block; }
.brand-img .logo-light-theme { display: none; }
body.theme-light .brand-img .logo-light-theme { display: block; }
body.theme-light .brand-img .logo-dark-theme { display: none; }
.nav-caption { margin-top: 2px; }

.side-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.side-act { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; border: 0; background: none;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-muted); text-align: left; transition: background .15s, color .15s; }
.side-act:hover { background: var(--surface-hover); color: var(--text); }
.side-act.danger:hover { color: var(--bad); }
.side-act i { width: 17px; text-align: center; }
.user-box { margin-top: 4px; background: none; border: 0; padding: 8px 12px; align-items: flex-start; }
.user-box .av { border-radius: 50%; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.user-box .nm { font-size: 13px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.user-box .rl { text-transform: none; letter-spacing: 0; font-size: 11.5px; line-height: 1.3; overflow-wrap: anywhere; }

main { padding: 0; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px 16px;
  flex-wrap: wrap; padding: 8px 26px; background: var(--bg); }
.topbar-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .head-actions { flex-shrink: 0; justify-content: flex-end; gap: 8px; }
.page { padding: 6px 26px 60px; }
.pill-btn, .ai-btn { height: 40px; border-radius: 999px; padding: 0 18px; display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.pill-btn { border-color: var(--border-strong); background: transparent; color: var(--text-muted); }
.pill-btn:hover { background: var(--surface-hover); color: var(--text); }
.ai-btn, .ai-btn:hover, .ai-btn[aria-pressed="true"] { border: 0; color: #fff; background: linear-gradient(90deg, var(--ai-fill-1), var(--ai-fill-2), var(--ai-fill-3));
  box-shadow: 0 6px 16px -8px rgba(115, 88, 234, .7); padding: 0 20px; transition: filter .15s, transform .1s; }
.ai-btn:hover { filter: brightness(1.1); } .ai-btn:active { transform: scale(.96); }
.ai-btn i { color: #fff !important; }
.bell { height: 40px; border-radius: 999px; }
@media (max-width: 860px) {
  .topbar { padding: 8px 14px; }
  .page { padding: 6px 14px 60px; }
  .pill-label { display: none; }
  .pill-btn { padding: 0 13px; }
}

/* broadcast: pilihan jalur kirim */
.bc-tabs { gap: 8px; }
.bc-tab { border-radius: 999px; }
#bc-msg[readonly] { opacity: .85; cursor: not-allowed; }

/* ---------- Analisis & rekomendasi (gaya dikerjain F&B) ---------- */
.note-text.rich { font-size: 13.5px; line-height: 1.6; color: var(--text-soft); margin-top: 3px; }
.note-text.rich .num-hl { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.note-row.warning .note-text.rich .num-hl { color: var(--warn); }
.note-row.critical .note-text.rich .num-hl { color: var(--bad); }
.note-text.rich .hl { font-weight: 700; color: var(--text); background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 4px; padding: 0 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.note-row.warning .note-text.rich .hl { background: color-mix(in srgb, var(--warn) 20%, transparent); }
.note-row.critical .note-text.rich .hl { background: color-mix(in srgb, var(--bad) 20%, transparent); }
.note-row:has(.note-text.rich) .area { color: var(--text); font-size: 11.5px; }
.note-row.warning:has(.note-text.rich) .area { color: var(--warn); }
.note-row.critical:has(.note-text.rich) .area { color: var(--bad); }

/* Kartu analisis & rekomendasi (sesuai desain FigCraft): kotak berwarna, judul tebal berwarna, isi singkat. */
.notes-rich .note-row { cursor: default; border-left: 0; border-radius: 12px; padding: 13px 16px; margin-bottom: 12px; background: color-mix(in srgb, var(--info) 11%, transparent); }
.notes-rich.rec .note-row { background: color-mix(in srgb, var(--ok) 12%, transparent); }
.notes-rich .note-row.warning, .notes-rich.rec .note-row.warning { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.notes-rich .note-row.critical, .notes-rich.rec .note-row.critical { background: color-mix(in srgb, var(--bad) 13%, transparent); }
.notes-rich .note-row .area { font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--info); }
.notes-rich.rec .note-row .area { color: var(--ok); }
.notes-rich .note-row.warning .area, .notes-rich.rec .note-row.warning .area { color: var(--warn); }
.notes-rich .note-row.critical .area, .notes-rich.rec .note-row.critical .area { color: var(--bad); }
.notes-rich .note-text.rich { margin-top: 4px; color: var(--text); }
.notes-rich .note-text.rich .hl { background: none; padding: 0; }
.notes-rich .note-text.rich .num-hl { color: inherit; }

/* ---------- komponen F&B: tabel, KPI detail, grafik, heatmap, kartu rekomendasi ---------- */
.heat-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.heat-legend i { display: inline-block; width: 120px; height: 8px; border-radius: 4px; }
.cmp-pair { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); align-items: start; }
.cmp-card { min-width: 0; }
.cmp-scroll { overflow-x: auto; }
.cmp-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.cmp-svg { display: block; width: 100%; min-width: 480px; height: auto; }
.cmp-axis { font-family: inherit; font-size: 12px; fill: var(--text-muted); }
.cmp-gridline { stroke: var(--border); stroke-width: 1; }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 6px; color: var(--text-soft); font-size: 12px; }
.cmp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cmp-legend i { width: 20px; height: 9px; border-radius: 3px; background: var(--series-color); }
.cmp-legend i.projected { background: repeating-linear-gradient(45deg, var(--series-color), var(--series-color) 3px, transparent 3px, transparent 6px); }
.cmp-note { margin: 10px 0 0; line-height: 1.5; }
.cmp-data { margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.cmp-data summary { cursor: pointer; }
.cmp-data .table-wrap { margin-top: 8px; }
.cmp-data tbody th { text-transform: none; letter-spacing: normal; }
.rc-intro { margin: -4px 0 14px; }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; }
.rc-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.rc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rc-title { font-weight: 700; font-size: 15px; color: var(--text); line-height: 1.3; }
.rc-find { color: var(--text-soft); font-size: 13px; line-height: 1.45; }
.rc-action { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--text); background: var(--accent-soft); border-radius: 10px; padding: 8px 10px; }
.rc-action i { color: var(--accent); margin-top: 3px; font-size: 11px; }
.rc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 2px; }
.rc-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; min-width: 0; }
.rc-stat-v { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-stat-v.ok { color: var(--ok); } .rc-stat-v.bad { color: var(--bad); } .rc-stat-v.warn { color: var(--warn); }
.rc-stat-l { font-size: 11px; color: var(--text-muted); }
.rc-foot { font-size: 12px; color: var(--text-muted); }
.rc-foot summary { cursor: pointer; }
.rc-foot div { margin-top: 6px; line-height: 1.45; }
.rc-list { margin: 0; padding-left: 24px; }
.rc-list-item { padding: 14px 0 14px 6px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.rc-list-item:first-child { padding-top: 0; }
.rc-list-item:last-child { padding-bottom: 0; border-bottom: 0; }
.rc-list-item::marker { color: var(--text-muted); font-weight: 600; }
.rc-list-item > * + * { margin-top: 6px; }
.rc-list .rc-head { justify-content: flex-start; flex-wrap: wrap; }
.rc-list .rc-action { background: none; border-radius: 0; padding: 0; }
.rc-list .rc-stats { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 8px; }
.rc-list .rc-stat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; background: none; border: 0; border-radius: 0; padding: 0; }
.rc-list .rc-stat-l { font-size: 12px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.pg-info { padding: 0 8px; white-space: nowrap; }
.pg-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.pg-btn:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--accent); }
.pg-btn:disabled { opacity: .35; cursor: default; }
.pg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tbl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tbl-filter-wrap { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.tbl-filter { width: auto; min-width: 150px; padding: 6px 10px; font-size: 12.5px; }
.pager[hidden] { display: none; }
.kpi.has-detail { cursor: pointer; position: relative; transition: transform .15s ease, border-color .15s ease; }
.kpi.has-detail:hover { border-color: var(--accent); transform: translateY(-1px); }
.kpi.has-detail:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kd-modal { width: min(940px, 100%); max-height: 92vh; padding: 22px 22px 8px; }
.kd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.kd-val { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin: 2px 0; }
.kd-close { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); cursor: pointer; flex: none; }
.kd-close:hover { background: var(--surface-hover); }
.kd-intro { color: var(--text-soft); line-height: 1.55; margin: 0 0 12px; font-size: 13.5px; }
.kd-steps { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }
.kd-sec { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.kd-steps ol { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.6; color: var(--text-soft); }
.kd-modal .card { background: var(--surface-2); box-shadow: none; margin-bottom: 14px; }

/* kartu rekomendasi: angka proyeksi boleh turun baris, tidak terpotong */
.rc-stats { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.rc-stat-v { white-space: normal; overflow: visible; text-overflow: clip; font-size: 12.5px; }
.rc-list .rc-stat-v { white-space: nowrap; }
/* tren padat (banyak titik): label jarang, nilai lewat tooltip */
.trend.dense .col .lb { font-size: 10px; white-space: nowrap; overflow: visible; }
.trend.dense { gap: 3px; }
.kpi .kpi-go { position: absolute; top: 14px; right: 14px; font-size: 11px; color: var(--text-muted); }
.kpi .kpi-more { margin-top: 8px; font-size: 11px; font-weight: 600; color: var(--accent); }

.heat-c { color: var(--text); }


/* ===== Desain dikerjainAI (dari fnb-marketing) ===== */
/* =====================================================================
   BRAND dikerjainAI — navy #0f1a3d + biru #1f5fff → cyan #12b5ff (warna logo)
   ===================================================================== */
:root {
  --bg: #0a1128; --bg-elev: #111a38; --surface-solid: #111a38; --surface: rgba(17, 26, 56, .78); --surface-2: rgba(32, 46, 92, .45); --surface-hover: rgba(40, 58, 112, .6);
  --border: rgba(190, 205, 255, .12); --border-strong: rgba(190, 205, 255, .24);
  --text: #f1f4ff; --text-soft: #ccd5f5; --text-muted: #94a0c8;
  --accent: #5b8dff; --accent-2: #2bbcff; --accent-soft: rgba(91, 141, 255, .16); --accent-glow: rgba(91, 141, 255, .34);
  --info: #6cc6ff; --on-accent: #fff; --ring: 0 0 0 3px rgba(91, 141, 255, .28);
}
body.theme-light {
  --bg: #f4f7fd; --bg-elev: #fff; --surface-solid: #fff; --surface: rgba(255, 255, 255, .92); --surface-2: #f4f7fd; --surface-hover: #e9efff;
  --border: rgba(15, 26, 61, .09); --border-strong: rgba(15, 26, 61, .18);
  --text: #0f1a3d; --text-soft: #3a4670; --text-muted: #6a7599;
  --accent: #1f5fff; --accent-2: #0aa5f5; --accent-soft: rgba(31, 95, 255, .09); --accent-glow: rgba(31, 95, 255, .28);
  --info: #0a7fc4; --on-accent: #fff; --ring: 0 0 0 3px rgba(31, 95, 255, .18);
  --shadow-md: 0 2px 4px rgba(15, 26, 61, .04), 0 16px 34px -20px rgba(15, 26, 61, .3);
  --shadow-lg: 0 10px 16px rgba(15, 26, 61, .05), 0 38px 64px -30px rgba(15, 26, 61, .34);
}
body {
  background-image:
    radial-gradient(900px 620px at 6% -10%, rgba(43, 188, 255, .10), transparent 62%),
    radial-gradient(820px 560px at 94% -4%, rgba(91, 141, 255, .10), transparent 60%);
}
body.theme-light {
  background-image:
    radial-gradient(900px 620px at 6% -12%, rgba(18, 181, 255, .10), transparent 60%),
    radial-gradient(820px 560px at 96% -6%, rgba(31, 95, 255, .08), transparent 58%);
}
.mpk-m.active { color: #fff; }
.ads-spend .ads-metric-value, .ads-spend .ads-currency, .promo-run .promo-metric:first-child .ads-metric-value {
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.btn.primary { background: linear-gradient(135deg, #2bbcff, #1f5fff); box-shadow: 0 12px 26px -14px rgba(31, 95, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .25); }
.ai-btn, .ai-btn:hover, .ai-btn[aria-pressed="true"] { background: linear-gradient(90deg, #12b5ff, #1f5fff); }
.brand-logo { background: linear-gradient(135deg, #2bbcff, #1f5fff); color: #fff; }

/* ---------- login (brand dikerjainAI) ---------- */
#login { background: radial-gradient(900px 600px at 15% -10%, rgba(18, 181, 255, .16), transparent 60%), radial-gradient(800px 560px at 90% 110%, rgba(31, 95, 255, .16), transparent 60%), var(--bg); }
#login .box { max-width: 400px; padding: 36px 32px 30px; border-radius: 24px; text-align: center; box-shadow: var(--shadow-lg); }
.lg-logo img { height: 46px; width: auto; margin: 0 auto; }
.lg-logo .logo-light-theme { display: none; }
body.theme-light .lg-logo .logo-light-theme { display: block; }
body.theme-light .lg-logo .logo-dark-theme { display: none; }
.lg-title { font-family: 'Geist', system-ui, sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 26px 0 6px; }
.lg-sub { margin: 0 0 4px; font-size: 13px; line-height: 1.55; color: var(--text-muted); }
#login form { text-align: left; gap: 14px; margin-top: 22px; }
#login .lbl { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--text-soft); }
.lg-in { position: relative; }
.lg-in > i:first-child { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--text-muted); pointer-events: none; }
.lg-in .field { width: 100%; height: 46px; padding: 0 44px 0 40px; border-radius: 12px; }
.lg-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; color: var(--text-muted); cursor: pointer; }
.lg-eye:hover { color: var(--accent); background: var(--accent-soft); }
#login .btn.primary { height: 46px; margin-top: 4px; border-radius: 12px; font-size: 14px; font-weight: 700; }
#login form { margin-top: 28px; }

/* judul kartu analisis/rekomendasi harus lebih besar dari isinya */
.notes-rich .note-row:has(.note-text.rich) .area { font-size: 15px; line-height: 1.35; }
.notes-rich .note-text.rich { font-size: 13px; line-height: 1.55; margin-top: 5px; }

/* Kartu Analisis & Rekomendasi: dua warna saja — biru (informasi/saran) dan oranye (perlu perhatian) */
.notes-rich.rec .note-row { background: color-mix(in srgb, var(--info) 11%, transparent); }
.notes-rich .note-row.critical, .notes-rich.rec .note-row.critical { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.notes-rich.rec .note-row .area { color: var(--info); }
.notes-rich .note-row.critical .area, .notes-rich.rec .note-row.critical .area { color: var(--warn); }
.notes-rich .note-row:has(.note-text.rich) .area, .notes-rich.rec .note-row:has(.note-text.rich) .area { color: var(--info); }
.notes-rich .note-row.warning:has(.note-text.rich) .area, .notes-rich.rec .note-row.warning:has(.note-text.rich) .area, .notes-rich .note-row.critical:has(.note-text.rich) .area, .notes-rich.rec .note-row.critical:has(.note-text.rich) .area { color: var(--warn); }

/* Kartu analisis AI: sesuai desain FigCraft */
.card.notes-rich { background: linear-gradient(155deg, color-mix(in srgb, var(--info) 8%, var(--surface-card, var(--surface))) 0%, var(--surface-card, var(--surface)) 60%); border: 1.5px solid transparent; border-radius: 22px; padding: 18px; background-clip: padding-box, border-box; background-origin: border-box; position: relative; }
.card.notes-rich::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: linear-gradient(180deg, var(--accent-2, #0aa5f5), var(--accent, #1f5fff)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.ai-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ai-head .sec-title { margin: 0; font-size: 15px; flex: 1; }
.ai-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; background: linear-gradient(180deg, var(--accent-2, #0aa5f5), var(--accent, #1f5fff)); flex: none; }
.ai-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 700; color: #fff; background: linear-gradient(180deg, var(--info), var(--accent, #1f5fff)); white-space: nowrap; }
.ai-sync { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 11.5px; color: var(--text-muted); }
.ai-sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.ai-sync-txt { flex: 1; }
.ai-refresh { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-card, var(--surface)); color: var(--accent, #1f5fff); font: 600 11.5px inherit; font-family: inherit; cursor: pointer; white-space: nowrap; }
.ai-refresh:hover { background: var(--surface-hover); }
.ai-refresh:disabled { opacity: .7; cursor: default; }
.ai-refresh.spin i { animation: ai-spin 0.8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (max-width: 520px) { .ai-badge { display: none; } .ai-sync { flex-wrap: wrap; } }

/* Grafik Ads spend & CPR: chip rata-rata */
.cmp-legend .cmp-avg { padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--info) 11%, transparent); color: var(--text); font-size: 12px; }
.cmp-legend .cmp-avg.first { margin-left: auto; }
.cmp-legend .cmp-avg i { width: 16px; height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--series-color); }
.cmp-legend .cmp-avg b { font-weight: 700; }

/* Hover grafik Ads spend & CPR */
.cmp-card .cmp-scroll { position: relative; }
.cmp-hover { cursor: crosshair; }
.cmp-hover.on { fill: var(--info); fill-opacity: .08; }
.cmp-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 170px; padding: 9px 12px; border-radius: 12px; background: var(--surface-card, var(--surface)); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(15, 26, 61, .18); font-size: 12px; color: var(--text); }
.cmp-tip[hidden] { display: none; }
.cmp-tip b { display: block; margin-bottom: 6px; font-size: 12.5px; }
.cmp-tip div { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.cmp-tip div i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cmp-tip div span { flex: 1; color: var(--text-soft); }
.cmp-tip div em { font-style: normal; font-weight: 700; }

/* Judul grafik: nama + rentang waktu terpisah */
.cmp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cmp-head .sec-title { margin: 0; }
.cmp-range { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); background: color-mix(in srgb, var(--text-muted) 12%, transparent); }
.cmp-axis.cmp-year { font-weight: 700; fill: var(--text-soft); }
.cmp-card[data-tip] .cmp-axis { font-size: 10.5px; }
.cmp-card[data-tip] .cmp-axis.cmp-year { font-size: 11px; }

/* Hierarki judul: judul halaman besar (serif), judul bagian sedang (sans tebal), keterangan kecil */
#page-title { font-size: 30px; font-weight: 600; line-height: 1.15; }
.sec-title, .spec-mkt_ads_sales .sec-title, .spec-mkt_promo_tracker .sec-title, .ai-head .sec-title { font-family: 'Geist', system-ui, -apple-system, sans-serif; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }

/* Ringkasan Ads Tracker: satu kartu, dua baris (Bulanan/Tahunan) */
.as-card { display: block; padding: 4px 24px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-md); margin-bottom: 22px; }
.as-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: start; padding: 22px 0; }
.as-row + .as-row { border-top: 1px solid var(--border); }
.as-period { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.as-period h3 { font-size: 15px; }
.as-date { padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--info) 11%, transparent); color: var(--accent); font-size: 12px; font-weight: 600; }
.as-ctx { color: var(--text-muted); font-size: 11px; }
.as-kpis { display: grid; grid-template-columns: 1.15fr 1fr 1fr; min-width: 0; }
.as-kpi { min-width: 0; padding: 0 22px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.as-label { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.as-label i { font-size: 11px; }
.as-low { color: var(--accent); } .as-high { color: var(--warn); }
.as-value { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.as-cur { color: var(--text-muted); font-size: 16px; font-weight: 600; }
.as-num { font-size: 32px; line-height: 1.15; }
.as-spend .as-num, .as-spend .as-cur { color: var(--accent); }
.as-sub { color: var(--text-muted); font-size: 12px; }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.as-chips span { padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text-soft); font-size: 11px; font-weight: 500; }
.as-campaign { color: var(--text); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
@media (max-width: 1000px) {
  .as-row { grid-template-columns: 1fr; gap: 16px; }
  .as-period { flex-direction: row; align-items: center; flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .as-card { padding: 4px 16px; }
  .as-kpis { grid-template-columns: 1fr; }
  .as-kpi { border-left: 0; border-top: 1px solid var(--border); padding: 14px 0; }
  .as-kpi:first-child { border-top: 0; padding-top: 0; }
  .as-num { font-size: 28px; }
}

/* Tabel Cost per Result: 5 kolom, keterangan di bawah nama, batang CPR */
.cpr-scroll { overflow-x: auto; }
.cpr-table { min-width: 640px; }
.cpr-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 130px 130px 240px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cpr-row:last-child { border-bottom: 0; }
.cpr-hd { padding: 0 0 10px; color: var(--text-muted); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cpr-rank { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.cpr-hd .cpr-rank { font-size: 10.5px; font-weight: 700; }
.cpr-camp { min-width: 0; }
.cpr-name { color: var(--text); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpr-meta { margin-top: 3px; color: var(--text-muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpr-n { text-align: right; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); padding-left: 8px; }
.cpr-hd .cpr-n { font-weight: 700; color: var(--text-muted); }
.cpr-cost { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.cpr-cost b { min-width: 56px; text-align: right; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.cpr-hd .cpr-cost { font-weight: 700; color: var(--text-muted); }
.cpr-bar { width: 120px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--info) 14%, transparent); overflow: hidden; flex: none; }
.cpr-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.cpr-card { padding-bottom: 8px; }
.cpr-fr .cpr-row { grid-template-columns: 36px minmax(0, 1fr) 120px 110px 90px 240px; }
.cpr-fr .cpr-table { min-width: 760px; }
.cpr-abbr { color: var(--text-muted); font-weight: 600; }
.as-kpis.as-even { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.promo-summary.as-card { display: block; gap: 0; }
@media (max-width: 700px) { .as-kpis.as-even { grid-template-columns: 1fr; } }
.cpr-om .cpr-row { grid-template-columns: 36px minmax(0, 1fr) 130px 96px 280px; }
.cpr-pct { color: var(--text-muted); font-weight: 600; }
.cpr-hd .cpr-pct { font-weight: 700; }
.cpr-om .cpr-cost { padding-left: 40px; }
.cpr-om .cpr-cost b.cpr-wide { min-width: 100px; }
.cpr-n.cpr-warn { color: var(--warn); }
.cpr-om .cpr-table { min-width: 640px; }
.cpr-hd > span { white-space: nowrap; }
.cpr-hd > span, .cpr-hd .cpr-n, .cpr-hd .cpr-cost, .cpr-hd .cpr-pct { font-size: 10.5px; font-weight: 700; }
/* Tabel Cost per Result / Omzet: semua teks satu ukuran (13px) */
.cpr-card .cpr-hd, .cpr-card .cpr-hd > *, .cpr-card .cpr-hd .cpr-n, .cpr-card .cpr-hd .cpr-cost, .cpr-card .cpr-hd .cpr-pct, .cpr-card .cpr-hd .cpr-rank,
.cpr-card .cpr-rank, .cpr-card .cpr-name, .cpr-card .cpr-meta, .cpr-card .cpr-n, .cpr-card .cpr-cost b { font-size: 13px; }
.cpr-card .cpr-hd { letter-spacing: .04em; }
/* Tanpa batang: kolom angka terakhir lebih sempit */
.cpr-row { grid-template-columns: 36px minmax(0, 1fr) 130px 130px 150px; }
.cpr-fr .cpr-row { grid-template-columns: 36px minmax(0, 1fr) 120px 110px 90px 150px; }
.cpr-om .cpr-row { grid-template-columns: 36px minmax(0, 1fr) 130px 96px 150px; }
.cpr-om .cpr-cost { padding-left: 0; }
.cpr-table, .cpr-fr .cpr-table, .cpr-om .cpr-table { min-width: 560px; }
.cpr-bar { display: none; }
.cpr-row { grid-template-columns: 36px minmax(0, 1fr) 130px 130px 190px; }
.cpr-fr .cpr-row { grid-template-columns: 36px minmax(0, 1fr) 120px 110px 90px 190px; }
/* Tooltip diskon besar */
.cpr-warn[data-tip] { position: relative; cursor: help; outline: none; }
.cpr-warn[data-tip]::after { content: attr(data-tip); position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 6; width: max-content; max-width: 240px; padding: 8px 12px; border-radius: 10px; background: var(--surface-card, var(--surface)); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(15, 26, 61, .18); color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.4; text-align: left; white-space: normal; opacity: 0; transform: translateY(2px); pointer-events: none; transition: opacity .12s, transform .12s; }
.cpr-warn[data-tip]:hover::after, .cpr-warn[data-tip]:focus-visible::after { opacity: 1; transform: none; }
.cpr-tx .cpr-row { grid-template-columns: 36px minmax(0, 1fr) 130px 130px 96px 150px; }
.cpr-tx .cpr-table { min-width: 700px; }
.cpr-up .cpr-row { grid-template-columns: 36px minmax(0, 1fr) 210px 100px 150px; }
.cpr-up .cpr-table { min-width: 680px; }
.cpr-gain { color: var(--accent); font-weight: 600; }
.cpr-up .cpr-hd .cpr-n { color: var(--text-muted); }




/* KPI satu kartu: jumlah kolom mengikuti banyak KPI */
.as-flat.as-auto { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); row-gap: 22px; padding: 22px 0; }
.as-flat.as-auto .as-kpi { padding: 0 22px; border-left: 1px solid var(--border); }
.as-flat.as-auto .as-kpi:first-child { padding-left: 0; border-left: 0; }
.as-flat.as-auto .as-kpi.has-detail:hover .as-num { color: var(--accent); }
.as-label i { font-size: 9px; opacity: .6; }

.as-flat { display: grid; }
.as-flat .as-kpi { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
@media (max-width: 700px) {
  .as-flat.as-auto { grid-template-columns: 1fr; row-gap: 0; padding: 6px 0; }
  .as-flat.as-auto .as-kpi { border-left: 0; padding: 16px 0; border-top: 1px solid var(--border); }
  .as-flat.as-auto .as-kpi:first-child { border-top: 0; }
}

/* Tabel gaya fnb-marketing: tanpa latar header, baris lega, pemisah tipis */
.tbl-card { padding-bottom: 8px; }
.tbl-card .tbl-head { align-items: center; margin-bottom: 12px; }
.tbl-card .tbl-head .tbl-filter-wrap { margin-left: auto; }
.tbl-card table { border-collapse: collapse; font-size: 13px; }
.tbl-card th { background: none; border-radius: 0; padding: 0 12px 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.tbl-card th:first-child, .tbl-card td:first-child { padding-left: 0; }
.tbl-card th:last-child, .tbl-card td:last-child { padding-right: 0; }
.tbl-card td { padding: 14px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.tbl-card tbody tr:last-child td { border-bottom: 0; }
.tbl-card td:first-child { color: var(--text); font-weight: 600; }
.tbl-card td.r, .tbl-card td.mono { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--text); }
.tbl-card tr:hover td { background: transparent; }
.tbl-card tbody tr:hover td:first-child { color: var(--accent); }
.tbl-card .pager { padding: 12px 0 6px; border-top: 1px solid var(--border); margin-top: 0; }
.tbl-card td:first-child { white-space: nowrap; }
.tbl-card td { padding: 12px 12px; }

.tbl-card td { white-space: nowrap; }
.tbl-card td.wrap { white-space: normal; min-width: 260px; line-height: 1.45; }

/* Nomor urut & keterangan di bawah kolom pertama */
.tbl-card th.rk, .tbl-card td.rk { width: 36px; padding-left: 0; padding-right: 8px; color: var(--text-muted); font-weight: 600; text-align: left; }
.tbl-card td.rk { font-variant-numeric: tabular-nums; }
.tbl-card th.rk + th, .tbl-card td.rk + td { padding-left: 0; }
.tbl-card td.has-meta .cpr-meta { margin-top: 3px; font-size: 11.5px; font-weight: 400; color: var(--text-muted); }
.tbl-card td.rk + td { color: var(--text); font-weight: 600; white-space: nowrap; }
.tbl-card tbody tr:hover td.rk + td { color: var(--accent); }

/* Analisis & Rekomendasi berdampingan; tinggi mengikuti isi masing-masing */
.grid.two.cmp-pair { align-items: start; }
.grid.two.cmp-pair > .card { margin-bottom: 0; }

/* Pemilih bulan popup (dari fnb-marketing) */
.drp-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.drp-trigger:hover { background: var(--surface-hover); }
.drp-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.drp-trigger i { color: var(--accent); }
.ofl-wrap { position: relative; }
.ofl-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 75; min-width: 220px; padding: 6px;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow-lg), 0 24px 60px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; gap: 2px;
}
.ofl-pop[hidden] { display: none; }
.ofl-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: 0; border-radius: 10px; padding: 9px 10px;
  color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.ofl-item i:first-child { width: 14px; text-align: center; color: var(--text-muted); font-size: 12px; }
.ofl-item:hover { background: var(--surface-hover); }
.ofl-item.active { background: var(--accent-soft); color: var(--accent); }
.ofl-item.active i:first-child { color: var(--accent); }
.ofl-item span { flex: 1; }
.ofl-check { visibility: hidden; font-size: 11px; color: var(--accent); }
.ofl-item.active .ofl-check { visibility: visible; }
.drp-trigger[aria-expanded="true"] i.fa-chevron-down { transform: rotate(180deg); }
.drp-trigger i.fa-chevron-down { transition: transform .15s; }


/* ---- Pemilih bulan ---- */
.mpk-pop { min-width: 252px; padding: 12px; gap: 10px; }
.mpk-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px; }
.mpk-head b { font-size: 14px; letter-spacing: .02em; }
.mpk-nav { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft); cursor: pointer; font-size: 11px; }
.mpk-nav:hover { background: var(--surface-hover); color: var(--text); }
.mpk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mpk-m { padding: 10px 0; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.mpk-m:hover:not(:disabled) { background: var(--surface-hover); }
.mpk-m.now:not(.active) { border-color: var(--border-strong); }
.mpk-m.active { background: var(--accent); color: var(--on-accent, #12201c); font-weight: 800; }
.mpk-m:disabled { opacity: .32; cursor: not-allowed; }
.mpk-foot { display: flex; justify-content: flex-end; padding: 2px 4px 0; border-top: 1px solid var(--border); padding-top: 8px; }
.mpk-link { background: none; border: 0; color: var(--accent); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.mpk-link:hover { text-decoration: underline; }
.mpk-foot { justify-content: space-between; }
.mpk-link.active { text-decoration: underline; }
.mpk-m.active { color: #fff; }

/* Grafik Ads spend & CPR: chip rata-rata */
.cmp-legend .cmp-avg { padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--info) 11%, transparent); color: var(--text); font-size: 12px; }
.cmp-legend .cmp-avg.first { margin-left: auto; }
.cmp-legend .cmp-avg i { width: 16px; height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--series-color); }
.cmp-legend .cmp-avg b { font-weight: 700; }

/* Hover grafik Ads spend & CPR */
.cmp-card .cmp-scroll { position: relative; }
.cmp-hover { cursor: crosshair; }
.cmp-hover.on { fill: var(--info); fill-opacity: .08; }
.cmp-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 170px; padding: 9px 12px; border-radius: 12px; background: var(--surface-card, var(--surface)); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(15, 26, 61, .18); font-size: 12px; color: var(--text); }
.cmp-tip[hidden] { display: none; }
.cmp-tip b { display: block; margin-bottom: 6px; font-size: 12.5px; }
.cmp-tip div { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.cmp-tip div i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cmp-tip div span { flex: 1; color: var(--text-soft); }
.cmp-tip div em { font-style: normal; font-weight: 700; }

/* Judul grafik: nama + rentang waktu terpisah */
.cmp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cmp-head .sec-title { margin: 0; }
.cmp-range { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); background: color-mix(in srgb, var(--text-muted) 12%, transparent); }
.cmp-axis.cmp-year { font-weight: 700; fill: var(--text-soft); }
.cmp-card[data-tip] .cmp-axis { font-size: 10.5px; }
.cmp-card[data-tip] .cmp-axis.cmp-year { font-size: 11px; }



#page-sub:empty { display: none; }
/* Nama baris pertama di tabel: satu baris, dipotong dengan titik-titik */
.tbl-card td.has-meta, .tbl-card td.rk + td { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.tbl-card td.has-meta .cpr-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pencarian tabel */
.tbl-search { margin-left: auto; display: flex; align-items: center; gap: 8px; width: 280px; max-width: 100%; padding: 7px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text-muted); }
.tbl-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; }
.tbl-search:focus-within { border-color: var(--accent); }
.tbl-search + .tbl-filter-wrap { margin-left: 0 !important; }
.tbl-card .tbl-head { flex-wrap: wrap; gap: 10px; }

/* Garis rata-rata di grafik batang tren */
.trend .bars { position: relative; }
.trend .avg-ln { position: absolute; left: -6px; right: -6px; height: 0; border-top: 2px dashed var(--info); opacity: .9; pointer-events: auto; z-index: 2; }
.trend.dense .avg-ln { left: -2px; right: -2px; }
.card > .cmp-legend { margin-top: 12px; }
.avg-note { font-style: normal; font-size: 11px; color: var(--text-muted); margin-left: 4px; }

.trend .avg-ln.b2 { border-top-color: var(--ok); border-top-style: dotted; }
.cmp-legend .avg-note { align-self: center; margin-left: 4px; }

/* Performa scroll: blur latar per kartu sangat berat saat banyak kartu; kartu sudah hampir solid, jadi blur dibuang */
.card { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; transition: border-color .2s ease, box-shadow .2s ease; }
body { background-attachment: scroll; }
.card .table-wrap, .cmp-scroll { contain: layout paint; }

.ai-input-foot { justify-content: flex-end; }

/* Indikator naik/turun di sisi kanan baris label KPI (keterangan pembanding ada di tooltip) */
/* Dua kolom tetap: label di kiri (boleh turun baris), chip di kanan — tidak mungkin saling menimpa */
.as-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px 8px; }
.as-top > .as-label { min-width: 0; overflow-wrap: anywhere; align-items: flex-start; }
.as-top > .as-delta { margin-left: 0; justify-self: end; }
.as-top:not(:has(.as-delta)) { grid-template-columns: minmax(0, 1fr); }
.as-delta { margin-left: auto; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; line-height: 1.5; white-space: nowrap; cursor: help;
  color: var(--text-muted); background: color-mix(in srgb, var(--text-muted) 14%, transparent); }
.as-delta.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); }
.as-delta.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }

/* Atribut hidden harus menang atas display:flex/grid pada bilah filter */
.toolbar[hidden], .ofl-wrap[hidden], #branch-bar[hidden], #f-period-wrap[hidden] { display: none !important; }

/* ---- Konfigurasi AI: tab segmented + filter karyawan dropdown + isian seragam ---- */
.cfg-head { align-items: center; gap: 12px; margin-bottom: 4px; }
.seg-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg-tabs::-webkit-scrollbar { display: none; }
.seg-tab { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; color: var(--text-soft); font: inherit; font-size: 13.5px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.seg-tab i { font-size: 12px; color: var(--text-muted); }
.seg-tab:hover:not(.on) { background: var(--surface-hover); color: var(--text); }
.seg-tab.on { background: var(--accent); color: #fff; box-shadow: 0 8px 18px -10px var(--accent-glow, rgba(31, 95, 255, .6)); }
.seg-tab.on i { color: #fff; }
.cfg-pdd-pop { left: auto; right: 0; min-width: 210px; }
.cfg-head .drp-trigger .cfg-av.sm { width: 22px; height: 22px; }
#view .cfg-field .field, #view .cfg-row .field, #view .cfg-row select { height: 36px; font-size: 13px; }
#view .card .row-between .pill { padding: 3px 11px; font-size: 11.5px; }
@media (max-width: 700px) { .cfg-head { flex-direction: column; align-items: stretch; } .cfg-head .ofl-wrap { align-self: flex-start; } .cfg-pdd-pop { left: 0; right: auto; } }
@media (max-width: 700px) {
  .seg-tabs { display: grid; grid-template-columns: repeat(2, 1fr); overflow: visible; }
  .seg-tab { justify-content: center; padding: 0 10px; }
}

/* Kotak tanya asisten AI: font sama dengan aplikasi, tinggi lega, tanpa cincin fokus ganda */
textarea { font-family: inherit; }
.ai-input-card { padding: 14px 16px 12px; }
.ai-input-card textarea { font-family: inherit; font-size: 15px; line-height: 1.55; min-height: 64px; max-height: 180px; padding: 2px 4px; box-shadow: none !important; border: 0 !important; outline: 0 !important; }
.ai-input-card textarea::placeholder { color: var(--text-muted); opacity: .8; }

/* Pil/lencana: teks selalu di tengah, tinggi mengikuti isi (tidak ikut ditarik baris induk) */
.pill { display: inline-flex; align-items: center; justify-content: center; align-self: center; line-height: 1.5; white-space: nowrap; }

/* Grup WhatsApp: catatan sistem di simulator & nama pengirim */
.wa-sys { align-self: center; margin: 6px 0; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--text-muted) 14%, transparent); color: var(--text-muted); font-size: 11.5px; font-weight: 600; text-align: center; }
.wa-who { display: block; margin-bottom: 2px; font-size: 11px; opacity: .75; }

/* ---- Menu akun di dasar sidebar (tampil/sembunyi) ---- */
.side-foot { gap: 0; }
.um-wrap { position: relative; }
.user-btn { width: 100%; align-items: center !important; border: 0; border-radius: 12px; cursor: pointer; color: var(--text); font: inherit; padding: 8px 10px !important; transition: background .15s; }
.user-btn:hover, .user-btn[aria-expanded="true"] { background: var(--surface-hover); }
.user-btn.has-active .av { background: var(--accent); color: var(--on-accent, #fff); }
.um-chev { color: var(--text-muted); font-size: 11px; transition: transform .15s; }
.user-btn[aria-expanded="true"] .um-chev { transform: rotate(180deg); }
.um-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 80; padding: 6px; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-lg), 0 24px 60px rgba(0, 0, 0, .35); }
.um-pop[hidden] { display: none; }
.um-head { padding: 8px 10px 8px; display: flex; flex-direction: column; gap: 1px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.um-head b { font-size: 13px; } .um-head span { font-size: 11.5px; color: var(--text-muted); }
.um-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--text-soft); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.um-item i { width: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.um-item:hover { background: var(--surface-hover); color: var(--text); }
.um-item.active { background: var(--accent-soft); color: var(--accent); } .um-item.active i { color: var(--accent); }
.um-item.danger:hover { color: var(--bad); } .um-item.danger:hover i { color: var(--bad); }
.um-sep { height: 1px; background: var(--border); margin: 4px 2px; }

/* Angka KPI sejajar antar kartu pada satu baris: tiap kartu memakai 3 baris grid induk (label, angka, keterangan) */
.as-flat.as-auto { row-gap: 0; padding-bottom: 2px; }
.as-flat.as-auto .as-kpi { display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: 6px; padding-bottom: 20px; align-content: start; }
.as-flat.as-auto .as-kpi > .as-sub { align-self: start; }

/* ---- Tombol "Tanya AI" di card & chip konteks di panel AI ---- */
.card.has-ask, .as-card.has-ask { position: relative; }
.ai-ask { position: absolute; top: 12px; right: 12px; z-index: 3; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-size: 13px; cursor: pointer; opacity: .75; transition: opacity .15s, background .15s, transform .15s; }
.card:hover > .ai-ask, .as-card:hover > .ai-ask, .ai-ask:focus-visible { opacity: 1; }
.ai-ask:hover { background: var(--accent); color: var(--on-accent, #fff); transform: translateY(-1px); }
.card.has-ask > .cmp-head, .card.has-ask > .tbl-head, .card.has-ask > h3.sec-title, .card.has-ask > .ai-head { padding-right: 42px; }
.as-card.has-ask > .ai-ask { top: auto; bottom: 12px; }
.ai-ctx { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 6px 6px 6px 12px; border-radius: 12px; font-size: 12.5px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.ai-ctx[hidden] { display: none; }
.ai-ctx > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-ctx button { width: 24px; height: 24px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.ai-ctx button:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }

.ai-auto-note { margin: 8px auto 0; max-width: 300px; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); text-align: center; }

/* Kartu sektor tanpa teks bawah: judul tepat di tengah, tinggi kartu lebih ringkas */
.sector-head { min-height: 52px; }
.sector-head .sector-title { display: block; }

/* Kolom KPI diatur script (--cols) supaya seimbang; garis pemisah mengikuti baris/kolom sebenarnya */
.as-flat.as-auto { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.as-flat.as-auto .as-kpi.row-start { border-left: 0; padding-left: 0; }
.as-flat.as-auto .as-kpi.row-next { border-top: 1px solid var(--border); padding-top: 18px; }
@media (max-width: 700px) { .as-flat.as-auto { grid-template-columns: 1fr; } }

/* Garis rata-rata tren: setiap kolom harus punya tinggi area batang yang sama (label/nilai kosong tetap menyisakan ruang),
   kalau tidak potongan garis tiap kolom bergeser dan tampak bergelombang. */
.trend .lb, .trend .v { min-height: 14px; line-height: 14px; }

/* Batang proyeksi: hanya garis tepi (tanpa arsiran) */
.trend .b.proj { box-sizing: border-box; background: transparent; opacity: 1; border: 2px dashed var(--accent); border-bottom: 0; }
.cmp-legend i.projected { box-sizing: border-box; background: transparent; border: 2px dashed var(--series-color); }

/* Hover grafik tren: kolom disorot, batang proyeksi terisi tipis, tooltip kustom */
.trend .col { border-radius: 8px; transition: background .12s; }
.trend .col:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.trend .col:hover .b { opacity: 1; filter: brightness(1.06); }
.trend .col:hover .b.proj { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.trend-tip { z-index: 60; min-width: 150px; }
.trend-tip .tip-badge { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 10.5px; font-weight: 700; vertical-align: 1px; }

/* Grafik tren dua seri: warna sama dengan grafik perbandingan (seri 1 biru utama, seri 2 biru muda; tanpa hijau) */
.trend .b.b2 { background: var(--info); opacity: .75; }
.trend.two .avg-ln { border-top-color: var(--accent); border-top-style: dotted; }
.trend.two .avg-ln.b2 { border-top-color: var(--info); border-top-style: dashed; }

/* Grafik gaya dashboard: tanpa angka sumbu/garis kisi, batang membulat bergradasi, nilai di atas batang */
.cmp-base { stroke: var(--border); stroke-width: 1; }
.cmp-val { font-size: 11px; font-weight: 700; fill: var(--text); }
.cmp-axis { font-size: 11px; }
.cmp-legend span:not(.cmp-avg):not(.avg-note) i:not([style*="height"]) { width: 10px; height: 10px; border-radius: 50%; }
.cmp-hover.on { fill: color-mix(in srgb, var(--accent) 7%, transparent); }
.cmp-svg line[stroke-dasharray] { opacity: .65; }

/* Border kartu AI: gradasi satu keluarga biru → cyan → ungu muda (tanpa oranye, supaya tidak bentrok dengan warna peringatan) */
.card.notes-rich::after { background: linear-gradient(135deg, #0aa5f5 0%, #3d6bff 55%, #8b6cf6 100%); }
