/* ============================================================================
   erp-core brand & component stylesheet
   ----------------------------------------------------------------------------
   Dark-base design system for the CGT Business Architect ERP, shared by every
   tenant. Visual identity is the SAME across tenants (dark base, IBM Plex,
   phoenix app-shell); tenants differ ONLY by:
     - accent colour  -> injected per-request as --pc-accent / --erp-accent
     - logo           -> /static/erp/tenants/<slug>/logo.svg in the shell brand

   Tokens are defined dark-first on :root, mapped onto phoenix shell's --pc-*
   variables so the app-shell (sidebar / topbar / tabs) themes automatically.
   A light variant is provided via prefers-color-scheme and [data-theme].
   ========================================================================== */

/* ---- Self-hosted IBM Plex (woff2 under ./fonts/) ------------------------- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/IBMPlexSans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/IBMPlexSans-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/IBMPlexSans-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/IBMPlexSans-700.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/IBMPlexMono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/IBMPlexMono-600.woff2") format("woff2");
}

/* ---- Design tokens (dark base) ------------------------------------------- */
:root {
  /* Accent — CGT Business Architect orange. Overridden per tenant by an inline
     :root block (brand_accent) after this file; kept here as the brand default. */
  --erp-accent: #e2680e;
  --erp-accent-strong: #c75a0b;
  --erp-accent-contrast: #ffffff;

  /* Surfaces & text */
  --erp-bg: #0f1419;
  --erp-surface: #171d26;
  --erp-surface-2: #1e2630;
  --erp-elevated: #222b37;
  --erp-border: #2b3442;
  --erp-border-strong: #3a4556;
  --erp-text: #e6edf3;
  --erp-muted: #9aa7b5;
  --erp-faint: #6b7886;

  /* Status */
  --erp-ok: #3fb984;
  --erp-ok-bg: rgba(63, 185, 132, 0.12);
  --erp-warn: #e0a64b;
  --erp-warn-bg: rgba(224, 166, 75, 0.12);
  --erp-danger: #e5736b;
  --erp-danger-bg: rgba(229, 115, 107, 0.12);

  /* Typography & metrics */
  --erp-font: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --erp-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --erp-radius: 10px;
  --erp-radius-sm: 7px;
  --erp-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.22);
  --erp-hover: rgba(255, 255, 255, 0.06);
}

/* ---- Theme the phoenix app-shell -----------------------------------------
   phoenix-shell.css defines its --pc-* tokens ON `.pc-shell` (not :root) with
   LIGHT defaults, so they must be overridden at the same selector. brand.css
   loads after phoenix-shell.css → equal specificity, later wins. Values point
   at the --erp-* tokens (resolved on :root, inherited in), so light/dark follow
   automatically. --pc-sidebar-w/-rail-w/-topbar-h keep phoenix's own values. */
.pc-shell {
  --pc-accent: var(--erp-accent);
  --pc-accent-contrast: var(--erp-accent-contrast);
  --pc-bg: var(--erp-bg);
  --pc-surface: var(--erp-surface);
  --pc-border: var(--erp-border);
  --pc-text: var(--erp-text);
  --pc-muted: var(--erp-muted);
  --pc-hover: var(--erp-hover);
  --pc-sidebar-bg: #0c1118;
  --pc-sidebar-text: #c3cdd9;
  /* LGMS-style active item: subtle tint + accent bar (::before uses --pc-accent),
     not a full accent fill — reads calmer and more "mature". */
  --pc-sidebar-active-bg: rgba(255, 255, 255, 0.08);
  --pc-sidebar-active-text: #ffffff;
  /* Samakan font shell dengan brand (IBM Plex) — token baru shell v1.12.0.
     Scroll-fix layout kini di hulu (v1.12.0), tak perlu override tinggi di sini. */
  --pc-font: var(--erp-font);
  font-family: var(--erp-font);
}

/* Brand logo: allow non-square (wordmark) logos to keep their aspect. The shell
   box is a fixed 28px square; relax width so wide logos scale by height. */
.pc-shell .pc-brand-logo {
  width: auto;
  max-width: 160px;
}
.pc-brand-logo img,
.pc-brand-logo svg {
  height: 26px;
  width: auto;
  max-width: 100%;
  display: block;
}

/* ---- Light variant ------------------------------------------------------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --erp-accent-contrast: #ffffff;
    --erp-bg: #f1f4f8;
    --erp-surface: #ffffff;
    --erp-surface-2: #f6f8fb;
    --erp-elevated: #ffffff;
    --erp-border: #dce3ec;
    --erp-border-strong: #c6d0dd;
    --erp-text: #1b2430;
    --erp-muted: #5a6775;
    --erp-faint: #8a97a6;
    --erp-ok-bg: rgba(22, 128, 86, 0.1);
    --erp-warn-bg: rgba(161, 98, 7, 0.1);
    --erp-danger-bg: rgba(185, 53, 45, 0.1);
    --erp-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 10px 28px rgba(16, 24, 40, 0.08);
    --erp-hover: rgba(15, 23, 42, 0.05);
  }
}
:root[data-theme="light"] {
  --erp-accent-contrast: #ffffff;
  --erp-bg: #f1f4f8;
  --erp-surface: #ffffff;
  --erp-surface-2: #f6f8fb;
  --erp-elevated: #ffffff;
  --erp-border: #dce3ec;
  --erp-border-strong: #c6d0dd;
  --erp-text: #1b2430;
  --erp-muted: #5a6775;
  --erp-faint: #8a97a6;
  --erp-ok-bg: rgba(22, 128, 86, 0.1);
  --erp-warn-bg: rgba(161, 98, 7, 0.1);
  --erp-danger-bg: rgba(185, 53, 45, 0.1);
  --erp-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 10px 28px rgba(16, 24, 40, 0.08);
  --erp-hover: rgba(15, 23, 42, 0.05);
}

/* ---- Base ---------------------------------------------------------------- */
html {
  background: var(--erp-bg);
}
body {
  margin: 0;
  font-family: var(--erp-font);
  color: var(--erp-text);
  background: var(--erp-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: var(--erp-accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
* {
  box-sizing: border-box;
}

/* ---- Content card -------------------------------------------------------- */
.erp-card {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  box-shadow: var(--erp-shadow);
  padding: 24px 26px;
  margin: 0 0 20px;
}
.erp-card h1 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.erp-muted {
  color: var(--erp-muted);
}
.erp-sub {
  color: var(--erp-muted);
  font-size: 13.5px;
  margin: 0 0 18px;
}
.erp-sub a {
  color: var(--erp-accent);
}
/* standalone select (e.g. report filters) outside a form grid */
.erp-select {
  background: var(--erp-bg);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
  color: var(--erp-text);
  font: inherit;
  padding: 8px 11px;
  min-width: 240px;
}
.erp-select:focus {
  outline: none;
  border-color: var(--erp-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--erp-accent) 25%, transparent);
}

/* list-page card header: title left, action (e.g. +Tambah) right */
.erp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
}
.erp-head h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---- Big page header (dashboard): icon + title + subtitle — gaya LGMS ---- */
.erp-pagehead {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 20px;
}
.erp-pagehead-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--erp-accent) 14%, transparent);
  color: var(--erp-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.erp-pagehead h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.erp-pagehead .erp-sub {
  margin: 3px 0 0;
}

/* ---- Topbar icon button (notification bell) — gaya LGMS .ikon-btn ---- */
.erp-topbar-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}
.erp-iconbtn {
  width: 36px;
  height: 36px;
  border-radius: var(--erp-radius-sm);
  border: 1px solid var(--erp-border);
  background: transparent;
  color: var(--erp-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}
.erp-iconbtn:hover {
  background: var(--pc-hover);
  color: var(--erp-text);
  border-color: var(--erp-border-strong);
  text-decoration: none;
}
.erp-bell {
  position: relative;
}
.erp-notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--erp-danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  border: 2px solid var(--erp-surface);
}

/* ---- Notifications page list ---- */
.erp-notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.erp-notif-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  box-shadow: var(--erp-shadow);
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.1s ease;
}
.erp-notif-item:hover {
  border-color: var(--erp-border-strong);
  text-decoration: none;
}
.erp-notif-count {
  flex: 0 0 auto;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: 9px;
  background: var(--erp-danger-bg);
  color: var(--erp-danger);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
}
.erp-notif-title {
  font-weight: 600;
}

/* ---- Dashboard: stat cards + panels -------------------------------------- */
.erp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin: 0 0 20px;
}
.erp-stat {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  box-shadow: var(--erp-shadow);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
}
/* Kartu statistik yang dapat diklik (menautkan ke laporan terkait) — gaya LGMS. */
a.erp-stat:hover {
  border-color: var(--erp-border-strong);
  box-shadow: var(--erp-shadow), 0 0 0 1px var(--erp-border-strong) inset;
  text-decoration: none;
}
.erp-stat-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Kotak ikon 40x40 (aksen lembut) di kanan tiap kartu — pola .kartu-ikon LGMS. */
.erp-stat-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--erp-accent) 14%, transparent);
  color: var(--erp-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.erp-stat .k {
  font-size: 12px;
  font-weight: 600;
  color: var(--erp-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.erp-stat .v {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.erp-stat .v .cur {
  font-size: 13px;
  font-weight: 600;
  color: var(--erp-muted);
  margin-right: 4px;
}
.erp-stat .sub {
  font-size: 12.5px;
  color: var(--erp-faint);
}
.erp-stat.accent {
  border-color: color-mix(in srgb, var(--erp-accent) 45%, var(--erp-border));
}
.erp-stat.accent .v {
  color: var(--erp-accent);
}
.erp-grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 0 0 20px;
}
.erp-card h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
}
.erp-kv {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.erp-kv > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.erp-kv .n {
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.erp-kv .l {
  font-size: 12.5px;
  color: var(--erp-muted);
}

/* ---- Tables -------------------------------------------------------------- */
.erp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.erp-table th,
.erp-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--erp-border);
  vertical-align: middle;
}
.erp-table th {
  color: var(--erp-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--erp-surface-2);
  border-bottom-color: var(--erp-border-strong);
  white-space: nowrap;
}
.erp-table tbody tr:last-child td {
  border-bottom: none;
}
.erp-table tbody tr:hover {
  background: var(--pc-hover);
}
.erp-table td.num,
.erp-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--erp-mono);
}
.erp-table .empty {
  color: var(--erp-faint);
  font-style: italic;
  text-align: center;
  padding: 28px 14px;
}
.erp-table tfoot td {
  font-weight: 600;
  border-top: 2px solid var(--erp-border-strong);
  border-bottom: none;
  background: var(--erp-surface-2);
}
.erp-table tr.section td {
  font-weight: 600;
  color: var(--erp-muted);
  background: var(--erp-surface-2);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.03em;
}
.erp-table tr.subtotal td {
  font-weight: 600;
  border-top: 1px solid var(--erp-border-strong);
}
/* Total "hidup" (live) di form entry — lihat static/form-totals.js */
.erp-table tr.erp-total-row td {
  font-weight: 700;
}
.erp-table tr.erp-total-lg td {
  font-size: 1.3em;
  padding-top: 12px;
  padding-bottom: 12px;
}
.erp-table td[data-line-total] {
  color: var(--erp-muted);
  white-space: nowrap;
}
.erp-table tfoot td [data-balance] {
  font-weight: 600;
}
/* inputs/selects embedded inside table rows (e.g. PO line editor) */
.erp-table input,
.erp-table select {
  width: 100%;
  background: var(--erp-bg);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
  color: var(--erp-text);
  font: inherit;
  padding: 7px 9px;
}
.erp-table input:focus,
.erp-table select:focus {
  outline: none;
  border-color: var(--erp-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--erp-accent) 25%, transparent);
}

/* ---- Freeze panes: laporan lebar — header atas + kolom kiri tetap diam ---- */
.rpt-wrap {
  max-height: 72vh;
  overflow: auto;
}
.rpt-wrap > table.erp-table th,
.rpt-wrap > table.erp-table td {
  background: var(--erp-surface);
}
.rpt-wrap > table.erp-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--erp-surface-2);
  box-shadow: inset 0 -1px 0 var(--erp-border-strong);
}
.rpt-wrap > table.erp-table thead tr:first-child th {
  height: 34px;
}
.rpt-wrap > table.erp-table thead tr.rpt-sub th {
  top: 34px;
}
.rpt-wrap > table.erp-table th:first-child,
.rpt-wrap > table.erp-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: inset -1px 0 0 var(--erp-border);
}
.rpt-wrap > table.erp-table thead th:first-child {
  z-index: 3;
}
.rpt-wrap > table.erp-table tr.subtotal td,
.rpt-wrap > table.erp-table tr.section td,
.rpt-wrap > table.erp-table tfoot td {
  background: var(--erp-surface-2);
}
/* Pemisah kolom laporan multi-periode (mp-m antar bulan, mp-p Nilai|%) via box-shadow inset —
   BUKAN collapsed border. Collapsed border warna terang bocor menembus kolom beku kiri saat
   digeser (titik putih di garis antar baris). box-shadow ter-box di sel → ter-occlude kolom beku;
   warna tema (bukan hardcoded terang) → rapi di mode gelap & terang. */
.rpt-wrap > table.mp td.mp-m {
  box-shadow: inset 2px 0 0 var(--erp-border-strong);
}
.rpt-wrap > table.mp td.mp-p {
  box-shadow: inset 1px 0 0 var(--erp-border);
}
.rpt-wrap > table.mp thead th.mp-m {
  box-shadow: inset 2px 0 0 var(--erp-border-strong), inset 0 -1px 0 var(--erp-border-strong);
}
.rpt-wrap > table.mp thead th.mp-p {
  box-shadow: inset 1px 0 0 var(--erp-border), inset 0 -1px 0 var(--erp-border-strong);
}

/* ---- Forms --------------------------------------------------------------- */
.erp-form {
  display: grid;
  gap: 16px;
  max-width: 560px;
}
.erp-form.wide {
  max-width: none;
}
.erp-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--erp-muted);
  margin: 0 0 6px;
}
.erp-form input,
.erp-form select,
.erp-form textarea {
  width: 100%;
  background: var(--erp-bg);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
  color: var(--erp-text);
  font: inherit;
  padding: 10px 12px;
}
.erp-form input::placeholder,
.erp-form textarea::placeholder {
  color: var(--erp-faint);
}
.erp-form input:focus,
.erp-form select:focus,
.erp-form textarea:focus {
  outline: none;
  border-color: var(--erp-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--erp-accent) 25%, transparent);
}
.erp-form .row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.erp-form .hint {
  font-size: 12px;
  color: var(--erp-faint);
  margin-top: 5px;
  font-weight: 400;
}

/* ---- Combobox (type-ahead) — static/combobox.js ---- */
.cb-wrap { position: relative; }
select.cb-native { display: none; }
.cb-input {
  width: 100%;
  background: var(--erp-bg);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
  color: var(--erp-text);
  font: inherit;
  padding: 10px 12px;
}
.erp-table .cb-input { padding: 7px 9px; }
.cb-input:focus {
  outline: none;
  border-color: var(--erp-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--erp-accent) 25%, transparent);
}
.cb-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 360px;
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  background: var(--erp-surface);
  border: 1px solid var(--erp-border-strong);
  border-radius: var(--erp-radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.cb-opt {
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.cb-opt.active,
.cb-opt:hover { background: var(--erp-surface-2); }
.cb-opt.sel { color: var(--erp-accent); font-weight: 600; }

/* Utilitas: sel tabel tanpa pembungkus baris (mis. kolom Tanggal) */
.erp-table .nowrap { white-space: nowrap; }

/* ---- Buttons ------------------------------------------------------------- */
.erp-btn,
.btn-add,
.btn-ok {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  padding: 10px 16px;
  border-radius: var(--erp-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  text-decoration: none;
}
.erp-btn,
.btn-ok {
  background: var(--erp-accent);
  color: var(--erp-accent-contrast);
}
.erp-btn:hover,
.btn-ok:hover {
  filter: brightness(1.08);
  text-decoration: none;
}
.erp-btn.secondary,
.btn-add {
  background: transparent;
  color: var(--erp-text);
  border-color: var(--erp-border-strong);
}
.erp-btn.secondary:hover,
.btn-add:hover {
  background: var(--pc-hover);
  text-decoration: none;
}
.erp-btn.danger {
  background: var(--erp-danger);
  color: #fff;
}
.erp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}
.erp-btn.sm {
  padding: 6px 11px;
  font-size: 13px;
}

/* ---- Row of action buttons (list rows, detail headers) ------------------- */
.erp-act {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---- Inline "add" box (e.g. warehouse location add row) ------------------ */
.erp-addbox {
  background: var(--erp-surface-2);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  padding: 16px 18px;
  margin-top: 16px;
}
.erp-addrow {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.erp-addrow > div {
  flex: 1 1 160px;
}
.erp-addrow label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--erp-muted);
  margin: 0 0 5px;
}
.erp-addrow input,
.erp-addrow select {
  width: 100%;
  background: var(--erp-bg);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
  color: var(--erp-text);
  font: inherit;
  padding: 9px 11px;
}

/* ---- Validation / flash messages ----------------------------------------- */
.err {
  background: var(--erp-danger-bg);
  border: 1px solid color-mix(in srgb, var(--erp-danger) 45%, transparent);
  color: var(--erp-danger);
  border-radius: var(--erp-radius-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  margin: 0 0 16px;
}
.ok {
  background: var(--erp-ok-bg);
  border: 1px solid color-mix(in srgb, var(--erp-ok) 45%, transparent);
  color: var(--erp-ok);
  border-radius: var(--erp-radius-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  margin: 0 0 16px;
}

/* ---- Status pills -------------------------------------------------------- */
.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.pill.ok {
  background: var(--erp-ok-bg);
  color: var(--erp-ok);
  border: none;
  margin: 0;
  padding: 3px 10px;
}
.pill.warn {
  background: var(--erp-warn-bg);
  color: var(--erp-warn);
}
.pill.danger {
  background: var(--erp-danger-bg);
  color: var(--erp-danger);
  border: none;
  margin: 0;
  padding: 3px 10px;
}
.pill.muted {
  background: var(--pc-hover);
  color: var(--erp-muted);
}

/* ---- Topbar logout (shared across pages) --------------------------------- */
.erp-topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--erp-muted);
}
.erp-topbar-user .who {
  color: var(--erp-text);
  font-weight: 600;
}
.erp-logout {
  background: transparent;
  border: 1px solid var(--erp-border-strong);
  color: var(--erp-text);
  border-radius: var(--erp-radius-sm);
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.erp-logout:hover {
  background: var(--pc-hover);
}

/* Tipografi sidebar (hierarki kategori besar+tebal+normal / item kecil) kini jadi
   DEFAULT phoenix v1.13.1 → override app dilepas agar GTI/CGT seragam dgn LMS/RDT. */

/* --- Dashboard Analitik Visual: KPI MoM + grafik SVG inline (dep-free, peka tema) --- */
.ac-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
}
.ac-kpi {
  background: var(--erp-elevated);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ac-kpi-label { color: var(--erp-muted); font-size: 0.82rem; }
.ac-kpi-val { font-size: 1.4rem; font-weight: 700; color: var(--erp-text); line-height: 1.1; }
.ac-delta { font-size: 0.82rem; font-weight: 600; }
.ac-up { color: var(--erp-ok); }
.ac-down { color: var(--erp-danger); }
.ac-flat { color: var(--erp-muted); }

.ac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.ac-chart { width: 100%; height: auto; display: block; }
.ac-blabel { fill: var(--erp-text); font-size: 12px; }
.ac-bval { fill: var(--erp-muted); font-size: 12px; }
.ac-btrack { fill: var(--erp-border); opacity: 0.45; }
.ac-bar { fill: var(--erp-accent); }
.ac-axis { stroke: var(--erp-border); stroke-width: 1; }
.ac-xlabel { fill: var(--erp-muted); font-size: 11px; }

.ac-s1 { --ac-color: var(--erp-accent); }
.ac-s2 { --ac-color: var(--erp-ok); }
.ac-line { fill: none; stroke: var(--ac-color); stroke-width: 2; stroke-linejoin: round; }
.ac-area { fill: var(--ac-color); stroke: none; opacity: 0.14; }
.ac-legend { color: var(--ac-color, currentColor); }
