:root {
  --ink: #12263a;
  --ink-soft: #37506b;
  --muted: #6b7c8f;
  --paper: #f4f1ea;
  --card: #fffdf8;
  --line: #e2ddd2;
  --line-strong: #cfc7b8;
  --teal: #0e7c7b;
  --teal-soft: #e2f1ef;
  --amber: #b7791f;
  --amber-soft: #fbf1dd;
  --rose: #b03a3a;
  --rose-soft: #fbe8e6;
  --slate: #4a5b6d;
  --shadow: 0 1px 2px rgba(18, 38, 58, .06), 0 8px 24px -18px rgba(18, 38, 58, .35);
  --radius: 14px;
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: var(--ink);
  color: #e9eef3;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 26px; }
.brand-logo {
  height: 44px; width: auto; padding: 5px 7px; border-radius: 9px;
  background: #fff; object-fit: contain;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #1c9c96, #0e6b74);
  color: #fff; font-weight: 800; font-size: 19px; letter-spacing: -.03em;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 15px; }
.brand-copy small { color: #8fa3b8; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px;
  color: #b9c8d6; font-weight: 500; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.side-nav a svg { width: 17px; height: 17px; opacity: .9; }
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.active { background: rgba(28, 156, 150, .18); color: #7be0d8; box-shadow: inset 0 0 0 1px rgba(123, 224, 216, .18); }

.side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .09); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #21405c; color: #cfe3f2;
  display: grid; place-items: center; font-weight: 650; font-size: 13px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-meta strong { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { font-size: 10.5px; color: #8fa3b8; text-transform: uppercase; letter-spacing: .06em; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 26px 32px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #faf8f3, var(--paper));
  position: sticky; top: 0; z-index: 20;
}
.eyebrow { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-bottom: 3px; }
.topbar h1 { font-size: 25px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.range-chip {
  font-size: 12px; font-weight: 550; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--ink-soft);
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }

.view { padding: 24px 32px 56px; max-width: 1240px; width: 100%; }

.bottom-nav { display: none; }

.icon-btn[hidden] { display: none; }

/* ---------- login ---------- */
body.logged-out .sidebar,
body.logged-out .bottom-nav,
body.logged-out .topbar { display: none; }
body.logged-out .view { max-width: 460px; margin: 0 auto; padding: 9vh 20px 40px; }
.login-card { display: flex; flex-direction: column; }
.login-card > img { height: 52px; width: auto; align-self: flex-start; margin-bottom: 18px; }
.login-card h2 { font-size: 20px; margin-bottom: 4px; }
.login-card .kpi-sub { margin-bottom: 18px; }
.login-card .field { margin-bottom: 12px; }
.login-card .btn { width: 100%; padding: 10px 14px; }
.login-card .form-err { min-height: 18px; margin: 0 0 8px; font-size: 12px; color: var(--rose); }
.login-card code { font-family: var(--mono); font-size: 11.5px; background: #f0ece2; padding: 1px 4px; border-radius: 4px; }

/* ---------- primitives ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14px; }
.card-head p { font-size: 11.5px; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-strong); background: var(--card);
  padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: .15s;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--slate); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #1b3a55; border-color: #1b3a55; }
.btn-teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-teal:hover { background: #0b6a69; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(18, 38, 58, .05); }
.btn-danger { color: var(--rose); border-color: #e7c3bf; background: #fff8f7; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 650;
  letter-spacing: .03em; text-transform: uppercase;
  background: #eef0f3; color: var(--slate); white-space: nowrap;
}
.badge.draft { background: #edf0f3; color: #55677a; }
.badge.submitted { background: var(--amber-soft); color: var(--amber); }
.badge.approved { background: var(--teal-soft); color: var(--teal); }
.badge.rejected { background: var(--rose-soft); color: var(--rose); }
.badge.teal { background: var(--teal-soft); color: var(--teal); }

.tabs { display: inline-flex; background: #eae6dc; border-radius: 10px; padding: 3px; gap: 2px; }
.tabs button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.tabs button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(18, 38, 58, .12); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- filters ---------- */
.filterbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); margin-bottom: 18px;
}
.filterbar .seg { display: inline-flex; background: #eee9de; border-radius: 9px; padding: 2px; }
.filterbar .seg button {
  border: 0; background: transparent; padding: 6px 11px; border-radius: 7px;
  font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.filterbar .seg button.active { background: var(--ink); color: #fff; }
.filterbar .custom { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.filterbar .custom.hidden { display: none; }

/* ---------- KPI ---------- */
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #f0ece2; color: var(--ink-soft); }
.kpi-icon.teal { background: var(--teal-soft); color: var(--teal); }
.kpi-icon.amber { background: var(--amber-soft); color: var(--amber); }
.kpi-value { font-size: 27px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi-sub { font-size: 11.5px; color: var(--muted); }
.kpi-bar { height: 5px; border-radius: 999px; background: #ece7db; overflow: hidden; }
.kpi-bar span { display: block; height: 100%; background: var(--teal); border-radius: 999px; }

/* ---------- lists / bars ---------- */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 74px; align-items: center; gap: 12px; font-size: 12.5px; }
.bar-row .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.bar-track { height: 7px; background: #ece7db; border-radius: 999px; overflow: hidden; }
.bar-track span { display: block; height: 100%; background: linear-gradient(90deg, #1c9c96, #0e7c7b); border-radius: 999px; }
.bar-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 11.5px; }

.ledger { display: flex; flex-direction: column; }
.ledger-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 20px; border-top: 1px solid var(--line); font-size: 13px; }
.ledger-row:first-child { border-top: 0; }
.ledger-row .label { color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.ledger-row .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--slate); }
.ledger-row .dot.teal { background: var(--teal); }
.ledger-row .dot.amber { background: var(--amber); }
.ledger-row .dot.rose { background: var(--rose); }
.ledger-row .amount { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.8px; }
table.data th {
  text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 650; padding: 10px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: #faf7f0;
}
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fcfaf5; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .muted { color: var(--muted); }

/* ---------- calendar ---------- */
.cal-card { overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cal-title { display: flex; align-items: center; gap: 10px; }
.cal-title h2 { font-size: 17px; }
.cal-nav { display: flex; gap: 6px; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); background: #faf7f0; border-bottom: 1px solid var(--line); }
.cal-dow span { padding: 7px 0; text-align: center; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell {
  min-width: 0;
  min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--card); cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  transition: background .12s;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: #fdfbf6; }
.cal-cell.out { background: #f7f4ed; color: #a9b4bf; }
.cal-cell.today { background: #f2faf9; box-shadow: inset 0 0 0 2px rgba(14, 124, 123, .35); }
.cal-day { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; font-weight: 650; color: var(--ink-soft); }
.cal-day .plus { opacity: 0; font-size: 14px; color: var(--teal); }
.cal-cell:hover .plus { opacity: 1; }
.plan-chip {
  display: block; max-width: 100%; font-size: 10.5px; line-height: 1.3; padding: 3px 6px; border-radius: 5px;
  background: var(--teal-soft); color: #0b5b5a; border-left: 2px solid var(--teal);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plan-chip.done { background: #eef1f3; color: #6a7a89; border-left-color: #9aa8b5; text-decoration: line-through; }
.plan-chip.more { background: transparent; color: var(--muted); border-left: 0; padding-left: 2px; }

/* ---------- request cards ---------- */
.req-list { display: flex; flex-direction: column; gap: 10px; }
.req-card {
  display: grid; grid-template-columns: 1fr auto; gap: 12px 18px; align-items: center;
  padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.req-card:hover { border-color: var(--line-strong); }
.req-main { min-width: 0; }
.req-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-weight: 600; font-size: 13.5px; }
.req-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.req-side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.req-amount { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; }
.req-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > label { font-size: 11.5px; font-weight: 650; color: var(--ink-soft); letter-spacing: .02em; }
.field .hint { font-size: 11px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line-strong); background: #fffefb;
  border-radius: 9px; padding: 9px 11px; font-size: 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 124, 123, .12); }
textarea.input { resize: vertical; min-height: 74px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.money-input { font-variant-numeric: tabular-nums; text-align: right; }

.items-head, .item-row {
  display: grid; grid-template-columns: 118px 130px 1fr 108px 108px 100px 34px;
  gap: 6px; align-items: center;
}
.items-head { padding: 0 2px 6px; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.item-row { margin-bottom: 6px; }
.item-row .input { padding: 7px 8px; font-size: 12.5px; }
.item-row .remove { border: 0; background: transparent; color: var(--rose); cursor: pointer; padding: 4px; border-radius: 6px; }
.item-row .remove:hover { background: var(--rose-soft); }
.items-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 14px; padding: 12px 2px 0; border-top: 1px dashed var(--line-strong); margin-top: 10px; }
.items-total span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.items-total strong { font-size: 20px; font-variant-numeric: tabular-nums; }

.file-drop {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  border: 1px dashed var(--line-strong); border-radius: 10px; background: #fbf8f1;
  font-size: 12px; color: var(--ink-soft); cursor: pointer;
}
.file-drop:hover { border-color: var(--teal); background: #f6fbfa; }
.file-drop input { display: none; }
.file-drop .fname { font-weight: 600; color: var(--ink); word-break: break-all; }
.file-drop svg { color: var(--teal); flex: 0 0 auto; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 26, 38, .45); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px 16px; z-index: 100;
  animation: fade .15s ease;
}
.modal {
  width: 100%; max-width: 660px; background: var(--card); border-radius: 16px;
  box-shadow: 0 30px 80px -20px rgba(10, 20, 30, .5); max-height: 90vh; display: flex; flex-direction: column;
  animation: rise .18s ease;
}
.modal.wide { max-width: 940px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; }
.modal-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: #fbf8f1; border-radius: 0 0 16px 16px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }

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

/* ---------- misc ---------- */
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty h4 { color: var(--ink-soft); font-size: 14px; margin-bottom: 4px; }
.empty p { font-size: 12.5px; }
.empty .btn { margin-top: 14px; }

.skeleton-wrap { display: flex; flex-direction: column; gap: 14px; }
.skeleton { height: 92px; border-radius: 14px; background: linear-gradient(90deg, #ece7db 25%, #f4f0e7 37%, #ece7db 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; }
.skeleton.short { height: 44px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.toast-root { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px;
  font-size: 12.5px; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5); animation: rise .2s ease;
  max-width: 340px;
}
.toast.err { background: #7d2b2b; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-title h2 { font-size: 16px; }
.section-title p { font-size: 11.5px; color: var(--muted); }

.notice {
  display: flex; gap: 10px; padding: 11px 14px; border-radius: 10px;
  background: var(--amber-soft); border: 1px solid #ecd9b4; color: #6b4d12; font-size: 12px;
  margin-bottom: 16px;
}
.notice.info { background: #eef4f8; border-color: #d7e3ec; color: #33566f; }

.tag { font-size: 10.5px; color: var(--muted); background: #f0ece2; padding: 2px 7px; border-radius: 5px; }

.detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 7px 14px; font-size: 12.8px; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; font-weight: 550; }

/* ---------- expense report ---------- */
.modal.er-modal { max-width: 1200px; }
.er-form-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.er-seg { display: inline-flex; background: #eee9de; border-radius: 9px; padding: 2px; }
.er-seg button {
  border: 0; background: transparent; border-radius: 7px; padding: 7px 12px;
  font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.er-seg button.active { background: var(--ink); color: #fff; }
.er-week { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; flex-wrap: wrap; }
.er-week .wk-label { font-size: 13px; font-weight: 650; }
.er-week .wk-jump {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--muted); font-weight: 600;
}
.er-week .wk-jump .input { width: 148px; padding: 6px 8px; font-size: 12px; }
.er-scroll {
  overflow-x: auto; border: 1px solid var(--line-strong); border-radius: 10px; background: #fffefb;
}
table.er-table { width: 100%; border-collapse: collapse; min-width: 800px; font-size: 11.5px; }
table.er-table th, table.er-table td { border: 1px solid var(--line); padding: 0; text-align: center; }
table.er-table thead th { background: #f7f3ea; color: var(--ink-soft); font-weight: 650; font-size: 10.5px; padding: 4px 3px; }
table.er-table thead th.er-day span { display: block; letter-spacing: .04em; text-transform: uppercase; }
table.er-table thead th.er-day small { display: block; font-weight: 500; color: var(--muted); font-size: 10px; }
table.er-table .er-no { width: 28px; color: var(--muted); font-weight: 600; }
table.er-table .er-label { text-align: left; padding: 4px 8px; white-space: nowrap; font-weight: 550; color: var(--ink-soft); }
table.er-table .er-kota-cell { padding: 2px; background: #fffefb; }
table.er-table .er-kota {
  width: 100%; border: 0; background: transparent; text-align: center; font: inherit;
  font-size: 10.5px; padding: 4px 2px; border-radius: 4px; min-width: 62px;
}
table.er-table .er-kota:focus { outline: 2px solid rgba(14, 124, 123, .35); background: #fff; }
table.er-table .er-amt {
  width: 100%; border: 0; background: transparent; text-align: right; font: inherit;
  font-variant-numeric: tabular-nums; padding: 6px 6px; border-radius: 4px; min-width: 84px;
}
table.er-table .er-amt:focus { outline: 2px solid rgba(14, 124, 123, .35); background: #fff; }
table.er-table .er-amt.is-auto { background: #f7f3ea; color: var(--ink-soft); }
table.er-table .er-rowtotal { text-align: right; padding: 6px 8px; font-variant-numeric: tabular-nums; background: #fbf8f1; font-weight: 600; white-space: nowrap; }
table.er-table tfoot td, table.er-table tfoot th { background: #f2ede2; font-weight: 700; }
table.er-table tfoot .er-daytotal { text-align: right; padding: 6px 6px; font-variant-numeric: tabular-nums; }
.er-ent { margin-top: 16px; }
.er-ent-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.er-ent-head > label { font-size: 11.5px; font-weight: 650; color: var(--ink-soft); }
.er-ent-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr) 140px 32px; gap: 6px; margin-bottom: 6px; align-items: center; }
.er-ent-row .input { padding: 8px 10px; font-size: 12.5px; }
.er-ent-row .er-amt { text-align: right; font-variant-numeric: tabular-nums; }
.er-ent-row .remove { border: 0; background: transparent; color: var(--rose); cursor: pointer; padding: 4px; border-radius: 6px; }
.er-ent-row .remove:hover { background: var(--rose-soft); }
.er-ent .hint { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }

.er-statusline {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); margin-bottom: 12px;
}
.er-statusline > span:not(.badge) { font-weight: 600; color: var(--ink-soft); }

.er-sheet {
  background: #fff; color: #16202b; border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 18px 20px; font-size: 11.5px;
}
.er-sheet-head { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 12px; }
.er-sheet-logo { height: 46px; width: auto; object-fit: contain; }
.er-sheet-title { flex: 1; }
.er-sheet-title strong { display: block; font-size: 17px; letter-spacing: .08em; }
.er-sheet-title span { font-size: 11px; color: #4b5b6b; }
.er-sheet-no { text-align: right; }
.er-sheet-no small { display: block; font-size: 9px; letter-spacing: .12em; color: #6b7c8f; }
.er-sheet-no strong { font-size: 13px; }
table.er-sheet-meta { width: 100%; border-collapse: collapse; margin-bottom: 10px; font-size: 11px; }
table.er-sheet-meta th { text-align: left; width: 112px; padding: 3px 6px; color: #4b5b6b; font-weight: 600; border-bottom: 1px solid #ece7dc; white-space: nowrap; }
table.er-sheet-meta td { padding: 3px 6px; border-bottom: 1px solid #ece7dc; }
.er-sheet .er-table { min-width: 0; font-size: 9.5px; }
.er-sheet .er-table th, .er-sheet .er-table td { border-color: #d8d2c4; padding: 2px 4px; }
.er-sheet .er-table thead th { background: #f2ede2; font-size: 9px; }
.er-sheet .er-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.er-sheet .er-table td.c, .er-sheet .er-table th.c { text-align: center; width: 24px; }
.er-sheet .er-table td.left, .er-sheet .er-table th.left { text-align: left; padding-left: 6px; }
.er-sheet .er-table .strong { font-weight: 700; }
.er-ent-sheet { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 10px; }
.er-ent-sheet th { background: #f2ede2; text-align: left; padding: 3px 6px; border: 1px solid #d8d2c4; color: #4b5b6b; }
.er-ent-sheet td { padding: 3px 6px; border: 1px solid #d8d2c4; }
.er-ent-sheet .num { text-align: right; font-variant-numeric: tabular-nums; }
.er-sign { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; text-align: center; font-size: 11px; }
.er-sign > div { border: 1px solid #ddd6c8; border-radius: 6px; padding: 8px 10px; min-height: 82px; display: flex; flex-direction: column; gap: 2px; }
.er-sign span { color: #6b7c8f; font-size: 10px; }
.er-sign strong { margin-top: auto; }
.er-sign small { color: #6b7c8f; font-size: 9.5px; }
.er-sign p { margin: auto 0 0; font-size: 10px; color: #2a3746; }
.er-sheet-foot { margin-top: 10px; font-size: 9.5px; color: #8494a4; text-align: right; }
.er-sheet-title em { display: block; font-style: normal; font-size: 9px; color: #6b7c8f; margin-top: 2px; }
.sign-space { flex: 1; width: 100%; min-height: 26px; }

.plan-sheet {
  background: #fff; color: #16202b; border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 18px 20px; font-size: 11.5px;
}
.plan-sheet-head { display: flex; align-items: flex-start; gap: 14px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 12px; }
.plan-sheet-brand { flex: 1; padding-top: 2px; }
.plan-sheet-brand strong { display: block; font-size: 12px; letter-spacing: .02em; }
.plan-sheet-brand span { display: block; font-size: 9px; color: #4b5b6b; margin-top: 2px; }
.plan-sheet-title { text-align: right; }
.plan-sheet-title strong { display: block; font-size: 17px; letter-spacing: .08em; }
.plan-sheet-title span { font-size: 11px; color: #4b5b6b; }
table.plan-meta { width: 100%; border-collapse: collapse; margin-bottom: 10px; font-size: 10.5px; }
table.plan-meta th { text-align: left; width: 84px; padding: 3px 6px; color: #4b5b6b; font-weight: 600; border-bottom: 1px solid #ece7dc; white-space: nowrap; }
table.plan-meta td { padding: 3px 6px; border-bottom: 1px solid #ece7dc; }
table.plan-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
table.plan-table th, table.plan-table td { border: 1px solid #d8d2c4; padding: 4px 6px; vertical-align: top; }
table.plan-table thead th { background: #f2ede2; color: #4b5b6b; font-size: 9.5px; text-align: left; }
table.plan-table .c { text-align: center; width: 28px; }
table.plan-table .nowrap { white-space: nowrap; }
table.plan-table .plan-kegiatan strong { display: block; }
table.plan-table .plan-kegiatan span { display: block; color: #6b7c8f; font-size: 9.5px; margin-top: 2px; }
.plan-sign { margin-top: 18px; }
.plan-sign-title { font-size: 11px; font-weight: 650; margin: 0 0 8px; color: #4b5b6b; }
.plan-sign-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan-sign-grid > div {
  border: 1px solid #ddd6c8; border-radius: 6px; padding: 8px 10px; min-height: 96px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.plan-sign-grid span { color: #6b7c8f; font-size: 10px; }
.plan-sign-grid strong { font-size: 11px; }
.plan-sign-grid small { color: #6b7c8f; font-size: 9.5px; }
.plan-sheet-foot { margin-top: 12px; font-size: 9.5px; color: #8494a4; text-align: right; }

#printRoot { display: none; }
@page { size: A4 landscape; margin: 9mm; }
@media print {
  html, body { background: #fff !important; }
  body.printing .layout,
  body.printing .bottom-nav,
  body.printing .modal-backdrop,
  body.printing .toast-root { display: none !important; }
  body.printing #printRoot { display: block !important; }
  body.printing .er-sheet { border: 0; border-radius: 0; padding: 0; font-size: 9.5px; }
  body.printing .er-sheet-head { gap: 10px; padding-bottom: 6px; margin-bottom: 6px; }
  body.printing .er-sheet-logo { height: 34px; }
  body.printing .er-sheet-title strong { font-size: 14px; }
  body.printing .er-sheet-title em { font-size: 8px; }
  body.printing table.er-sheet-meta { margin-bottom: 6px; font-size: 9.5px; }
  body.printing table.er-sheet-meta th, body.printing table.er-sheet-meta td { padding: 1.5px 5px; }
  body.printing .er-sheet .er-table { font-size: 8.4px; line-height: 1.2; }
  body.printing .er-sheet .er-table th, body.printing .er-sheet .er-table td { padding: 1px 2.5px; }
  body.printing .er-ent-sheet { margin-top: 6px; font-size: 8.4px; line-height: 1.25; }
  body.printing .er-ent-sheet th, body.printing .er-ent-sheet td { padding: 1.5px 4px; }
  body.printing .er-sign { margin-top: 8px; gap: 10px; font-size: 9.5px; }
  body.printing .er-sign > div { min-height: 0; padding: 5px 8px; }
  body.printing .er-sign .sign-space { min-height: 12mm; }
  body.printing .er-sheet-foot { margin-top: 4px; font-size: 8px; }
  body.printing .plan-sheet { border: 0; border-radius: 0; padding: 0; font-size: 10px; }
  body.printing .plan-sheet .plan-table { font-size: 9px; }
  body.printing .plan-sign-grid .sign-space { min-height: 17mm; }
  body.printing .plan-sign-grid > div { min-height: 0; }
  body.printing tr, body.printing .er-sign > div, body.printing .plan-sign-grid > div { break-inside: avoid; }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view { padding: 22px 22px 56px; }
  .topbar { padding: 22px 22px 16px; }
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  .topbar { padding: 16px 16px 12px; align-items: center; }
  .topbar h1 { font-size: 20px; }
  .eyebrow { display: none; }
  .range-chip { display: none; }
  .view { padding: 16px 16px 92px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: rgba(255, 253, 248, .96); backdrop-filter: blur(8px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; font-size: 10px; color: var(--muted); font-weight: 600; border-radius: 8px;
  }
  .bottom-nav a.active { color: var(--teal); background: var(--teal-soft); }
  .bottom-nav svg { width: 19px; height: 19px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .er-form-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .er-ent-row { grid-template-columns: 1fr 1fr; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fbf8f1; }
  .er-ent-row .remove { grid-column: 2; justify-self: end; }
  .er-week .wk-jump { margin-left: 0; width: 100%; }
  .er-sheet { padding: 12px; }
  .er-sheet-head { gap: 10px; }
  .er-sheet-logo { height: 34px; }
  .er-sheet-title strong { font-size: 14px; }
  .er-sign { grid-template-columns: 1fr; }
  .plan-sheet { padding: 12px; }
  .plan-sheet-head { gap: 10px; flex-wrap: wrap; }
  .plan-sheet-title { flex-basis: 100%; text-align: left; }
  .plan-sign-grid { grid-template-columns: 1fr; }
  .cal-cell { min-height: 74px; padding: 4px; }
  .plan-chip {
    font-size: 9px; padding: 2px 4px; white-space: normal; word-break: break-word;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  .bar-row { grid-template-columns: 92px 1fr 58px; gap: 8px; }
  .req-card { grid-template-columns: 1fr; }
  .req-side { align-items: flex-start; }
  .req-actions { justify-content: flex-start; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-foot { border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .items-head { display: none; }
  .item-row { grid-template-columns: 1fr 1fr; background: #fbf8f1; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
  .item-row .span2 { grid-column: 1 / -1; }
  .toast-root { left: 16px; right: 16px; bottom: 84px; }
  .toast { max-width: none; }
  table.data th, table.data td { padding: 8px 10px; }
}

@media (min-width: 761px) {
  .admin-only { display: flex; }
}
@media (max-width: 760px) {
  .admin-only { display: none; }
}
