/* 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: 'Plus Jakarta Sans', 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: 'Fraunces', 'Iowan Old Style', Georgia, serif; font-weight: 600; letter-spacing: -.012em; margin: 0; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
[hidden], .hidden { display: none !important; }
.daily-range-wrap { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Date Range Picker (Dual Month + Presets) ---------- */
.drp-wrap { position: relative; }
.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); }

.drp-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 75;
  display: flex;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow-lg), 0 24px 60px rgba(0, 0, 0, 0.45);
  color: var(--text);
  overflow: hidden;
  user-select: none;
}
.drp-popover[hidden] { display: none !important; }

/* Sidebar Presets */
.drp-sidebar {
  width: 155px;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  padding: 16px 10px;
  flex-shrink: 0;
}
.drp-presets { display: flex; flex-direction: column; gap: 3px; }
.drp-preset-item {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.drp-preset-item:hover {
  background: var(--surface-hover);
}
.drp-preset-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}
.drp-preset-item.active {
  background: var(--accent-soft) !important;
}
.drp-preset-item.active .drp-preset-label {
  color: var(--accent) !important;
  font-weight: 700;
}

/* Main Panel */
.drp-main {
  padding: 18px 22px 16px;
  display: flex;
  flex-direction: column;
}
.drp-calendars-row {
  display: flex;
  gap: 20px;
}
.drp-divider {
  width: 1px;
  background: var(--border);
  margin: 4px 0;
}
.drp-month-col {
  width: 252px;
  display: flex;
  flex-direction: column;
}
.drp-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 10px;
}
.drp-month-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}
.drp-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  transition: background .12s, color .12s;
}
.drp-nav-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.drp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 0 8px;
}
.drp-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 2px;
}
.drp-cell {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.drp-cell-num {
  position: relative;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background .12s, color .12s;
}
.drp-cell:hover .drp-cell-num {
  background: var(--surface-hover);
}
.drp-cell.other-month {
  color: var(--text-muted);
  opacity: .45;
}

/* Range Highlighting */
.drp-cell.is-start .drp-cell-num,
.drp-cell.is-end .drp-cell-num {
  background: var(--accent) !important;
  color: var(--on-accent) !important;
  font-weight: 700;
  box-shadow: 0 4px 12px -2px var(--accent-glow);
}
.drp-cell.is-start:not(.is-end)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 50%;
  background: var(--accent-soft);
  z-index: 1;
}

.drp-cell.is-end:not(.is-start)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50%;
  background: var(--accent-soft);
  z-index: 1;
}

.drp-cell.in-range,
.drp-cell.in-hover-range {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.drp-preset-item.custom-divider {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.drp-cell.in-range.col-mon {
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
}
.drp-cell.in-range.col-sun {
  border-top-right-radius: 18px;
  border-bottom-right-radius: 18px;
}

/* Today Outline (Day 15 in image) */
.drp-cell.is-today:not(.is-start):not(.is-end):not(.in-range) .drp-cell-num {
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* Footer Bar */
.drp-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
}
.drp-inputs-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.drp-date-box {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text);
  min-width: 116px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.drp-date-box:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.drp-date-box.active {
  border: 1.5px solid var(--accent);
  box-shadow: var(--ring);
}
.drp-dash {
  color: var(--text-muted);
  font-weight: 600;
}

@media (max-width: 820px) {
  .drp-popover {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(96vw, 760px);
    max-height: 90vh;
    overflow-y: auto;
    flex-direction: column;
  }
  .drp-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px;
  }
  .drp-presets {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .drp-preset-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 12px;
    white-space: nowrap;
    border: 1px solid var(--border);
  }
  .drp-calendars-row {
    flex-direction: column;
  }
  .drp-month-col {
    width: 100%;
  }
  .drp-divider {
    display: none;
  }
}

/* ---------- 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: Fraunces, Georgia, 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; }
}

/* ikon informasi "cara menghitung" di judul halaman */
.info-btn { border: 0; background: none; color: var(--text-muted); cursor: pointer; padding: 2px 4px; font-size: 15px; vertical-align: middle; border-radius: 50%; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--accent); }
.info-btn:focus-visible { outline: 2px solid var(--ring); }
.page-head > div:first-child { position: relative; }
.info-pop { position: absolute; z-index: 40; top: 100%; left: 0; margin-top: 8px; width: min(520px, calc(100vw - 32px)); background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 16px; font-size: 13px; line-height: 1.5; }
.info-pop ol { margin: 0; padding-left: 20px; } .info-pop ol li { margin: 3px 0; } .info-pop ul { margin: 4px 0 0; padding-left: 18px; }


/* ---- Filter cabang (dropdown selaras dengan pemilih tanggal) ---- */
.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; }

/* ---- Filter tahun di dalam kartu grafik ---- */
.card.has-pop { z-index: 6; }
.yf-head { align-items: flex-start; }
.yf-head .sec-title { margin-bottom: 12px; }
.yf-wrap .drp-trigger { padding: 5px 11px; font-size: 12px; }
.yf-pop { left: auto; right: 0; min-width: 160px; }


/* ---- Form generik di halaman modul ---- */
.fm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.fm-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-soft); font-weight: 600; }
.fm-field .field { width: 100%; font-weight: 500; color: var(--text); }
.fm-field small { font-weight: 500; font-size: 11px; }
.fm-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.fm-form button:disabled { opacity: .55; cursor: progress; }

/* grafik padat (>14 titik): sembunyikan nilai di atas batang, tampil saat hover */
.trend.dense { gap: 6px; }
.trend.dense .col { position: relative; }
.trend.dense .v { display: none; position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 2px 6px; border-radius: 6px; background: var(--text, #222); color: #fff; font-size: 10.5px; pointer-events: none; }
.trend.dense .col:hover .v { display: block; }
.trend.dense .lb { font-size: 10px; }

/* sub-grup menu di sidebar (marketing) */
.nav-group { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); padding: 10px 10px 3px; }
.nav-group:first-child { padding-top: 2px; }

/* kotak masuk omnichannel */
.chat-log { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--surface-hover); border-radius: 12px; margin: 10px 0; }
.chat-log .cb { max-width: 78%; padding: 8px 12px; border-radius: 14px; background: var(--surface, #fff); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.chat-log .cb.out { align-self: flex-end; background: var(--accent-soft); }
.chat-log .cb-t { font-size: 13.5px; line-height: 1.45; word-wrap: break-word; }
.chat-log .cb-m { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }
.chat-draft { border: 1px dashed var(--accent); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.chat-form { display: flex; flex-direction: column; gap: 6px; }
.chat-form textarea, .fm-field textarea { width: 100%; resize: vertical; font: inherit; }

/* heatmap jam × hari */
table.heat { border-collapse: separate; border-spacing: 2px; }
table.heat th.heat-h { text-align: center; padding: 4px 2px; font-size: 11px; min-width: 34px; }
table.heat td.heat-c { text-align: center; padding: 6px 2px; font-size: 11px; border-radius: 4px; min-width: 34px; border: 0; }
table.heat td.heat-l { white-space: nowrap; padding-right: 10px; border: 0; font-weight: 600; }
.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; }

/* grafik perbandingan */
.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; }

/* kartu rekomendasi */
.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; }

/* rekomendasi heatmap dalam daftar bernomor */
.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; }
/* grafik dua seri: warna seri kedua jelas berbeda; batang proyeksi bergaris */
.trend .b.b2 { background: linear-gradient(180deg, var(--info), color-mix(in srgb, var(--info) 55%, transparent)); }
.trend .b.proj { background: repeating-linear-gradient(45deg, var(--accent), var(--accent) 4px, transparent 4px, transparent 8px); opacity: .7; }

/* pagination tabel */
tbody tr[hidden] { display: none; }
.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; }

/* filter di dalam tabel */
.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; }

/* detail kartu KPI */
.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; }
.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); }
.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; }
body.kd-open { overflow: hidden; }

/* grafik 9–14 batang di layar sempit / jendela detail: nilai muncul saat disentuh/diarahkan agar tidak saling menimpa */
@media (max-width: 760px) {
  .trend.many { gap: 4px; }
  .trend.many .col { position: relative; }
  .trend.many .lb { font-size: 9px; }
  .trend.many .v { display: none; position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 2px 6px; border-radius: 6px; background: var(--text, #222); color: #fff; font-size: 10.5px; pointer-events: none; }
  .trend.many .col:hover .v { display: block; }
}

/* kartu KPI dikelompokkan per baris (mis. bulanan / tahunan), 3 kartu per baris */
.kpi-group { margin-bottom: 14px; }
.kpi-group-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 8px 2px; }
.kpis.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 420px) { .kpis.kpis-3 { grid-template-columns: 1fr; } }

/* Ads Tracker — ringkasan per periode, dengan satuan CPR dan campaign terpisah. */
.ads-summary { container-type: inline-size; display: grid; gap: 18px; margin-bottom: 22px; }
.ads-period { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--hairline); }
.ads-period-head, .ads-period-heading, .ads-metric-head { display: flex; align-items: center; }
.ads-period-head { justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.ads-period-heading { gap: 10px; min-width: 0; flex-wrap: wrap; }
.ads-period-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 9px; color: var(--text-soft); font-size: 13px; }
.ads-period-heading h3 { font: 700 14px 'Plus Jakarta Sans', system-ui, sans-serif; letter-spacing: -.02em; }
.ads-period-date { border: 1px solid var(--border); border-radius: 7px; padding: 5px 9px; background: var(--surface-2); color: var(--text-soft); font-size: 11px; font-weight: 600; line-height: 1.3; }
.ads-period-context { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.ads-metrics { display: grid; grid-template-columns: 1.08fr 1fr 1fr; gap: 12px; }
.ads-metric { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 13px; background: color-mix(in srgb, var(--surface-solid) 65%, transparent); }
.ads-metric-head { justify-content: space-between; gap: 8px; min-height: 24px; color: var(--text-soft); font-size: 11px; font-weight: 600; }
.ads-metric-head > i { color: var(--accent); font-size: 14px; }
.ads-metric-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; margin-top: 12px; color: var(--text); font-size: clamp(25px, 3.9cqi, 37px); font-weight: 700; line-height: 1.15; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.ads-currency { color: var(--text-muted); font-size: .5em; font-weight: 500; letter-spacing: -.01em; }
.ads-spend { border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface-solid)), color-mix(in srgb, var(--accent) 3%, var(--surface-solid))); }
.ads-spend .ads-metric-value, .ads-spend .ads-currency { color: var(--accent); }
.ads-spend-caption, .ads-cpr-unit { margin-top: 7px; font-size: 11px; line-height: 1.5; color: var(--text-muted); }
.ads-spend-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.ads-spend-meta span { padding: 5px 7px; border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 6px; background: color-mix(in srgb, var(--accent) 5%, transparent); color: var(--text-soft); font-size: 10px; line-height: 1.4; }
.ads-cpr-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }
.ads-cpr-low .ads-cpr-icon { color: var(--accent); background: var(--accent-soft); }
.ads-cpr-high .ads-cpr-icon { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.ads-campaign { display: grid; gap: 6px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 16px; }
.ads-campaign-label { color: var(--text-muted); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; font-weight: 600; }
.ads-campaign-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; min-height: 32px; color: var(--text-soft); font-size: 11px; line-height: 1.5; }
.ads-summary-note { display: flex; align-items: baseline; gap: 7px; color: var(--text-muted); font-size: 10px; line-height: 1.6; padding: 0 3px; margin-top: -7px; }
.ads-summary-note i { flex-shrink: 0; }
@container (max-width: 680px) {
  .ads-period { padding: 16px; }
  .ads-period-head { margin-bottom: 14px; }
  .ads-period-context { display: none; }
  .ads-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ads-spend { grid-column: 1 / -1; }
  .ads-spend-meta { margin-top: 14px; }
  .ads-metric-value { font-size: 30px; }
}
@container (max-width: 360px) {
  .ads-metrics { grid-template-columns: 1fr; }
  .ads-period { padding: 12px; }
  .ads-metric { padding: 16px; }
  .ads-campaign-name { min-height: 0; }
}

/* Promo to Sales — dua baris ringkasan (berjalan / selesai), 3 kartu per baris. */
.promo-summary { container-type: inline-size; display: grid; gap: 18px; margin-bottom: 22px; }
.promo-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.promo-metric { min-width: 0; display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--border); border-radius: 13px; background: color-mix(in srgb, var(--surface-solid) 65%, transparent); box-shadow: none; }
.promo-metric.has-detail:hover { border-color: var(--accent); transform: translateY(-1px); }
.promo-run .promo-metric:first-child { border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface-solid)), color-mix(in srgb, var(--accent) 3%, var(--surface-solid))); }
.promo-run .promo-metric:first-child .ads-metric-value, .promo-run .promo-metric:first-child .ads-currency { color: var(--accent); }
.promo-metric .ads-metric-value { font-size: clamp(23px, 3.2cqi, 33px); }
.promo-metric-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-size: 11px; flex-shrink: 0; }
.promo-metric-icon.ok { color: var(--accent); background: var(--accent-soft); }
.promo-metric-icon.muted { color: var(--text-soft); background: var(--surface-2); }
.promo-metric-sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.promo-metric-sub span { padding: 4px 7px; border: 1px solid var(--border); border-radius: 6px; background: color-mix(in srgb, var(--accent) 4%, transparent); color: var(--text-soft); font-size: 10px; line-height: 1.4; }
.promo-metric .kpi-more { margin-top: auto; padding-top: 14px; }
.promo-metric .kpi-more i { font-size: 9px; margin-left: 3px; }
.promo-done .ads-period-icon { color: var(--text-muted); }
@container (max-width: 760px) { .promo-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .promo-metrics .promo-metric:first-child { grid-column: 1 / -1; } }
@container (max-width: 420px) { .promo-metrics { grid-template-columns: 1fr; } .promo-period { padding: 14px; } }

/* Analisis & rekomendasi: poin utama terbaca sekilas. */
.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:hover { background: inherit; }
.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; }

/* Ads Tracker & Promo to Sales — KPI, tabel, grafik sesuai desain FigCraft. */
.spec-wrap { display: contents; }
.ads-metric-head > span:first-child, .promo-metric .ads-metric-head > span:first-child { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ads-spend .ads-metric-head > span:first-child, .promo-t0 .ads-metric-head > span:first-child, .ads-cpr-low .ads-metric-head > span:first-child { color: var(--ok); }
.ads-cpr-high .ads-metric-head > span:first-child { color: var(--bad); }
.promo-t1 .ads-metric-head > span:first-child { color: var(--info); }
.promo-t2 .ads-metric-head > span:first-child { color: var(--warn); }
.spec-mkt_ads_sales table, .spec-mkt_promo_tracker table { font-size: 13px; }
.spec-mkt_ads_sales th, .spec-mkt_promo_tracker th { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 700; color: var(--text-muted); background: var(--surface-2); padding: 10px 12px; }
.spec-mkt_ads_sales td, .spec-mkt_promo_tracker td { padding: 11px 12px; border-bottom: 0; }
.spec-mkt_ads_sales tbody tr:nth-child(even) td, .spec-mkt_promo_tracker tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.spec-mkt_ads_sales .sec-title, .spec-mkt_promo_tracker .sec-title { font-size: 18px; font-weight: 700; }

/* Repo ringkas: lonceng dan chip token tidak dipakai (asisten AI tetap ada). */
.bell-wrap, #token-chip { display: none !important; }
.sector-card.single { margin-bottom: 6px; }
.ai-scope { display: none !important; } /* chip "Baca semua modul" tidak dipakai */
/* Kotak tanya asisten AI: tanpa bingkai ganda saat fokus, tombol kirim di kanan */
.ai-input-card textarea:focus, .ai-input-card textarea:focus-visible { border: 0; box-shadow: none; outline: none; }
.ai-input-foot { justify-content: flex-end; }
/* Teks analisis & rekomendasi maksimal 3 baris (pengaman bila ada teks yang lebih panjang) */
.notes-rich .note-text.rich { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

.mpk-foot { justify-content: space-between; }
.mpk-link.active { text-decoration: underline; }

#page-sub:empty{display:none}

/* =====================================================================
   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: 'Plus Jakarta Sans', 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: 'Plus Jakarta Sans', 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); }

/* Vendor & Bahan */
.as-flat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 26px 0; }
.as-flat .as-kpi:first-child { border-left: 0; padding-left: 0; }
.as-flat .as-kpi:last-child { padding-right: 0; }
.as-dash { color: var(--text-muted); }
.mon-cols { display: grid; grid-template-columns: 1fr 1fr; }
.mon-col { min-width: 0; padding: 0 26px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.mon-col:first-child { border-left: 0; padding-left: 0; }
.mon-col:last-child { padding-right: 0; }
.mon-empty { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.mon-list { display: grid; gap: 12px; }
.mon-row { display: flex; align-items: center; gap: 12px; }
.mon-row .cpr-camp { flex: 1; }
.mon-row .cpr-rank { width: 24px; }
.bpill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.bpill.up { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.bpill.down { color: var(--accent); background: color-mix(in srgb, var(--info) 14%, transparent); }
.bpill.flat { color: var(--text-muted); background: none; }
.cpr-card .cmp-head { margin-bottom: 14px; }
.bhn-row.bhn-p { grid-template-columns: minmax(0, 1fr) 190px 200px 130px; }
.bhn-row.bhn-d { grid-template-columns: minmax(0, 1fr) 190px 230px 130px; }
.bhn-row .cpr-camp .cell-link { color: var(--text); font-weight: 600; text-decoration: none; }
.bhn-row .cpr-camp .cell-link:hover { color: var(--accent); text-decoration: underline; }
.bhn-row .bhn-pill { display: flex; justify-content: flex-end; }
.bhn-row[hidden] { display: none; }
.bhn-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); }
.bhn-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; }
.bhn-search:focus-within { border-color: var(--accent); }
.bhn-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; color: var(--text-muted); font-size: 13px; flex-wrap: wrap; }
.bhn-pager { display: flex; gap: 6px; align-items: center; }
.bhn-pg { padding: 5px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text-soft); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.bhn-pg.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.bhn-dots { color: var(--text-muted); padding: 0 2px; }
.bhn-none { padding: 18px 0; text-align: center; }
@media (max-width: 800px) { .as-flat, .mon-cols { grid-template-columns: 1fr; } .as-flat .as-kpi, .mon-col { border-left: 0; border-top: 1px solid var(--border); padding: 14px 0; } .as-flat .as-kpi:first-child, .mon-col:first-child { border-top: 0; padding-top: 0; } .bhn-search { width: 100%; margin-left: 0; } }

/* Responsif terhadap lebar kartu (bukan layar): saat panel Karyawan AI terbuka, konten menyempit */
@container (max-width: 900px) {
  .as-row { grid-template-columns: 1fr; gap: 16px; }
  .as-period { flex-direction: row; align-items: center; flex-wrap: wrap; }
}
@container (max-width: 620px) {
  .as-kpis, .as-kpis.as-even, .as-flat { grid-template-columns: 1fr; }
  .as-kpi, .as-flat .as-kpi { border-left: 0; border-top: 1px solid var(--border); padding: 14px 0; }
  .as-kpis .as-kpi:first-child, .as-flat .as-kpi:first-child { border-top: 0; padding-top: 0; }
}

.cpr-fm .cpr-row { grid-template-columns: minmax(0, 1fr) 130px 100px 200px 190px 90px 100px; }
.cpr-fm .cpr-table { min-width: 960px; }
.cpr-fm .cpr-n.bhn-pill { display: flex; justify-content: flex-end; }

.bhn-row.bhn-s { grid-template-columns: minmax(0, 1fr) 190px 170px 150px; }
.bhn-row.bhn-t { grid-template-columns: minmax(0, 1fr) 150px 190px 170px 150px; }
.bhn-card .cpr-table, .spec-ops_bahan360 .cpr-table { min-width: 720px; }
.bhn-back { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--accent); cursor: pointer; }
.bhn-back:hover { text-decoration: underline; }
