/* Administrasi Pekerjaan Lapas — gaya tampilan */

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/plex-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/plex-sans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/plex-sans-600.woff2') format('woff2');
}

:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --ink: #18212b;
  --ink-2: #374250;
  --muted: #5b6775;
  --line: #d3dae2;
  --line-2: #e5e9ee;
  --denim: #2b4c7e;
  --denim-strong: #1f3a63;
  --denim-50: #e8eef7;
  --lemon: #f2c230;
  --lemon-50: #fdf5d8;
  --ok: #1d7448;
  --ok-50: #e3f2e9;
  --warn: #855600;
  --warn-50: #fbefd3;
  --danger: #b0341a;
  --danger-50: #fbe6df;
  --contoh: #5847ad;
  --contoh-50: #ebe8fa;
  --hist: #1c6a7a;
  --hist-50: #def0f3;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sheet: 0 18px 50px rgba(24, 33, 43, 0.22);
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --side-w: 232px;
  --bottom-h: 62px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  font-weight: 600;
}

p {
  margin: 0;
}

a {
  color: var(--denim);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.num,
.tbl td.r,
.tbl th.r,
.fig-value,
.money {
  font-variant-numeric: tabular-nums;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--denim);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.print-only {
  display: none;
}

/* ---------------- Ikon ---------------- */

.ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------- Tombol ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  font-size: 14.5px;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s;
}

.btn:hover {
  background: var(--surface-2);
  border-color: #c3ccd6;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--denim);
  border-color: var(--denim);
  color: #fff;
}

.btn-primary:hover {
  background: var(--denim-strong);
  border-color: var(--denim-strong);
}

.btn-danger {
  color: var(--danger);
  border-color: #e6b9ac;
}

.btn-danger:hover {
  background: var(--danger-50);
  border-color: var(--danger);
}

.btn-danger-solid {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger-solid:hover {
  background: #922a14;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-ghost:hover {
  background: var(--denim-50);
  border-color: transparent;
}

.btn-sm {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 13.5px;
  gap: 6px;
}

.btn-sm .ico {
  width: 17px;
  height: 17px;
}

.btn-icon {
  padding: 8px;
  min-width: 40px;
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------------- Kerangka aplikasi ---------------- */

.shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side-w);
  background: var(--surface);
  border-right: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--line-2);
}

.brand-name {
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.3;
}

.brand-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.brand-mark {
  display: inline-block;
  width: 28px;
  height: 6px;
  border-radius: 3px;
  background: var(--lemon);
  margin-bottom: 10px;
}

.nav {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--surface-2);
}

.nav-item[aria-current='page'] {
  background: var(--denim-50);
  color: var(--denim-strong);
}

.nav-item[aria-current='page']::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 3px 3px 0;
  background: var(--lemon);
}

.side-user {
  border-top: 1px solid var(--line-2);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-user-info {
  flex: 1;
  min-width: 0;
}

.side-user-name {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-user-role {
  font-size: 12.5px;
  color: var(--muted);
}

.topbar {
  display: none;
}

.bottomnav {
  display: none;
}

.main {
  margin-left: var(--side-w);
  padding: 28px 32px 48px;
  max-width: calc(1180px + var(--side-w));
  outline: none;
}

/* ---------------- Kepala halaman ---------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-title {
  font-size: 23px;
  letter-spacing: -0.01em;
}

.page-desc {
  color: var(--muted);
  margin-top: 4px;
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab {
  padding: 10px 14px 9px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--ink);
}

.tab[aria-selected='true'] {
  color: var(--denim-strong);
  border-bottom-color: var(--lemon);
}

/* ---------------- Kartu & panel ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.card + .card {
  margin-top: 16px;
}

.dash-grid > .card,
.settings-grid > .card {
  margin-top: 0;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.card-title {
  font-size: 16.5px;
}

.card-note {
  font-size: 13px;
  color: var(--muted);
}

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.notice .ico {
  margin-top: 1px;
}

.notice-contoh {
  background: var(--contoh-50);
  color: #3e3184;
  border-color: #d8d2f5;
}

.notice-warn {
  background: var(--warn-50);
  color: #5f3e00;
  border-color: #f0dca8;
}

.notice-info {
  background: var(--denim-50);
  color: var(--denim-strong);
  border-color: #cfdcef;
}

.notice-danger {
  background: var(--danger-50);
  color: #7e2410;
  border-color: #f0c4b7;
}

.notice a {
  color: inherit;
  font-weight: 500;
}

/* ---------------- Lencana ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: middle;
}

.b-ok {
  background: var(--ok-50);
  color: var(--ok);
}

.b-warn {
  background: var(--warn-50);
  color: var(--warn);
}

.b-danger {
  background: var(--danger-50);
  color: var(--danger);
}

.b-contoh {
  background: var(--contoh-50);
  color: var(--contoh);
}

.b-hist {
  background: var(--hist-50);
  color: var(--hist);
}

.b-muted {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line-2);
}

.badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ---------------- Dashboard ---------------- */

.periode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink-2);
  white-space: nowrap;
}

.chip:hover {
  border-color: #b9c3cf;
}

.chip[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.periode-text {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 8px;
}

.custom-range {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-top: 12px;
}

.custom-range .field {
  margin: 0;
  width: 170px;
}

.tally {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.tally-cell {
  padding: 18px 20px 16px;
  border-right: 1px solid var(--line-2);
  text-decoration: none;
  color: inherit;
  display: block;
}

.tally-cell:last-child {
  border-right: 0;
}

a.tally-cell:hover {
  background: var(--surface-2);
}

.fig-label {
  font-size: 13.5px;
  color: var(--muted);
}

.fig-value {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 4px;
}

.fig-unit {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0;
}

.fig-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.tally-cell.is-key .fig-num {
  text-decoration: underline;
  text-decoration-color: var(--lemon);
  text-decoration-thickness: 5px;
  text-underline-offset: 6px;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.ledger {
  width: 100%;
  border-collapse: collapse;
}

.ledger td {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
  vertical-align: top;
}

.ledger tr:last-child td {
  border-bottom: 0;
}

.ledger td.money {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
  padding-left: 12px;
}

.ledger .sub {
  font-size: 13px;
  color: var(--muted);
}

.ledger tr.total td {
  border-top: 2px solid var(--ink);
  border-bottom: 0;
  font-weight: 600;
  padding-top: 12px;
}

.quick {
  display: grid;
  gap: 8px;
}

.quick .btn {
  justify-content: flex-start;
  min-height: 48px;
  font-size: 15px;
}

/* ---------------- Toolbar & filter ---------------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.search {
  position: relative;
  flex: 1 1 260px;
  max-width: 420px;
}

.search .ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  width: 18px;
  height: 18px;
}

.search .input {
  padding-left: 38px;
}

.filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}

.filter-panel .field {
  margin: 0;
  min-width: 160px;
  flex: 0 1 190px;
}

.count-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--lemon);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
}

.list-summary {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 2px 8px;
}

.list-summary strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------------- Tabel ---------------- */

.tbl-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tbl th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}

.tbl td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: top;
}

.tbl tbody tr:last-child td {
  border-bottom: 0;
}

.tbl tbody tr:hover td {
  background: #fafbfc;
}

.tbl .r {
  text-align: right;
  white-space: nowrap;
}

.tbl .nowrap {
  white-space: nowrap;
}

.tbl tfoot td {
  font-weight: 600;
  border-top: 2px solid var(--line);
  border-bottom: 0;
  background: var(--surface-2);
}

.tbl .cell-actions {
  white-space: nowrap;
  text-align: right;
}

.tbl .cell-actions .btn + .btn {
  margin-left: 4px;
}

@media screen and (min-width: 900px) {
  /* Kolom aksi tetap terlihat walau tabel digeser ke samping */
  .tbl td.cell-actions,
  .tbl th.col-actions {
    position: sticky;
    right: 0;
    background: var(--surface);
    border-left: 1px solid var(--line-2);
  }

  .tbl th.col-actions {
    background: var(--surface-2);
  }

  .tbl tbody tr:hover td.cell-actions {
    background: #fafbfc;
  }

  .btn-ikon-desktop .lbl {
    display: none;
  }

  .btn-ikon-desktop {
    padding-left: 8px;
    padding-right: 8px;
  }
}

.row-title {
  font-weight: 600;
}

.btn-link-row {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.btn-link-row:hover .row-title {
  color: var(--denim);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-block + .btn-row {
  margin-top: 8px;
}

.row-sub {
  font-size: 13px;
  color: var(--muted);
}

.row-new td {
  animation: rowflash 2.4s ease-out;
}

@keyframes rowflash {
  0% {
    background: var(--lemon-50);
  }
  100% {
    background: transparent;
  }
}

.progress {
  height: 6px;
  background: var(--line-2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
  min-width: 80px;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--denim);
}

.progress.done > span {
  background: var(--ok);
}

.empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
}

.empty strong {
  display: block;
  color: var(--ink);
  font-size: 15.5px;
  margin-bottom: 4px;
}

.empty .btn {
  margin-top: 14px;
}

.more {
  display: flex;
  justify-content: center;
  padding: 14px 0 0;
}

.loading {
  padding: 40px 0;
  color: var(--muted);
  text-align: center;
}

.error-box {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--danger-50);
  color: #7e2410;
}

.selisih-pos {
  color: var(--danger);
}

.selisih-neg {
  color: var(--hist);
}

/* ---------------- Formulir ---------------- */

.field {
  margin-bottom: 14px;
}

.field > label,
.field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--ink-2);
}

.opt {
  font-weight: 400;
  color: var(--muted);
}

.input,
.field input[type='text'],
.field input[type='password'],
.field input[type='email'],
.field select,
.field textarea,
.search input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 16px;
  line-height: 1.35;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235b6775' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search input:focus {
  outline: none;
  border-color: var(--denim);
  box-shadow: 0 0 0 3px rgba(43, 76, 126, 0.16);
}

.field input[readonly] {
  background: var(--surface-2);
}

.field.has-err input,
.field.has-err select,
.field.has-err textarea {
  border-color: var(--danger);
}

.field-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
}

.field-err {
  font-size: 13px;
  color: var(--danger);
  margin-top: 5px;
}

.field-err:empty {
  display: none;
}

.input-affix {
  position: relative;
}

.input-affix .affix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}

.input-affix .affix-pre {
  left: 12px;
}

.input-affix .affix-post {
  right: 12px;
}

.input-affix.has-pre input {
  padding-left: 38px;
}

.input-affix.has-post input {
  padding-right: 46px;
}

.field input.num {
  text-align: right;
}

.datefield {
  position: relative;
}

.datefield input[type='text'] {
  padding-right: 46px;
}

.datefield-btn {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-left: 1px solid var(--line-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  overflow: hidden;
}

.datefield-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
  margin: 0;
}

.datefield-native::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 14px;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.seg label {
  position: relative;
  margin: 0;
}

.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.seg span {
  display: block;
  padding: 9px 16px;
  font-weight: 500;
  font-size: 14.5px;
  color: var(--muted);
  min-height: 42px;
  line-height: 24px;
}

.seg label + label span {
  border-left: 1px solid var(--line);
}

.seg input:checked + span {
  background: var(--ink);
  color: #fff;
}

.seg input:focus-visible + span {
  outline: 2px solid var(--denim);
  outline-offset: -3px;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 14.5px;
}

.check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--denim);
  flex-shrink: 0;
}

.field > label.check {
  display: flex;
  font-weight: 400;
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 0;
}

.check-sub {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.calc {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 2px 0 16px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 14px;
}

.calc-row span:first-child {
  color: var(--muted);
}

.calc-row strong {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}

.calc-row.total {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 8px;
}

.calc-note {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
}

.subbox {
  border-left: 3px solid var(--hist);
  background: #f7fbfc;
  padding: 12px 14px 2px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 4px 0 14px;
}

.subbox.periksa {
  border-left-color: var(--danger);
  background: #fdf8f6;
}

.form-err {
  margin-bottom: 14px;
}

.form-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 6px 0 10px;
}

.audit {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.55;
}

.job-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: -4px 0 14px;
}

.job-info div {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.job-info span {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
}

.job-info strong {
  font-variant-numeric: tabular-nums;
}

.file-current {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 14px;
}

.field input[type='file'] {
  display: block;
  width: 100%;
  font-size: 14px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

/* ---------------- Lembar formulir (sheet/modal) ---------------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 33, 43, 0.46);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadein 0.14s ease-out;
}

.sheet {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sheet);
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  animation: rise 0.18s ease-out;
}

.sheet-wide {
  width: min(860px, 100%);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px 20px;
  border-bottom: 1px solid var(--line-2);
}

.sheet-title {
  font-size: 17px;
}

.sheet-body {
  padding: 18px 20px 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.sheet-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.sheet-foot .spacer {
  flex: 1;
}

.dl {
  display: grid;
  grid-template-columns: minmax(130px, 38%) 1fr;
  gap: 0;
  margin: 0 0 14px;
  font-size: 14.5px;
}

.dl dt,
.dl dd {
  padding: 8px 0;
  border-bottom: 1px solid var(--line-2);
  margin: 0;
}

.dl dt {
  color: var(--muted);
  padding-right: 12px;
}

.dl dd {
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

@keyframes fadein {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
}

/* ---------------- Toast ---------------- */

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(520px, calc(100% - 24px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 14.5px;
  box-shadow: 0 10px 30px rgba(24, 33, 43, 0.25);
  animation: rise 0.18s ease-out;
}

.toast.err {
  background: var(--danger);
}

.toast-msg {
  flex: 1;
}

.toast-act {
  background: none;
  border: 0;
  color: var(--lemon);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: none;
}

/* ---------------- Login ---------------- */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 28px 26px 22px;
}

.auth-card .brand-mark {
  width: 36px;
  height: 7px;
}

.auth-title {
  font-size: 21px;
  letter-spacing: -0.01em;
}

.auth-sub {
  color: var(--muted);
  margin: 4px 0 22px;
  font-size: 14.5px;
}

.pw-wrap {
  position: relative;
}

.pw-wrap input {
  padding-right: 76px !important;
}

.pw-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--denim);
  font-weight: 500;
  font-size: 13.5px;
  padding: 8px 10px;
  cursor: pointer;
}

/* ---------------- Laporan ---------------- */

.report-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.report-filters .field {
  margin: 0;
  flex: 0 1 180px;
  min-width: 150px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.biaya-sum {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.biaya-sum > div {
  padding: 14px 16px;
  border-right: 1px solid var(--line-2);
}

.biaya-sum > div:last-child {
  border-right: 0;
  background: var(--ink);
  color: #fff;
}

.biaya-sum > div:last-child .fig-label {
  color: #c9d2dc;
}

.biaya-sum .fig-value {
  font-size: 22px;
}

.report-notes {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}

.report-notes li + li {
  margin-top: 2px;
}

.section-gap {
  margin-top: 16px;
}

details.rincian {
  margin-top: 12px;
}

details.rincian > summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--denim);
  font-size: 14px;
  padding: 6px 0;
  list-style: none;
}

details.rincian > summary::-webkit-details-marker {
  display: none;
}

details.rincian > summary::before {
  content: '+ ';
}

details.rincian[open] > summary::before {
  content: '− ';
}

.print-head {
  margin-bottom: 14px;
}

/* ---------------- Pengaturan ---------------- */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 980px;
  gap: 16px;
}

.add-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 12px;
}

.add-row .field {
  margin: 0;
  flex: 1 1 140px;
}

.add-row .btn {
  min-height: 44px;
}

/* ======================= Ponsel ======================= */

@media screen and (max-width: 899px) {
  .sidebar {
    display: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top));
    background: var(--surface);
    border-bottom: 1px solid var(--line-2);
  }

  .topbar-title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-title .brand-mark {
    width: 18px;
    height: 5px;
    margin: 0 8px 3px 0;
    vertical-align: middle;
  }

  .bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: var(--surface);
    border-top: 1px solid var(--line-2);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bnav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: var(--bottom-h);
    padding: 6px 0 5px;
    color: var(--muted);
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
    overflow: hidden;
  }

  .bnav-item .ico {
    width: 22px;
    height: 22px;
  }

  .bnav-item span {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
  }

  .bnav-item[aria-current='page'] {
    color: var(--denim-strong);
  }

  .bnav-item[aria-current='page']::before {
    content: '';
    position: absolute;
    top: 0;
    left: 22%;
    right: 22%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--lemon);
  }

  .main {
    margin-left: 0;
    padding: 18px 14px calc(var(--bottom-h) + 28px + env(safe-area-inset-bottom));
  }

  .page-title {
    font-size: 21px;
  }

  .dash-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .toast-root {
    bottom: calc(var(--bottom-h) + 14px + env(safe-area-inset-bottom));
  }
}

@media screen and (max-width: 719px) {
  .card {
    padding: 16px 14px;
    border-radius: 10px;
  }

  .tally {
    grid-template-columns: 1fr 1fr;
  }

  .tally-cell {
    padding: 14px 14px 12px;
  }

  .tally-cell:nth-child(2) {
    border-right: 0;
  }

  .tally-cell.is-key {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line-2);
    border-right: 0;
  }

  .fig-value {
    font-size: 27px;
  }

  .biaya-sum {
    grid-template-columns: 1fr 1fr;
  }

  .biaya-sum > div:nth-child(2) {
    border-right: 0;
  }

  .biaya-sum > div:nth-child(n + 3) {
    border-top: 1px solid var(--line-2);
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .search {
    max-width: none;
    flex-basis: 100%;
  }

  .toolbar .btn-add {
    flex: 1;
  }

  .filter-panel .field,
  .report-filters .field {
    flex: 1 1 140px;
  }

  .report-actions {
    margin-left: 0;
    width: 100%;
  }

  .report-actions .btn {
    flex: 1;
  }

  .sheet-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .sheet {
    width: 100%;
    max-height: calc(100% - 24px);
    border-radius: 16px 16px 0 0;
  }

  .sheet-body {
    padding: 16px 16px 4px;
  }

  .sheet-foot {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-radius: 0;
  }

  .sheet-foot .btn {
    flex: 1;
  }

  .sheet-foot .spacer {
    display: none;
  }

  .job-info {
    grid-template-columns: repeat(3, 1fr);
  }

  .dl {
    grid-template-columns: minmax(110px, 42%) 1fr;
  }
}

/* Laptop kecil: sembunyikan kolom sekunder (tetap ada di Detail & Laporan) */
@media screen and (min-width: 900px) and (max-width: 1199px) {
  .tbl .col-md {
    display: none;
  }

  .btn-ikon-md .lbl {
    display: none;
  }

  .btn-ikon-md {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* Tabel menjadi daftar bertumpuk di HP & tablet (layar saja, bukan cetak) */
@media screen and (max-width: 899px) {
  .tbl-wrap {
    overflow: visible;
  }

  .tbl.stack thead {
    display: none;
  }

  .tbl.stack,
  .tbl.stack tbody,
  .tbl.stack tfoot,
  .tbl.stack tr,
  .tbl.stack td {
    display: block;
    width: 100%;
  }

  .tbl.stack tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-2);
  }

  .tbl.stack tbody tr:last-child {
    border-bottom: 0;
  }

  .tbl.stack td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 3px 0;
    border: 0;
    text-align: right;
    background: transparent !important;
  }

  .tbl.stack td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 13px;
    text-align: left;
    flex-shrink: 0;
  }

  .tbl.stack td.cell-main {
    display: block;
    text-align: left;
    padding-bottom: 6px;
  }

  .tbl.stack td > .cv {
    min-width: 0;
    text-align: right;
  }

  .tbl.stack td.cell-main > .cv {
    text-align: left;
  }

  .tbl.stack td.cell-main::before,
  .tbl.stack td.cell-actions::before,
  .tbl.stack td:empty {
    display: none;
  }

  .tbl.stack td.cell-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
  }

  .tbl.stack td.cell-actions .btn + .btn {
    margin-left: 0;
  }

  .tbl.stack tfoot tr {
    border-top: 2px solid var(--line);
  }

  .tbl.stack tfoot td.cell-main::before {
    display: none;
  }
}

@media screen and (max-width: 380px) {
  .bnav-item {
    font-size: 9.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ======================= Cetak / PDF ======================= */

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  body {
    background: #fff;
    font-size: 10pt;
    color: #000;
  }

  .sidebar,
  .topbar,
  .bottomnav,
  .toast-root,
  .no-print,
  .sheet-backdrop {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .main {
    margin: 0;
    padding: 0;
    max-width: none;
  }

  .card,
  .tbl-wrap,
  .biaya-sum {
    border: 1px solid #bbb;
    border-radius: 0;
    box-shadow: none;
  }

  .card {
    padding: 8px 10px;
    break-inside: auto;
  }

  .card + .card,
  .section-gap {
    margin-top: 10px;
  }

  .tbl {
    font-size: 8.5pt;
  }

  .tbl th,
  .tbl td {
    padding: 3px 5px;
  }

  .tbl th {
    background: #eee !important;
    color: #000;
  }

  .tbl tr {
    break-inside: avoid;
  }

  .tbl thead {
    display: table-header-group;
  }

  .biaya-sum > div:last-child {
    background: #fff;
    color: #000;
  }

  .biaya-sum > div:last-child .fig-label {
    color: #333;
  }

  .fig-value {
    font-size: 15pt;
  }

  .badge {
    border: 1px solid #999;
    background: #fff !important;
    color: #000 !important;
  }

  details.rincian > summary {
    color: #000;
    font-weight: 600;
    font-size: 9pt;
    padding: 2px 0;
  }

  details.rincian > summary::before,
  details.rincian[open] > summary::before {
    content: '';
  }

  .row-sub {
    font-size: 8pt;
  }

  a {
    color: #000;
    text-decoration: none;
  }
}
