/* Shared comfort layer: preserve ERP module layouts and semantic status colors. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link { position: fixed; top: 8px; left: 12px; z-index: 120; transform: translateY(-160%); }
.skip-link:focus { transform: none; padding: 12px 18px; border-radius: 8px; background: #fff; color: #244d40; }
@media screen {
  :root {
    --bg: #f3f5f2;
    --surface: #ffffff;
    --surface-2: #f7f9f6;
    --line: #dce3dc;
    --text: #202d28;
    --muted: #55655c;
    --primary: #2c604d;
    --primary-2: #214b3b;
    --primary-soft: #e8f1eb;
    --sidebar: #20392f;
    --green: #286642;
    --green-soft: #e8f3eb;
    --amber: #805009;
    --amber-soft: #fff4de;
    --red: #a72f30;
    --red-soft: #fceced;
    --blue: #285b91;
    --blue-soft: #eaf1fa;
    --shadow: 0 2px 8px rgba(28, 43, 34, .045);
    --focus: #21694e;
  }
  html { scroll-padding-top: 100px; }
  body { line-height: 1.5; }
  button, input, select, textarea { font-variant-numeric: tabular-nums; }
  input, textarea { caret-color: var(--primary); }
  input::placeholder, textarea::placeholder { color: #647268; opacity: 1; }
  ::selection { color: #173d2a; background: #d5e8db; }
  a { text-underline-offset: .18em; }
  :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--focus); outline-offset: 3px;
  }
  .sidebar :is(button, a):focus-visible { outline-color: #b9dfc8; outline-offset: -3px; }
  .sidebar { width: 248px; height: 100dvh; scrollbar-width: thin; scrollbar-color: #819b8c var(--sidebar); }
  .brand { padding: 22px 18px 20px; }
  .brand-name { font-size: 15px; }
  .brand-sub { color: #bdd0c3; }
  .nav-group { color: #c1d3c6; font-size: 11px; letter-spacing: .055em; }
  .nav-fav { color: #e3d6a1; }
  .nav-toggle { min-height: 40px; }
  .nav-item { min-height: 40px; color: #e0ebe3; padding: 9px 12px; font-size: 13.5px; }
  .nav-item.active { color: #fff; background: #3a5d4b; font-weight: 650; }
  .nav-item.active .nav-ico { opacity: 1; }
  .nav-item:hover { background: #304c3e; color: #fff; }
  .nav-item.active:hover { background: #3a5d4b; }
  .nav-item.is-soon, .nav-item em { color: #c1d3c6; }
  .nav-item.active.is-hidden { padding: 9px 12px; }
  .nav-item.is-hidden:not(.active) { min-height: 0; }
  .sidebar-foot { color: #bbcec1; border-top-color: #42604e; line-height: 1.6; }
  .topbar { gap: 12px; background: var(--surface); padding: 16px 26px; }
  .topbar h1 { font-size: 21px; letter-spacing: -.025em; line-height: 1.35; }
  .view { padding: 24px 26px 80px; }
  .page-actions { align-items: center; }
  .page-actions > :is(button, a, select, input) { max-width: 100%; }
  .btn { min-height: 38px; padding: 8px 13px; line-height: 1.35; }
  .btn-sm { min-height: 32px; padding: 5px 10px; }
  .icon-btn { min-width: 32px; min-height: 32px; line-height: 1.2; }
  .btn:active:not(:disabled), .icon-btn:active:not(:disabled) { transform: translateY(1px); }
  .btn-primary { background: var(--primary); border-color: var(--primary); }
  .btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
  .btn-danger { background: var(--red); border-color: var(--red); }
  .fld { gap: 6px; color: #45564a; }
  :is(.fld, .toolbar) > :is(input, select, textarea) { min-height: 40px; }
  .fld small, .fld .muted { font-weight: 400; }
  .toolbar { gap: 10px; margin-bottom: 18px; }
  .toolbar > *, .grid-2 > *, .dash-grid > *, .settings-grid > *, .master-grid > * { min-width: 0; }
  .tabs { gap: 4px; overflow-y: hidden; }
  .tabs .tab { min-height: 40px; }
  .tabs .tab:focus-visible { outline-offset: -3px; }
  .tbl { font-variant-numeric: tabular-nums; }
  .tbl th { color: #475a4c; font-size: 12px; letter-spacing: .035em; padding-block: 12px; }
  .tbl td { padding-block: 12px; }
  .tbl .mono { letter-spacing: .01em; }
  .prow:hover td { background: #f0f6f0; }
  .table-card, .card, .kpi { box-shadow: none; }
  .table-card, .table-scroll, .tbl-wrap { scrollbar-width: thin; scrollbar-color: #96aa99 var(--surface-2); }
  .badge { line-height: 1.6; }
  .alert { border-color: #ddc58e; line-height: 1.65; }
  .alert a { color: #3c573d; }
  .empty p { line-height: 1.7; }
  .empty.big { padding-block: 44px; }
  .modal-head { gap: 14px; }
  .modal-head h3 { line-height: 1.4; overflow-wrap: anywhere; }
  .modal-head .icon-btn { flex-shrink: 0; }
  .modal-foot { gap: 10px; }
  .modal-wrap { overscroll-behavior: contain; }
  body.has-modal { overflow: hidden; }
  .toasts { max-width: min(420px, calc(100vw - 32px)); bottom: max(20px, env(safe-area-inset-bottom)); }
  .toast { max-width: 100%; overflow-wrap: anywhere; }
  .dash-kpis .kpi, .dash-kpis > a { box-shadow: none; }
  .hc-fab { box-shadow: 0 4px 12px rgba(28, 43, 34, .16); opacity: 1; }
}
@media screen and (max-width: 820px) {
  .sidebar { width: min(288px, calc(100vw - 48px)); }
  body.nav-open { overflow: hidden; }
  .nav-item { min-height: 44px; }
  .nav-toggle { min-height: 44px; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar h1 { font-size: 20px; }
  .view { padding: 20px 16px 80px; }
  .page-actions { width: 100%; margin-left: 0; gap: 8px; }
  .page-actions > :is(input, select) { flex: 1 1 130px; min-width: 0; }
  :is(.btn, .btn-sm, .icon-btn, .tab, .chip) { min-height: 44px; }
  .icon-btn { min-width: 44px; }
  .menu-toggle { margin-left: -8px; }
  :is(.view, .modal, .ss-panel) :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
    font-size: 16px; min-height: 44px;
  }
  .toolbar { align-items: stretch; }
  .toolbar > :is(input, select, .ss-search) { flex: 1 1 160px; max-width: 100%; min-width: 0; }
  .modal-wrap { padding: 16px 10px; }
  .modal-head, .modal-body, .modal-foot { padding-inline: 16px; }
  .modal-foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .toasts { left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .toast { width: 100%; }
  .ss-result { min-height: 44px; }
}
@media screen and (max-width: 480px) {
  .page-actions > .btn { white-space: normal; text-align: left; }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; white-space: normal; }
  .card { padding: 16px; }
  .empty.big { padding: 32px 18px; }
  .scp-list li { grid-template-columns: 44px minmax(0, 1fr) 44px 44px; padding: 8px 4px; }
  .scp-list .icon-btn { width: 44px; min-height: 44px; }
  .scp-list .scp-circ { gap: 8px; }
  .scp-add { flex-wrap: wrap; }
  .scp-add input[name=label] { flex-basis: 100%; min-width: 0; }
  .ho-photos { grid-template-columns: minmax(0, 1fr); }
  .ho-ph { min-width: 0; }
  .ho-ph .btn { justify-content: center; white-space: normal; }
  .rp-bars { overflow-x: auto; overflow-y: hidden; }
  .rp-bar { flex: 1 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .modal-wrap, .modal, .toast { transition: none; }
  .toast { transform: none; }
}
@media (forced-colors: active) {
  .btn, .icon-btn, .tab, .chip { border: 1px solid ButtonText; }
  .nav-item.active { outline: 2px solid Highlight; outline-offset: -2px; }
}
@media print { .skip-link, #route-status { display: none !important; } }

/* v10.0.58 form di jendela (modal) lebih rapi, terutama di HP:
   - label + keterangan "(opsional)" satu baris, kolom isian selalu selebar form (tidak keluar garis tepi)
   - kolom tanggal di iPhone/iPad tidak melebar keluar modal & rata kiri
   - judul kelompok (optgroup) tampil di kotak pencarian pilihan */
.modal .fld { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 4px; min-width: 0; }
.modal .fld > :is(input, select, textarea, .money-in, .ss-search, div, p, small, ul, ol, table, .row-gap) { flex: 1 0 100%; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.modal :is(.grid-2, .grid-3, .grid-4) > * { min-width: 0; }
.modal .money-in { min-width: 0; }
.modal .money-in input { flex: 1 1 auto; width: 100%; min-width: 0; }
.modal select { text-overflow: ellipsis; }
@supports (-webkit-touch-callout: none) {
  :is(.modal, .view) input:is([type=date], [type=month], [type=time], [type=datetime-local]) {
    -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; text-align: left; min-height: 44px; background: var(--surface, #fff);
  }
  :is(.modal, .view) input::-webkit-date-and-time-value { text-align: left; }
}
.ss-group { padding: 8px 12px 4px; font-size: 12px; font-weight: 600; color: var(--muted, #5f6f66); text-transform: none; position: sticky; top: -4px; background: #fff; z-index: 1; }
/* v10.0.58 kotak Rupiah: garis fokus di bingkai luar (bukan di input dalam yang keluar bingkai & menutupi "Rp") */
.money-in input:is(:focus, :focus-visible) { outline: none; box-shadow: none; }
.money-in:focus-within { border-color: var(--primary); outline: 3px solid var(--focus, #21694e); outline-offset: 2px; }
/* v10.0.58 pilihan di modal: input/select dengan garis fokus tidak melebihi tepi modal */
.modal :is(input, select, textarea):focus-visible { outline-offset: 1px; }
