/* CRM SEO — shared design tokens & layout
   Palette matches the published "Roadmap Menu Utama" artifact so the
   local app and the roadmap read as one system. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Public+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --bg: #F2F6F5;
  --surface: #FFFFFF;
  --surface-2: #E9F0EE;
  --ink: #12211F;
  --ink-soft: #55686A;
  --ink-faint: #7E9092;
  --line: #D6E1DE;
  --line-soft: #E6EDEB;
  --accent: #FC5000;
  --accent-ink: #A83500;
  --accent-soft: #FFE7D9;
  --brand-blue: #2266CC;
  --brand-blue-ink: #163F80;
  --brand-blue-soft: #DEE9FB;
  --row-stripe: #F3F7FE;
  --amber: #A8730B;
  --amber-soft: #FAEFD9;
  --red: #B3432D;
  --red-soft: #FBE7E1;
  --gray: #6E7C7E;
  --gray-soft: #EAEEED;
  --shadow: 0 1px 2px rgba(18,33,31,0.05), 0 10px 28px -16px rgba(18,33,31,0.22);
  --sidebar-w: 248px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1413;
    --surface: #101C1B;
    --surface-2: #142322;
    --ink: #E7EFEC;
    --ink-soft: #9AACA9;
    --ink-faint: #718382;
    --line: #223432;
    --line-soft: #1A2827;
    --accent: #FF7A3D;
    --accent-ink: #FFD9C2;
    --accent-soft: #3A2211;
    --brand-blue: #5B9BFF;
    --brand-blue-ink: #CFE0FF;
    --brand-blue-soft: #142B4D;
    --row-stripe: #0E1B29;
    --amber: #E4B054;
    --amber-soft: #2C2311;
    --red: #E28870;
    --red-soft: #2E1A14;
    --gray: #8A9C99;
    --gray-soft: #16201F;
    --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 10px 28px -16px rgba(0,0,0,0.65);
  }
}
:root[data-theme="dark"] {
  --bg: #0A1413;
  --surface: #101C1B;
  --surface-2: #142322;
  --ink: #E7EFEC;
  --ink-soft: #9AACA9;
  --ink-faint: #718382;
  --line: #223432;
  --line-soft: #1A2827;
  --accent: #FF7A3D;
  --accent-ink: #FFD9C2;
  --accent-soft: #3A2211;
  --brand-blue: #5B9BFF;
  --brand-blue-ink: #CFE0FF;
  --brand-blue-soft: #142B4D;
  --row-stripe: #0E1B29;
  --amber: #E4B054;
  --amber-soft: #2C2311;
  --red: #E28870;
  --red-soft: #2E1A14;
  --gray: #8A9C99;
  --gray-soft: #16201F;
  --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 10px 28px -16px rgba(0,0,0,0.65);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14.5px;
}
a { color: inherit; }
img { max-width: 100%; }

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
code, .mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

/* ---------- App shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: relative;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand-row { display: flex; align-items: center; gap: 2px; }
.brand-row .brand { flex: 1; min-width: 0; }
.sidebar-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 7px; border: none;
  background: transparent; color: var(--accent); cursor: pointer; flex: none;
}
.sidebar-toggle:hover { color: var(--accent-ink); background: var(--accent-soft); }
.sidebar-toggle svg { width: 19px; height: 19px; }

:root.sidebar-collapsed { --sidebar-w: 84px; }
:root.sidebar-collapsed .sidebar { padding-left: 8px; padding-right: 8px; }
:root.sidebar-collapsed .brand-row { justify-content: center; }
:root.sidebar-collapsed .brand { flex: none; padding: 0; }
:root.sidebar-collapsed .brand .name,
:root.sidebar-collapsed .menu-label,
:root.sidebar-collapsed .menu .submenu-label,
:root.sidebar-collapsed .menu a .label,
:root.sidebar-collapsed .sidebar-foot { display: none; }
:root.sidebar-collapsed .menu a,
:root.sidebar-collapsed .menu .submenu a { justify-content: center; padding: 9px 6px; }
:root.sidebar-collapsed .menu .submenu { padding-left: 0; margin-top: 0; border-left: none; gap: 2px; }
:root.sidebar-collapsed .menu .submenu[hidden] { display: flex; }
:root.sidebar-collapsed .menu a[hidden] { display: flex; }
@media (max-width: 860px) {
  .sidebar-toggle { display: none; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 0 8px;
}
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
  overflow: hidden;
}
.brand .mark img { width: 100%; height: 100%; object-fit: contain; }
.brand .name { font-family: 'Fraunces', serif; font-weight: 600; font-size: 15.5px; color: var(--ink); }
.brand .name small { display: block; font-family: 'Public Sans', sans-serif; font-weight: 500; font-size: 11px; color: var(--ink-faint); }

nav.menu { display: flex; flex-direction: column; gap: 2px; }
.menu-label {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 14px 10px 6px;
}
/* Grup menu yang punya submenu bisa diciutkan: labelnya jadi tombol,
   dengan chevron yang berputar mengikuti keadaan. */
.menu-label.is-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; background: none; border: none; text-align: left; cursor: pointer;
  font-family: inherit; font-size: inherit; font-weight: inherit;
  letter-spacing: inherit; text-transform: inherit; color: inherit;
}
.menu-label.is-toggle:hover { color: var(--ink-soft); }
.menu-label.is-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.menu-label .chev { width: 13px; height: 13px; flex: none; transition: transform 0.18s ease; }
.menu-label.is-collapsed .chev { transform: rotate(-90deg); }
.menu a, .menu .submenu a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
}
.menu a:hover { background: var(--surface-2); color: var(--ink); }
.menu a.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.menu a .icon { flex: none; width: 16px; height: 16px; opacity: 0.75; }
.menu a:hover .icon, .menu a.active .icon { opacity: 1; }
.menu .submenu { display: flex; flex-direction: column; gap: 1px; padding-left: 14px; margin-top: 2px; border-left: 1px solid var(--line-soft); }
.menu .submenu[hidden] { display: none; }
/* Sub-label di dalam submenu (mis. "Package" di atas SEO/Google
   Ads/Article/GMB) — grup kedua yang bisa diciutkan sendiri, terpisah
   dari grup Master di luarnya. */
.menu .submenu .submenu-label {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 8px 10px 2px;
}
.menu .submenu .submenu-label.is-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; background: none; border: none; text-align: left; cursor: pointer;
  font-family: inherit; font-size: inherit; font-weight: inherit;
  letter-spacing: inherit; text-transform: inherit; color: inherit;
}
.menu .submenu .submenu-label.is-toggle:hover { color: var(--ink-soft); }
.menu .submenu .submenu-label.is-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.menu .submenu .submenu-label .chev { width: 12px; height: 12px; flex: none; transition: transform 0.18s ease; }
.menu .submenu .submenu-label.is-collapsed .chev { transform: rotate(-90deg); }
.menu a[hidden] { display: none; }
.menu .submenu a { font-size: 12.8px; padding: 6px 10px; }
.menu .submenu a .icon { width: 14px; height: 14px; }
.count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-faint);
}

.sidebar-foot {
  margin-top: auto;
  font-size: 11.5px;
  color: var(--ink-faint);
  padding: 10px 8px 0;
  border-top: 1px solid var(--line-soft);
  line-height: 1.6;
}
.sidebar-foot a { color: var(--accent-ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--accent); }

/* ---------- Main content ---------- */
main.content { padding: 34px 40px 60px; max-width: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head-text { min-width: 0; }
.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.welcome-user { font-size: 13.5px; color: var(--ink-soft); white-space: nowrap; margin-right: 4px; }
.welcome-user strong { color: var(--ink); font-weight: 700; }
.btn-icon.is-syncing svg { animation: crm-spin 0.8s linear infinite; }
@keyframes crm-spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 12px);
  max-width: 420px; background: var(--ink); color: var(--bg);
  font-size: 13px; line-height: 1.5; padding: 12px 16px; border-radius: 10px;
  box-shadow: var(--shadow); opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.theme-switch { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); flex: none; }
.theme-switch .theme-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 28px; border: none; border-radius: 6px;
  background: transparent; color: var(--ink-faint); cursor: pointer;
}
.theme-switch .theme-btn svg { width: 16px; height: 16px; }
.theme-switch .theme-btn:hover { color: var(--ink); }
.theme-switch .theme-btn.active { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow); }
.eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 10px;
}
.page-head h1 { font-size: clamp(26px, 3vw, 32px); margin-bottom: 8px; }
.page-head p.desc { color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; max-width: 620px; margin: 0; }

/* ---------- Stat cards ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 30px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; box-shadow: var(--shadow);
  border-top: 3px solid var(--line);
}
.stat-card.accent { border-top-color: var(--accent); }
.stat-card.warn { border-top-color: var(--amber); }
.stat-card.danger { border-top-color: var(--red); }
.stat-card .num {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 27px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-card .lbl { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }

/* ---------- Trend chart ---------- */
.chart-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 30px;
}
.range-switch { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); flex: none; }
.range-switch .range-btn {
  font-family: 'Public Sans', sans-serif; font-size: 12.5px; font-weight: 600; color: var(--ink-faint);
  background: transparent; border: none; border-radius: 6px; padding: 6px 12px; cursor: pointer;
}
.range-switch .range-btn:hover { color: var(--ink); }
.range-switch .range-btn.active { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow); }
.range-custom { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: 9px; }
.range-custom label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.range-custom input[type="date"] {
  font-family: inherit; font-size: 12.5px; padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.range-custom .field-hint { color: var(--red); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; }
.chart-legend .legend-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft); }
.chart-legend .swatch { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chart-legend .legend-num { font-family: 'IBM Plex Mono', monospace; font-weight: 600; color: var(--ink); }
.chart-svg text { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 9.5px; fill: var(--ink-faint); }
.chart-svg .gridline { stroke: var(--line-soft); stroke-width: 1; }
.chart-svg .series-line { fill: none; stroke-width: 2; }

/* ---------- Cards / shortcuts ---------- */
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.shortcut {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; box-shadow: var(--shadow); text-decoration: none;
  display: flex; flex-direction: column; gap: 8px;
  border-top: 3px solid var(--line);
}
.shortcut:hover { border-color: var(--accent); }
.shortcut.st-live { border-top-color: var(--accent); }
.shortcut.st-partial { border-top-color: var(--amber); }
.shortcut.st-planned { border-top-color: var(--ink-faint); }
.shortcut h3 { font-size: 16.5px; }
.shortcut p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.55; }

.pill {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 9px; border-radius: 20px;
  display: inline-flex; width: fit-content;
}
.pill.live { background: var(--accent-soft); color: var(--accent-ink); }
.pill.partial { background: var(--amber-soft); color: var(--amber); }
.pill.planned { background: var(--gray-soft); color: var(--gray); }
.pill.expired { background: var(--red-soft); color: var(--red); }

/* ---------- Tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.tab-btn {
  font-size: 13px; font-weight: 600; color: var(--ink-soft); background: none; border: none;
  padding: 9px 4px; margin-right: 14px; cursor: pointer; border-bottom: 2px solid transparent;
  font-family: 'Public Sans', sans-serif; text-decoration: none; display: inline-flex; align-items: center;
}
.tab-btn.active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.tab-btn:hover { color: var(--ink); }

/* Tab berbentuk tombol untuk grup Package. Sengaja dibuat terang dan
   bertepi supaya jelas terbaca sebagai tombol yang bisa diklik, bukan
   sekadar teks berbaris. Berlaku hanya pada strip ber-kelas tabs-pill;
   tab lain (mis. Data SEO / Progress SEO) tetap memakai gaya garis bawah. */
.tabs.tabs-pill { gap: 8px; border-bottom: none; padding-bottom: 0; margin-bottom: 22px; }
.tabs-pill .tab-btn {
  margin-right: 0; padding: 8px 18px; border: 1.5px solid var(--brand-blue);
  border-radius: 999px; background: var(--brand-blue-soft); color: var(--brand-blue-ink);
  font-size: 13px; font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.tabs-pill .tab-btn:hover {
  background: var(--brand-blue); color: #fff; box-shadow: 0 4px 12px -6px var(--brand-blue);
}
.tabs-pill .tab-btn:active { transform: translateY(1px); }
.tabs-pill .tab-btn.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 6px 16px -8px var(--accent);
}
.tabs-pill .tab-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
thead th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--brand-blue-ink); background: var(--brand-blue-soft); padding: 12px 16px;
  border-bottom: 2px solid var(--brand-blue);
  white-space: nowrap;
}
tbody td { padding: 13px 16px; font-size: 13.5px; color: var(--ink); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: var(--row-stripe); }
tbody tr:hover td { background: var(--brand-blue-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Click-to-sort column headers — see CRM_UI.sort in assets/js/nav.js. */
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { filter: brightness(0.96); }
.sort-arrow { display: inline-block; margin-left: 5px; font-size: 10px; line-height: 1; opacity: 0.35; }

/* ---- Pembatas kolom, lebar yang bisa digeser, dan scrollbar di atas tabel.
   Perilakunya dipasang sekali untuk semua tabel oleh enhanceTables() di
   assets/js/nav.js, jadi halaman tidak perlu tahu apa-apa soal ini. ---- */
thead th, tbody td { border-right: 1px solid var(--line-soft); }
thead th { border-right-color: rgba(34,102,204,0.25); position: relative; }
thead th:last-child, tbody td:last-child { border-right: none; }

/* Gagang tipis di tepi kanan header; area tangkapnya lebih lebar dari garisnya. */
.col-resizer {
  position: absolute; top: 0; right: -3px; width: 7px; height: 100%;
  cursor: col-resize; user-select: none; z-index: 2;
}
.col-resizer:hover::after, .col-resizer.is-dragging::after {
  content: ''; position: absolute; top: 0; right: 3px; width: 2px; height: 100%;
  background: var(--accent);
}
:root.is-col-resizing { cursor: col-resize; user-select: none; }

/* Setelah kolom digeser, tabel pindah ke table-layout: fixed supaya lebarnya
   benar-benar dipatuhi; isi yang kepanjangan dipotong dengan elipsis. */
table.is-resized { table-layout: fixed; }
table.is-resized thead th, table.is-resized tbody td { overflow: hidden; text-overflow: ellipsis; }

/* Scrollbar kembar di atas tabel: menggeser salah satu ikut menggeser yang lain. */
.table-scroll-top {
  overflow-x: auto; overflow-y: hidden; height: 12px; margin-bottom: 6px;
  border-radius: 6px; background: var(--surface-2);
}
.table-scroll-top[hidden] { display: none; }
.table-scroll-top > div { height: 1px; }
.sort-arrow::after { content: '\2195'; }
.sort-arrow.asc::after, .sort-arrow.desc::after { content: '\2191'; }
.sort-arrow.desc::after { content: '\2193'; }
.sort-arrow.asc, .sort-arrow.desc { opacity: 1; color: var(--brand-blue); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: 'Public Sans', sans-serif; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  line-height: 1.2; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-faint); }
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: var(--surface); color: var(--brand-blue); border: 1.5px solid var(--brand-blue); }
.btn-outline:hover { background: var(--brand-blue-soft); }
.btn-outline:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline.is-syncing svg { animation: crm-spin 0.8s linear infinite; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-icon { padding: 7px; width: 32px; height: 32px; }
.btn-icon svg { width: 15px; height: 15px; }
.section-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cell-truncate { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-link { color: var(--brand-blue); text-decoration: none; }
.cell-link:hover { text-decoration: underline; }
.table-actions { display: flex; gap: 4px; justify-content: flex-start; }
.actions-col, .actions-cell { width: 1%; white-space: nowrap; }
.table-actions .btn-icon { width: 27px; height: 27px; padding: 5px; }
td.actions-cell { white-space: nowrap; }

/* ---------- Section head (Master categories, table toolbars) ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.section-head .section-title { display: flex; align-items: center; gap: 10px; }
.section-head h3 { font-size: 16.5px; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.table-search { position: relative; flex: 1; min-width: 180px; max-width: 320px; }
.table-search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--ink-faint); pointer-events: none;
}
.table-search input {
  width: 100%; padding: 8px 12px 8px 32px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13.5px;
}
.table-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.toolbar-select {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 13.5px;
}
.toolbar-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

th.checkbox-col, td.checkbox-col { width: 20px; text-align: center; white-space: nowrap; }
td.checkbox-col input, th.checkbox-col input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

.bulk-bar {
  display: none; align-items: center; gap: 12px; margin-bottom: 12px; padding: 10px 14px;
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 9px;
  font-size: 13px; color: var(--accent-ink); font-weight: 600;
}
.bulk-bar.is-visible { display: flex; }
.bulk-bar .bulk-actions { display: flex; gap: 8px; margin-left: auto; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,20,19,0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
/* Popup Master dibuka di atas modal yang sedang terbuka, jadi aturan ini
   harus datang SETELAH .modal-overlay agar z-index-nya menang. */
.modal-overlay.modal-overlay-stacked { z-index: 120; }
.modal-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); width: 100%; max-width: 560px; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); flex: none; }
.modal-head h2 { font-size: 17px; }
.modal-close {
  background: none; border: none; font-size: 20px; line-height: 1; color: var(--ink-faint);
  cursor: pointer; padding: 4px; border-radius: 6px;
}
.modal-close:hover { color: var(--ink); background: var(--surface-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; padding: 18px 20px; overflow-y: auto; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field[hidden] { display: none; }
.field.field-wide { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.field .req { color: var(--red); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 13.5px; padding: 8px 10px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.field textarea { line-height: 1.5; }
.field select[multiple] { padding: 4px; }
.field input[readonly] { background: var(--surface-2); color: var(--ink-faint); cursor: not-allowed; }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-hint { font-size: 11px; color: var(--ink-faint); }
/* Dropdown yang bisa diketik: satu kontrol, bukan kolom cari terpisah. */
.combo { position: relative; }
.combo-input { width: 100%; padding-right: 30px; }
.combo-caret {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0; pointer-events: auto; cursor: pointer;
  border-left: 4.5px solid transparent; border-right: 4.5px solid transparent;
  border-top: 5.5px solid var(--ink-faint);
}
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 3px); z-index: 5;
  max-height: 210px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 4px;
}
.combo-list[hidden] { display: none; }
.combo-item {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 7px 9px; border-radius: 7px; font: inherit; font-size: 13px;
  color: var(--ink); cursor: pointer;
}
.combo-item:hover { background: var(--brand-blue-soft); }
.combo-item.is-selected { background: var(--surface-2); font-weight: 600; }
.combo-empty { padding: 8px 9px; font-size: 12.5px; color: var(--ink-faint); }

/* Pembuatan entri Master langsung dari dropdown di dalam modal. */
.field-create { margin-top: 4px; font-size: 11.5px; line-height: 1.5; }
.field-create-empty { color: var(--ink-faint); }
.field-create-link {
  background: none; border: none; padding: 0; font: inherit; cursor: pointer;
  color: var(--brand-blue); text-decoration: underline;
}
.field-create-link:hover { color: var(--accent); }
.field-create-form { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.field-create-form[hidden] { display: none; }
.field-create-input {
  flex: 1; min-width: 120px; padding: 6px 9px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 12.5px;
}
.field-create-msg { margin-top: 4px; color: var(--ink-faint); }
.field-create-msg.is-error { color: var(--red); }
.checkbox-group {
  display: flex; flex-direction: column; gap: 7px; max-height: 170px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; background: var(--bg);
}
.checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; color: var(--ink); cursor: pointer; }
.checkbox-item input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; flex: none; }
/* Account > Services: satu checkbox + dropdown Package per baris. */
.service-package-list {
  display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 7px;
  padding: 10px 12px; background: var(--bg);
}
.service-package-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.service-package-row .checkbox-item { min-width: 150px; flex: none; }
.service-package-row .svc-package {
  flex: 1; min-width: 160px; padding: 7px 10px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 12.5px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-soft); flex: none; }

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Empty / planned state ---------- */
.empty-state {
  background: var(--surface); border: 1px dashed var(--line); border-radius: 14px;
  padding: 44px 32px; text-align: left; max-width: 560px;
}
.empty-state h2 { font-size: 19px; margin-bottom: 10px; }
.empty-state p { color: var(--ink-soft); font-size: 13.8px; line-height: 1.65; margin: 0 0 14px; }
.empty-state ul { margin: 0; padding-left: 20px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.8; }

.settings-section {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px 26px; max-width: 720px; margin-bottom: 20px;
}
.settings-section h2 { font-size: 16.5px; margin-bottom: 6px; }
.settings-section h3.settings-subhead { font-size: 13.5px; color: var(--ink-soft); margin: 22px 0 10px; }
.settings-hint { font-size: 12.5px; color: var(--ink-faint); margin-bottom: 18px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.settings-actions { display: flex; gap: 10px; margin-top: 18px; }
@media (max-width: 640px) { .settings-grid { grid-template-columns: 1fr; } }

.avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.avatar-preview {
  width: 56px; height: 56px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--brand-blue-soft); color: var(--brand-blue-ink);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 20px;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.profile-menu-wrap { position: relative; }
.profile-trigger { overflow: hidden; padding: 0; }
.profile-trigger img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.14); min-width: 180px; padding: 6px;
}
.profile-dropdown-head {
  padding: 8px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid var(--line-soft); margin-bottom: 4px;
}
.profile-dropdown-head small { display: block; font-weight: 500; color: var(--ink-faint); text-transform: uppercase; font-size: 10px; letter-spacing: .03em; margin-top: 2px; }
.profile-dropdown-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 7px; border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--ink); text-decoration: none; font-family: inherit;
}
.profile-dropdown-item:hover { background: var(--brand-blue-soft); }
.profile-dropdown-item svg { width: 15px; height: 15px; flex: none; }

/* Role "View": dim out the buttons that mutate data — see nav.js for why
   this is a UI nicety, not real server-side enforcement. */
:root.role-view .table-toolbar .btn-primary,
:root.role-view .table-toolbar .btn-outline,
:root.role-view .page-head .btn-primary,
:root.role-view .section-head-actions .btn-primary,
:root.role-view .section-head-actions .btn-outline,
:root.role-view .table-actions .btn-icon:not([data-view]),
:root.role-view .bulk-actions .btn,
:root.role-view .bulk-actions select,
:root.role-view #sync-btn {
  pointer-events: none; opacity: 0.4; cursor: not-allowed;
}

/* Link ke Google Sheet mentah di footer sidebar: Super Admin saja. */
:root.hide-sheet-link .sidebar-foot { display: none; }

.mobile-topbar, .mobile-backdrop, .mobile-nav-toggle { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  main.content { padding: 20px 16px 48px; overflow-x: hidden; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .head-actions { align-self: flex-start; }

  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 40;
  }
  .mobile-topbar .brand { padding: 0; }
  .mobile-topbar-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 15px; color: var(--ink); }
  .mobile-nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink); cursor: pointer; flex: none;
  }
  .mobile-nav-toggle svg { width: 18px; height: 18px; }

  .mobile-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(10,20,19,0.45); z-index: 55;
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
  }
  :root.mobile-nav-open .mobile-backdrop { opacity: 1; pointer-events: auto; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 82vw; max-width: 300px;
    transform: translateX(-100%); transition: transform 0.25s ease;
    z-index: 60; flex-direction: column; align-items: stretch;
    overflow-x: hidden; overflow-y: auto; padding: 20px 16px;
  }
  :root.mobile-nav-open .sidebar { transform: translateX(0); }
  .sidebar .sidebar-toggle { display: none; }
  .sidebar-foot { display: block; }
  nav.menu { flex-direction: column; }
  .menu .submenu { display: flex; }
  .menu .submenu[hidden] { display: none; }
  .menu a[hidden] { display: none; }
}

/* ---------------------------------------------------------------------
   Dashboard (Spark Admin–inspired) — index.html only. Dark forest/lime
   accents live as their own tokens so they don't touch the app's main
   orange design system used everywhere else.
--------------------------------------------------------------------- */
:root {
  --spark-forest-dark: #051C12;
  --spark-forest-mid: #0B2A1C;
  --spark-lime: #B4F105;
  --spark-lime-soft: rgba(180,241,5,0.15);
}
.spark-top-row { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.spark-main-row { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; margin-bottom: 22px; }
.spark-main-col, .spark-side-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.spark-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px; box-shadow: var(--shadow);
}
.spark-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.spark-card-title { font-family: 'Fraunces', serif; font-size: 16.5px; font-weight: 600; margin: 0; }
.spark-card-more { font-size: 12.5px; font-weight: 600; color: var(--ink-faint); text-decoration: none; }
.spark-card-more:hover { color: var(--ink); }

.spark-highlight-card, .spark-promo-card {
  position: relative; overflow: hidden; border-radius: 20px; padding: 20px;
  background: linear-gradient(160deg, var(--spark-forest-dark), var(--spark-forest-mid));
  color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 150px;
}
.spark-highlight-badge {
  display: inline-block; background: rgba(255,255,255,0.12); color: var(--spark-lime);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 10px;
}
.spark-highlight-text {
  font-family: 'Fraunces', serif; font-size: 18px; line-height: 1.35; max-width: 230px;
  position: relative; z-index: 1;
}
.spark-highlight-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--spark-lime);
  font-weight: 700; font-size: 13px; text-decoration: none; position: relative; z-index: 1;
  margin-top: 14px;
}
.spark-highlight-link svg { width: 14px; height: 14px; }
.spark-highlight-shape { position: absolute; right: -14px; bottom: -14px; width: 130px; height: 130px; opacity: 0.9; }

.spark-stat-card { display: flex; flex-direction: column; }
.spark-stat-label {
  font-size: 11.5px; color: var(--ink-faint); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.spark-stat-value { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 600; margin-top: 10px; color: var(--ink); }
.spark-trend {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; margin-top: 8px; width: fit-content;
}
.spark-trend svg { width: 11px; height: 11px; }
.spark-trend.up { color: #15803D; background: #DCFCE7; }
.spark-trend.down { color: #B91C1C; background: #FEE2E2; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .spark-trend.up { color: #86EFAC; background: rgba(34,197,94,0.15); }
  :root:not([data-theme="light"]) .spark-trend.down { color: #FCA5A5; background: rgba(239,68,68,0.15); }
}
:root[data-theme="dark"] .spark-trend.up { color: #86EFAC; background: rgba(34,197,94,0.15); }
:root[data-theme="dark"] .spark-trend.down { color: #FCA5A5; background: rgba(239,68,68,0.15); }
.spark-stat-caption { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; }
.spark-sparkline { width: 100%; height: 34px; margin-top: 10px; display: block; }
.spark-sparkline polyline { fill: none; stroke: var(--spark-lime); stroke-width: 2.4; }
.spark-sparkline .fill { stroke: none; fill: var(--spark-lime-soft); }

.spark-activity-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.spark-activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.spark-activity-icon {
  width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--brand-blue-soft); color: var(--brand-blue-ink); flex: none;
}
.spark-activity-icon svg { width: 16px; height: 16px; }
.spark-activity-info { flex: 1; min-width: 0; }
.spark-activity-name {
  font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.spark-activity-date { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.spark-activity-empty { font-size: 13px; color: var(--ink-faint); text-align: center; padding: 20px 0; }

.spark-progress-row { margin-bottom: 14px; }
.spark-progress-row:last-child { margin-bottom: 0; }
.spark-progress-label-row { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.spark-progress-label { color: var(--ink-soft); font-weight: 600; }
.spark-progress-value { color: var(--ink); font-weight: 700; }
.spark-progress-track { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.spark-progress-bar { height: 100%; border-radius: 999px; background: var(--spark-lime); }

.spark-promo-title { font-family: 'Fraunces', serif; font-size: 15.5px; line-height: 1.4; margin: 0 0 8px; max-width: 210px; position: relative; z-index: 1; }
.spark-promo-desc { font-size: 12px; color: rgba(255,255,255,0.7); margin: 0 0 16px; max-width: 210px; position: relative; z-index: 1; }
.spark-promo-btn {
  background: var(--spark-lime); color: var(--spark-forest-dark); border: none; padding: 10px 16px;
  border-radius: 10px; font-size: 12.5px; font-weight: 700; cursor: pointer; position: relative; z-index: 1;
  width: fit-content;
}
.spark-promo-btn:hover { background: #c8ff1a; }

@media (max-width: 860px) {
  .spark-top-row { grid-template-columns: 1fr; }
  .spark-main-row { grid-template-columns: 1fr; }
}

/* Bell notification icon in the top header, next to theme-switch/profile —
   shares its unread state with the chat widget (see nav.js). */
.notif-bell { position: relative; }
.notif-bell .notif-dot {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 999px; background: #C0392B; color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1; border: 2px solid var(--surface);
}

/* Chat widget — floating launcher bottom-right on every logged-in page.
   z-index 45 (just under .modal-overlay's 50) so an open Tambah/Edit
   form naturally covers it instead of the two floating layers competing. */
.chat-widget { position: fixed; right: 20px; bottom: 20px; z-index: 45; }
.chat-launcher {
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); position: relative; padding: 0;
}
.chat-launcher:hover { background: var(--accent-ink); }
.chat-launcher svg { width: 23px; height: 23px; }
.chat-badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: #C0392B; color: #fff; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1; border: 2px solid var(--bg);
}
.chat-panel {
  position: absolute; right: 0; bottom: 64px; width: 320px; max-width: calc(100vw - 40px);
  height: 440px; max-height: calc(100vh - 120px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-panel-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 14px; color: var(--ink); flex: none;
}
.chat-panel-head .chat-back, .chat-panel-head .chat-close {
  background: none; border: none; cursor: pointer; color: var(--ink-faint); display: flex; padding: 2px;
}
.chat-panel-head .chat-back:hover, .chat-panel-head .chat-close:hover { color: var(--ink); }
.chat-panel-head .chat-back svg { width: 18px; height: 18px; }
.chat-panel-head .chat-close svg { width: 16px; height: 16px; }
.chat-panel-head-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-panel-head .chat-close { margin-left: auto; }
#chat-panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-list { flex: 1; overflow-y: auto; }
.chat-list-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
}
.chat-list-item:hover { background: var(--surface-2); }
.chat-list-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none;
  object-fit: cover;
}
.chat-head-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; flex: none;
  object-fit: cover;
}
.chat-list-info { flex: 1; min-width: 0; }
.chat-list-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.chat-list-preview { font-size: 12px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-item.unread .chat-list-preview { color: var(--ink); font-weight: 600; }
.chat-list-unread-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none;
}
.chat-empty { padding: 24px 16px; text-align: center; color: var(--ink-faint); font-size: 12.5px; margin: auto; }
.chat-thread { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-bubble { max-width: 78%; padding: 8px 12px; border-radius: 14px; font-size: 13px; line-height: 1.4; word-break: break-word; }
.chat-bubble.sent { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.received { align-self: flex-start; background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 4px; }
.chat-bubble a { color: inherit; text-decoration: underline; word-break: break-all; }
.chat-bubble-time { display: block; margin-top: 3px; font-size: 10px; opacity: 0.7; }
.chat-input-row { flex: none; display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-input-row input {
  flex: 1; padding: 9px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-size: 13px;
}
.chat-input-row button {
  width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; padding: 0;
}
.chat-input-row button:hover { background: var(--accent-ink); }
.chat-input-row button:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-input-row button svg { width: 16px; height: 16px; }
@media (max-width: 480px) {
  .chat-widget { right: 12px; bottom: 12px; }
  .chat-panel { width: calc(100vw - 24px); height: calc(100vh - 140px); }
}

/* Layanan yang dikunci karena sudah tercakup paket Membership. */
.checkbox-item.is-locked { opacity: 0.75; cursor: not-allowed; }
.checkbox-item.is-locked input { cursor: not-allowed; }
.checkbox-item.is-locked::after {
  content: 'termasuk paket'; margin-left: 6px; font-size: 10.5px; font-weight: 600;
  color: var(--ink-faint); letter-spacing: 0.02em;
}

/* Pembatas berlabel di daftar Services: garis dengan tulisan di depannya. */
.service-divider {
  display: flex; align-items: center; gap: 10px; margin: 12px 0 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint);
}
.service-divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }

.svc-master-list { display: flex; flex-direction: column; gap: 0; }
.svc-price { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--ink-faint); }

/* Tautan "Tidak ada X? Buat di sini" yang duduk di baris label, di samping tulisannya. */
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.field-create-inline { margin-top: 0; font-size: 11px; white-space: nowrap; }

/* ---- Dashboard data live ---- */
.live-status {
  display: inline-flex; align-items: center; gap: 7px; margin: 2px 0 0;
  font-size: 11.5px; font-weight: 600; color: var(--ink-faint);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fb457; box-shadow: 0 0 0 0 rgba(47,180,87,0.5); animation: live-pulse 2s infinite; }
.live-status.is-error .live-dot { background: var(--red); animation: none; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(47,180,87,0.45); } 70% { box-shadow: 0 0 0 7px rgba(47,180,87,0); } 100% { box-shadow: 0 0 0 0 rgba(47,180,87,0); } }

.master-count-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.master-count {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.master-count:hover { border-color: var(--accent); transform: translateY(-1px); }
.master-count-num { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.master-count-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }

.live-rank-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
@media (max-width: 1100px) { .live-rank-row { grid-template-columns: 1fr; } }
.rank-row { margin-bottom: 12px; }
.rank-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 5px; }
.rank-name { color: var(--ink-soft); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-num { color: var(--ink); font-weight: 700; white-space: nowrap; }
.rank-num small { font-weight: 500; color: var(--ink-faint); margin-left: 4px; }

/* Status konfirmasi Optimizer: hijau = sudah, merah = belum. */
:root { --ok: #1b8a4b; --bad: #d92d20; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ok: #5fd38a; --bad: #ff6b5e; } }
:root[data-theme="dark"] { --ok: #5fd38a; --bad: #ff6b5e; }
.status-proses { font-weight: 700; }
.status-proses.sudah { color: var(--ok); }
.status-proses.belum { color: var(--bad); }

/* ---- Progress Account: hitungan di tab, filter Services, popup detail ---- */
.tab-count {
  display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 6px; border-radius: 999px;
  font-size: 11px; font-weight: 800; text-align: center; background: rgba(255,255,255,0.65); color: inherit;
}
.svc-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 0 12px; }
.svc-filter-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.svc-filter-reset { background: none; border: none; padding: 0; font: inherit; font-size: 12px; color: var(--brand-blue); text-decoration: underline; cursor: pointer; }
.svc-filter-reset[hidden] { display: none; }
.pa-dialog-body { padding: 18px 22px; overflow-y: auto; }
.pa-tanya { font-size: 14.5px; line-height: 1.6; margin: 0 0 8px; }
.pa-detail { display: flex; flex-direction: column; }
.pa-detail-row { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.pa-detail-row:last-child { border-bottom: none; }
.pa-detail-label { flex: 0 0 170px; color: var(--ink-faint); font-size: 12.5px; font-weight: 600; }

/* ---- Panel notifikasi di lonceng ---- */
.notif-panel {
  position: fixed; z-index: 90; width: 340px; max-width: calc(100vw - 16px); max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.notif-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.notif-readall { background: none; border: none; padding: 0; font: inherit; font-size: 12px; color: var(--brand-blue); text-decoration: underline; cursor: pointer; }
.notif-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 11px 14px;
  background: none; border: none; border-bottom: 1px solid var(--line-soft); font: inherit; color: var(--ink); cursor: pointer;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item-title { font-size: 13px; font-weight: 700; }
.notif-item-msg { font-size: 12.5px; color: var(--ink-soft); }
.notif-item-time { font-size: 11px; color: var(--ink-faint); }
.notif-chat { flex-direction: row; align-items: center; justify-content: space-between; }
.notif-count { min-width: 20px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 800; text-align: center; background: var(--accent); color: #fff; }
.notif-count.is-zero { background: var(--line); color: var(--ink-faint); }
.notif-empty { padding: 22px 14px; text-align: center; font-size: 12.5px; color: var(--ink-faint); }

/* Kolom password dengan ikon tampil/sembunyikan di dalamnya. */
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap input { width: 100%; padding-right: 42px; }
.pw-toggle-btn {
  position: absolute; right: 8px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 8px; color: var(--ink-faint); cursor: pointer;
}
.pw-toggle-btn:hover { background: var(--surface); color: var(--ink); }
.pw-toggle-btn svg { width: 17px; height: 17px; }

/* Sidebar: menu yang tidak dicentang di Menu Akses role */
.menu .role-hidden { display: none !important; }

/* Angka grafik dashboard saat disorot kursor */
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 120px; padding: 8px 10px; border-radius: 10px; background: var(--ink); color: var(--surface); font-size: 12px; line-height: 1.5; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.chart-tip[hidden] { display: none; }
.chart-tip-head { font-weight: 600; margin-bottom: 4px; opacity: .85; }
.chart-tip-row { display: flex; align-items: center; gap: 7px; }
.chart-tip-row b { margin-left: auto; padding-left: 14px; font-family: 'IBM Plex Mono', monospace; }
.chart-tip .swatch { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chart-tip-total { margin-top: 3px; padding-top: 3px; border-top: 1px solid var(--ink-faint); }
.chart-hit { cursor: crosshair; }

/* Filter Services sebagai dropdown checkbox */
.svc-dd { position: relative; }
.svc-dd-btn { display: inline-flex; align-items: center; gap: 8px; min-width: 170px; justify-content: space-between; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.svc-dd-btn .chev { width: 14px; height: 14px; transition: transform .15s; }
.svc-dd-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.svc-dd-panel { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 240px; max-height: 280px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.svc-dd-panel[hidden] { display: none; }
.svc-dd-panel .checkbox-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.svc-dd-panel .checkbox-item:hover { background: var(--surface-2); }

/* "Pilih semua" di atas daftar checkbox-group */
.checkbox-all { margin: 0 0 6px; padding: 0 2px; }

/* Tautan konfirmasi di bubble chat "Project baru masuk" */
.chat-bubble a.chat-confirm-link { display: block; margin-top: 6px; font-weight: 600; color: var(--accent-ink); text-decoration: underline; word-break: normal; }
.pa-detail-value { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* Set Up Account: kolom checklist per layanan */
.su-col { text-align: center; }
.su-col.su-none { color: var(--ink-faint); }
.su-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.su-check:disabled { cursor: not-allowed; opacity: .5; }
.su-progress { font-family: 'IBM Plex Mono', monospace; font-weight: 600; color: var(--ink-soft); }
.su-progress.su-done { color: var(--ok); }
.su-sub { margin: 16px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink); }
.su-item { padding: 5px 0; }
.su-chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-soft); font: inherit; font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; cursor: pointer; }
.su-chip:hover { border-color: var(--brand-blue); }
.su-chip.su-done { background: var(--ok); border-color: var(--ok); color: #fff; }
.su-svc { margin: 6px 0 12px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 10px; }
.su-svc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
