/* GS SDI — Operate UI. Identitas: ungu SDI + aksen merah, permukaan terang. */
:root {
  --brand: #2f1c5e;
  --brand-2: #45307f;
  --brand-ink: #241548;
  --accent: #e3173e;
  --accent-ink: #c0102f;

  --bg: #f4f3f7;
  --surface: #ffffff;
  --surface-2: #faf9fc;
  --tint: #f1eef8;
  --text: #1d1a26;
  --text-2: #4a4558;
  --muted: #6b6779;
  --line: #e5e2eb;
  --line-strong: #cfcad9;

  --ok: #13683f;
  --ok-bg: #e5f3eb;
  --warn: #7f5200;
  --warn-bg: #fff3d6;
  --err: #b4232f;
  --err-bg: #fde8ea;
  --ot-bg: #f3effc;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(30, 20, 60, .05), 0 3px 10px -4px rgba(30, 20, 60, .08);
  --focus: 0 0 0 3px rgba(69, 48, 127, .28);
  --ease: cubic-bezier(.16, 1, .3, 1);

  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
  accent-color: var(--brand-2);
  scrollbar-color: #c9c3d6 transparent;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
::selection { background: rgba(69, 48, 127, .2); color: var(--brand-ink); }
input, select, textarea { caret-color: var(--brand-2); }
a { color: var(--brand-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand); }
h1 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -.01em; margin: 0 0 .3rem; color: var(--brand-ink); text-wrap: balance; }
h2 { font-size: 1.05rem; line-height: 1.3; margin: 0 0 .85rem; color: var(--brand-ink); }
h3 { font-size: .95rem; margin: 0 0 .5rem; color: var(--brand-ink); }
p { margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: none; box-shadow: var(--focus); }

.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--brand); color: #fff; padding: .5rem .9rem; border-radius: var(--radius-sm); transition: top .15s var(--ease); }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: none; background: var(--brand); color: #fff; display: flex; flex-direction: column; padding: 1rem .7rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-color: rgba(255,255,255,.2) transparent; }
.brand { display: flex; align-items: center; gap: .7rem; padding: .2rem .45rem 1rem; margin-bottom: .6rem; border-bottom: 1px solid rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-tile { width: 60px; height: 42px; flex: none; background: #fff; border-radius: 8px; display: grid; place-items: center; padding: 4px 6px; }
.brand-tile img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-weight: 650; font-size: .95rem; line-height: 1.2; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: rgba(255,255,255,.55); padding: 1.1rem .75rem .35rem; }
.nav-link { display: flex; align-items: center; gap: .65rem; padding: .5rem .75rem; border-radius: var(--radius-sm); color: rgba(255,255,255,.86); text-decoration: none; font-size: .92rem; transition: background-color .15s, color .15s; }
.nav-link .icon { opacity: .85; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; }
.nav-link.active .icon { color: #ff7b93; opacity: 1; }
.nav-link:focus-visible { box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.nav-soon { color: rgba(255,255,255,.62); }
.as-button { background: none; border: 0; width: 100%; font: inherit; cursor: pointer; text-align: left; }
.account { border-top: 1px solid rgba(255,255,255,.12); padding-top: .8rem; margin-top: .8rem; }
.who { padding: 0 .75rem .55rem; line-height: 1.3; }
.who strong { display: block; font-size: .9rem; }
.who span { font-size: .78rem; color: rgba(255,255,255,.62); }

.main { flex: 1; min-width: 0; }
.topbar { display: none; }
.content { padding: 2rem 2.25rem 3.5rem; max-width: 1180px; }
.content:focus { outline: none; box-shadow: none; }
.page-head { margin-bottom: 1.5rem; }
.page-head > .muted, .page-head > div > .muted { max-width: 70ch; }
.row-between { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 1.5rem; flex-wrap: wrap; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; margin-bottom: .5rem; text-decoration: none; color: var(--muted); }
.back-link:hover { color: var(--brand); }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.35rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.card.narrow { max-width: 460px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem 1.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2 { margin: 0 0 .1rem; }
.card-head p { margin: 0; }
.card.empty { text-align: center; padding: 2.75rem 1.5rem; }
.card.empty .icon { width: 32px; height: 32px; color: var(--brand-2); margin-bottom: .75rem; }
.card.empty p { max-width: 52ch; margin-inline: auto; }
.pill { background: var(--ot-bg); color: var(--brand-ink); font-size: .85rem; padding: .3rem .75rem; border-radius: 999px; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }

.totals { display: flex; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.totals > div { padding: .45rem .95rem; }
.totals > div + div { border-left: 1px solid var(--line); }
.totals dt { font-size: .74rem; color: var(--muted); }
.totals dd { margin: 0; font-weight: 700; font-size: 1.05rem; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.totals dd span { font-weight: 400; font-size: .78rem; color: var(--muted); margin-left: .2rem; }

/* Panel (disclosure) */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; box-shadow: var(--shadow); }
.panel > summary { list-style: none; display: flex; align-items: center; gap: .6rem; padding: .8rem 1.1rem; cursor: pointer; font-weight: 600; color: var(--brand-ink); border-radius: var(--radius); flex-wrap: wrap; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .2s var(--ease); }
.panel[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.panel > summary:hover { background: var(--surface-2); }
.panel > summary .icon { color: var(--accent); }
.summary-hint { font-weight: 400; }
.panel-body { padding: 1rem 1.1rem 1.1rem; border-top: 1px solid var(--line); }
.sub-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1.25rem 0 .4rem; }
.history { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.history li { display: flex; flex-direction: column; padding: .45rem 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; }
.file-name { font-weight: 600; color: var(--text-2); overflow-wrap: anywhere; }

/* Toolbar filter */
.toolbar { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1.1rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.toolbar .field { width: 170px; }
.toolbar .field.grow { flex: 1; min-width: 180px; width: auto; max-width: 320px; }
.grow { flex: 1; min-width: 220px; }

/* Home */
.overview { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.overview > * { margin-bottom: 0; }
.side-col { display: flex; flex-direction: column; gap: 1.25rem; }
.side-col > .card { margin-bottom: 0; }
.quick { display: flex; flex-direction: column; gap: .5rem; }
.quick a { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--text); transition: border-color .15s, background-color .15s; }
.quick a:hover { border-color: var(--brand-2); background: var(--surface-2); }
.quick a > .icon:first-child { color: var(--accent); }
.quick a > .icon:last-child { margin-left: auto; color: var(--muted); }
.quick strong { display: block; color: var(--brand-ink); font-size: .92rem; }
.quick small { display: block; font-size: .8rem; color: var(--muted); }
.roadmap { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.roadmap li { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; color: var(--text-2); }
.roadmap .icon { color: var(--muted); }

/* Shift plotting */
.shift-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.add-row { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line-strong); }

/* ---------- Forms ---------- */
.stack { display: flex; flex-direction: column; gap: .9rem; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field label { font-size: .84rem; font-weight: 600; color: var(--text-2); }
.hint { color: var(--muted); font-size: .78rem; line-height: 1.4; }
input, select { font: inherit; font-size: .93rem; padding: .5rem .7rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--text); width: 100%; min-height: 40px; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover { border-color: #b3acc2; }
input:focus, select:focus { outline: none; border-color: var(--brand-2); box-shadow: var(--focus); }
input[type=time], input[type=date] { font-variant-numeric: tabular-nums; }
input[type=file] { padding: .3rem; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-size: .85rem; font-weight: 600; color: var(--brand); background: var(--tint); border: 0; border-radius: 6px; padding: .4rem .8rem; margin-right: .75rem; cursor: pointer; }
input[type=file]:hover::file-selector-button { background: #e6e0f3; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.check input { width: 18px; height: 18px; min-height: 0; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 2.75rem; }
.pw-toggle { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; border-radius: 6px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-toggle:hover { color: var(--brand); background: var(--tint); }
.pw-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-toggle .eye-closed, .pw-toggle.is-visible .eye-open { display: none; }
.pw-toggle.is-visible .eye-closed { display: block; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; align-items: end; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 600; font-size: .9rem; padding: .5rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: #fff; color: var(--brand); text-decoration: none; cursor: pointer; min-height: 40px; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--brand-2); background: var(--surface-2); color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn-danger { color: var(--err); }
.btn-danger:hover { border-color: var(--err); background: var(--err-bg); color: var(--err); }
.btn-small { padding: .3rem .7rem; font-size: .82rem; min-height: 32px; }
.btn-small .icon { width: 15px; height: 15px; }
.btn-block { width: 100%; }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.alert { padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-size: .9rem; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: #c4e3d1; }
.alert-error { background: var(--err-bg); color: var(--err); border-color: #f6c6cc; }

.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: #eeecf2; color: var(--muted); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-brand { background: var(--tint); color: var(--brand-2); }

/* ---------- Tables ---------- */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1.35rem; padding: 0 1.35rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: .6rem .65rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table .num { text-align: right; white-space: nowrap; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.table-compact td { padding-top: .42rem; padding-bottom: .42rem; }
.table td a strong { color: var(--brand-ink); }
.row-ot td { background: var(--ot-bg); }
.table tbody tr.row-ot:hover td { background: #ebe5f8; }
.row-off td { color: #9b96a8; }
.row-warn td { background: var(--warn-bg); }
.weekend { color: var(--accent-ink); }
.actions { white-space: nowrap; text-align: right; }
.actions form { display: inline; }
.table-note { margin: .85rem 0 0; display: flex; gap: .4rem 1.25rem; flex-wrap: wrap; }
.legend { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--ot-bg); border: 1px solid #ddd3f3; display: inline-block; }
.empty-cell { color: var(--muted); font-style: italic; }

/* ---------- Login ---------- */
body.bare { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 2rem 1.75rem 1.75rem; box-shadow: 0 12px 32px -12px rgba(47, 28, 94, .22); }
.login-logo { width: 132px; height: auto; display: block; margin: 0 auto 1.1rem; }
.login-card h1 { text-align: center; font-size: 1.35rem; }
.login-card > .muted { text-align: center; margin-bottom: 1.4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-2, .overview { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .22s var(--ease); box-shadow: 8px 0 24px rgba(20, 10, 40, .25); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(20, 12, 40, .35); z-index: 20; }
  .topbar { display: flex; align-items: center; gap: .5rem; padding: .55rem 16px; background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 10; }
  .menu-toggle { background: none; border: 0; color: #fff; width: 40px; height: 40px; margin-left: -8px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
  .menu-toggle .icon { width: 22px; height: 22px; }
  .topbar-title { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-logo { width: 28px; height: 28px; border-radius: 6px; background: #fff; padding: 2px; }
  .content { padding: 1.25rem 16px 2.5rem; }
  .card { padding: 1.1rem 1rem; }
  .table-wrap { margin: 0 -1rem; padding: 0 1rem; }
  .toolbar { padding: .85rem 1rem; }
  .toolbar .field { width: calc(50% - .375rem); }
  .toolbar .field.grow { width: 100%; max-width: none; min-width: 0; flex: none; }
  .toolbar .btn { width: 100%; }
  .totals { width: 100%; }
  .totals > div { flex: 1; padding: .45rem .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
@media print {
  .sidebar, .topbar, .toolbar, .panel, .head-actions, .skip-link { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}

.err-text { color: var(--err); font-size: .85rem; }
.alert-warn-soft { background: var(--warn-bg); color: var(--warn); border-color: #f3dfa9; }

/* Kolom tabel plotting sejajar antar shift */
.table-plot { table-layout: fixed; min-width: 560px; }
.table-plot .c-no { width: 44px; }
.table-plot .c-pos { width: 22%; }
.table-plot .c-time { width: 120px; }
.table-plot .c-dur { width: 80px; }
.table-plot .c-act { width: 84px; }
@media (max-width: 760px) {
  .hide-sm { display: none; }
  .table-plot { table-layout: auto; min-width: 0; }
  .table-plot .c-pos { width: 32%; }
  .table-plot .c-time { width: 104px; }
  .table-plot .c-act { width: 76px; }
}

/* Token baru (tampil sekali) */
.token-new { border-color: #c4e3d1; background: var(--ok-bg); }
.token-value { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88rem; background: #fff; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88em; background: var(--tint); padding: .05rem .3rem; border-radius: 4px; overflow-wrap: anywhere; }

/* ---------- Petty cash ---------- */
.totals-wrap { flex-wrap: wrap; margin-bottom: 1.25rem; background: var(--surface); box-shadow: var(--shadow); }
.totals-wrap > div { flex: 1 1 140px; padding: .7rem 1rem; }
.totals-wrap dd { font-size: 1.15rem; }
.totals-wrap > div:last-child { background: var(--tint); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.neg, .totals .neg dd { color: var(--err); }
.panel-inset { box-shadow: none; background: var(--surface-2); margin-bottom: 1rem; }
.form-item { grid-template-columns: 150px minmax(200px, 2fr) 80px 130px minmax(120px, 1fr) minmax(130px, 1fr) auto; }
.field-narrow input { text-align: right; }
.list-actions li { flex-direction: row; justify-content: space-between; align-items: center; gap: .75rem; }
.add-row-top { margin: 0 0 1rem; padding: 0 0 1rem; border-top: 0; border-bottom: 1px dashed var(--line-strong); }
.bon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.bon { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.bon img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #ece9f1; }
.bon:target { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.bon figcaption { padding: .55rem .65rem; font-size: .85rem; display: flex; flex-direction: column; gap: .2rem; }
.bon figcaption form { margin-top: .3rem; }
.form-actions { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.signer-row { margin-bottom: .75rem; }
.danger-zone { border-color: #f6c6cc; }
@media (max-width: 960px) {
  .form-item { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-item .field-wide { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .totals-wrap > div { flex: 1 1 45%; }
  .totals-wrap > div + div { border-left: 0; }
  .totals-wrap > div:last-child { flex-basis: 100%; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
}
