/* ============================================================
   BusManager — Design tokens & global styles
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }
:root {
  /* surfaces */
  --bg: oklch(0.985 0.003 80);
  --surface: #ffffff;
  --surface-2: oklch(0.975 0.004 80);
  --surface-sunken: oklch(0.96 0.005 80);
  --border: oklch(0.92 0.006 80);
  --border-strong: oklch(0.86 0.008 80);
  --divider: oklch(0.94 0.005 80);

  /* text */
  --ink: oklch(0.22 0.018 250);
  --ink-2: oklch(0.36 0.015 250);
  --ink-mute: oklch(0.55 0.013 250);
  --ink-soft: oklch(0.68 0.010 250);

  /* brand */
  --brand: oklch(0.42 0.10 235);
  --brand-2: oklch(0.36 0.10 235);
  --brand-tint: oklch(0.95 0.025 235);
  --brand-ink: oklch(0.28 0.10 235);

  /* status (per BRD) */
  --st-booking: oklch(0.58 0.13 245);
  --st-booking-tint: oklch(0.95 0.03 245);
  --st-dp: oklch(0.70 0.14 80);
  --st-dp-tint: oklch(0.96 0.04 85);
  --st-lunas: oklch(0.58 0.12 155);
  --st-lunas-tint: oklch(0.95 0.04 155);
  --st-selesai: oklch(0.62 0.008 250);
  --st-selesai-tint: oklch(0.95 0.005 250);
  --st-batal: oklch(0.58 0.17 25);
  --st-batal-tint: oklch(0.96 0.03 25);

  /* misc */
  --warn: oklch(0.70 0.14 60);
  --warn-tint: oklch(0.97 0.03 75);
  --danger: oklch(0.55 0.18 25);
  --success: oklch(0.55 0.13 155);

  /* radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --shadow-sm: 0 1px 0 0 oklch(0.92 0.006 80 / .6), 0 1px 2px oklch(0.5 0 0 / .04);
  --shadow-md: 0 1px 2px oklch(0.5 0 0 / .04), 0 4px 12px oklch(0.5 0 0 / .06);
  --shadow-lg: 0 4px 24px oklch(0.5 0 0 / .12);

  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   App shell
   ============================================================ */
#root { height: 100%; }
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  background: var(--bg);
}
.app--login { display: block; }

/* sidebar */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--divider);
}
.sb-brand .logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  color: white;
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px;
  box-shadow: inset 0 -2px 4px oklch(0 0 0 / .15), 0 2px 4px oklch(0 0 0 / .12);
}
.sb-brand .brand-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.sb-brand .brand-sub {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.sb-nav { padding: 12px 10px; overflow: auto; flex: 1; }
.sb-section-label {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  padding: 14px 12px 6px;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}
.sb-item:hover { background: var(--surface-sunken); color: var(--ink); }
.sb-item.active {
  background: var(--brand-tint);
  color: var(--brand-ink);
  font-weight: 600;
}
.sb-item .ic { width: 18px; height: 18px; opacity: .85; flex: none; }
.sb-item.active .ic { opacity: 1; }
.sb-sub {
  margin-left: 30px;
  padding-left: 12px;
  border-left: 1px solid var(--divider);
  display: flex; flex-direction: column;
}
.sb-sub .sb-item { padding: 6px 10px; font-size: 13px; }
.sb-foot {
  padding: 12px;
  border-top: 1px solid var(--divider);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.7 0.1 60), oklch(0.55 0.12 30));
  color: white;
  font-weight: 700;
  display: grid; place-items: center;
  font-size: 13px;
  flex: none;
}
.sb-foot .nm { font-weight: 600; font-size: 13px; line-height: 1.2; }
.sb-foot .rl { font-size: 11px; color: var(--ink-mute); }

/* main area */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
}
.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.topbar .crumb {
  font-size: 12px;
  color: var(--ink-mute);
  font-weight: 500;
  margin-left: 4px;
}
.topbar .spacer { flex: 1; }
.topbar-search {
  position: relative;
  width: 280px;
}
.topbar-search input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
  outline: none;
}
.topbar-search input:focus { border-color: var(--brand); background: white; }
.topbar-search .ic {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ink-mute);
}
.topbar .icon-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--ink-2);
  position: relative;
}
.topbar .icon-btn:hover { background: var(--surface-sunken); }
.topbar .icon-btn .dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface);
}

.content {
  flex: 1;
  overflow: auto;
  padding: 24px 28px 40px;
}

/* ============================================================
   Cards / containers
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-pad { padding: 18px 20px; }
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.card-head .sub { font-size: 12px; color: var(--ink-mute); }

.row { display: flex; gap: 16px; }
.row > * { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  transition: filter .12s ease;
}
.btn:hover { background: var(--surface-sunken); }
.btn:active { filter: brightness(.96); }
.btn .ic { width: 16px; height: 16px; }
.btn-primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-sunken); }
.btn-danger { color: var(--danger); border-color: oklch(0.85 0.05 25); }
.btn-danger:hover { background: oklch(0.97 0.025 25); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ============================================================
   Forms
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; gap: 14px; }
.lbl {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex; align-items: center; gap: 6px;
}
.lbl .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13.5px;
  outline: none;
  color: var(--ink);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px oklch(0.42 0.10 235 / .15);
}
.textarea { resize: vertical; min-height: 70px; font-family: inherit; }
.hint { font-size: 11.5px; color: var(--ink-mute); }
.input.err { border-color: var(--danger); }
.input.with-prefix { padding-left: 36px; }
.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--ink-mute); font-weight: 600;
  pointer-events: none;
}
.input-prefix-wrap .input { padding-left: 32px; }

.field-warn {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warn-tint);
  border: 1px solid oklch(0.85 0.08 75);
  font-size: 12.5px;
  color: oklch(0.4 0.12 65);
  align-items: flex-start;
}
.field-warn .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--warn); }

.switch {
  width: 36px; height: 20px;
  background: oklch(0.86 0.005 250);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background .15s ease;
  flex: none;
}
.switch::after {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: left .15s ease;
}
.switch.on { background: var(--brand); }
.switch.on::after { left: 18px; }

/* ============================================================
   Badges (statuses)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .005em;
  white-space: nowrap;
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  opacity: .9;
}
.badge.no-dot::before { display: none; }
.badge.booking { background: var(--st-booking-tint); color: oklch(0.36 0.12 245); }
.badge.dp { background: var(--st-dp-tint); color: oklch(0.45 0.13 70); }
.badge.lunas { background: var(--st-lunas-tint); color: oklch(0.38 0.10 155); }
.badge.selesai { background: var(--st-selesai-tint); color: var(--ink-2); }
.badge.batal { background: var(--st-batal-tint); color: oklch(0.45 0.17 25); }
.badge.aktif { background: var(--st-lunas-tint); color: oklch(0.38 0.10 155); }
.badge.nonaktif { background: var(--st-selesai-tint); color: var(--ink-mute); }
.badge.role { background: var(--brand-tint); color: var(--brand-ink); }
.badge.kas-in { background: var(--st-lunas-tint); color: oklch(0.38 0.10 155); }
.badge.kas-out { background: var(--st-batal-tint); color: oklch(0.45 0.17 25); }
.badge.auto { background: var(--surface-sunken); color: var(--ink-mute); border: 1px dashed var(--border-strong); }

/* ============================================================
   Tables
   ============================================================ */
.tbl-wrap { overflow: auto; }
.tbl { font-size: 13px; }
.tbl thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.tbl tbody tr:hover td { background: oklch(0.985 0.005 80); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tbl .right { text-align: right; }
.tbl .center { text-align: center; }
.cell-secondary { font-size: 11.5px; color: var(--ink-mute); margin-top: 2px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ============================================================
   Page header
   ============================================================ */
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head .ttl { min-width: 0; flex: 1; }
.page-head .ttl h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}
.page-head .ttl .sub {
  margin-top: 3px;
  font-size: 13px;
  color: var(--ink-mute);
}
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* tab */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.tab {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background: none;
  border-left: 0; border-right: 0; border-top: 0;
  margin-bottom: -1px;
}
.tab.active {
  color: var(--brand-ink);
  border-bottom-color: var(--brand);
}

/* ============================================================
   KPI cards
   ============================================================ */
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
}
.kpi .label {
  font-size: 12px;
  color: var(--ink-mute);
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.kpi .label .ic-bg {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--brand-tint);
  color: var(--brand);
  display: grid; place-items: center;
}
.kpi .value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.kpi .value .unit { font-size: 14px; color: var(--ink-mute); font-weight: 500; margin-right: 3px; }
.kpi .delta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-mute);
  display: flex; align-items: center; gap: 4px;
}
.kpi .delta.up { color: var(--success); }
.kpi .delta.down { color: var(--danger); }

/* ============================================================
   Calendar (Kalender Armada)
   ============================================================ */
.cal-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.cal-month {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  min-width: 160px;
}
.cal-grid {
  display: grid;
  font-size: 12px;
  min-width: 1000px;
}
.cal-row {
  display: grid;
  border-bottom: 1px solid var(--divider);
}
.cal-row:last-child { border-bottom: 0; }
.cal-head-row {
  position: sticky; top: 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  z-index: 2;
}
.cal-bus-cell {
  padding: 10px 12px;
  border-right: 1px solid var(--divider);
  background: var(--surface);
  position: sticky;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cal-day-head {
  padding: 8px 6px;
  text-align: center;
  border-right: 1px solid var(--divider);
  font-weight: 600;
  font-size: 11px;
  color: var(--ink-mute);
}
.cal-day-head .dnum { font-size: 14px; color: var(--ink); margin-top: 2px; font-weight: 700; }
.cal-day-head.is-today .dnum {
  background: var(--brand);
  color: white;
  width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
}
.cal-day-head.is-weekend { background: var(--surface-2); }
.cal-cell {
  border-right: 1px solid var(--divider);
  min-height: 56px;
  position: relative;
  padding: 4px;
}
.cal-cell.is-weekend { background: var(--surface-sunken); }
.cal-cell.is-today {
  background: oklch(0.97 0.02 235);
}
.cal-block {
  background: var(--st-booking);
  color: white;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  position: absolute;
  top: 6px;
  height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 oklch(0 0 0 / .12);
}
.cal-block.lunas { background: var(--st-lunas); }
.cal-block.dp { background: var(--st-dp); color: oklch(0.30 0.1 70); }
.cal-block.selesai { background: oklch(0.78 0.008 250); color: var(--ink-2); }
.cal-block.batal {
  background: repeating-linear-gradient(45deg, var(--st-batal-tint), var(--st-batal-tint) 6px, oklch(0.97 0.05 25) 6px, oklch(0.97 0.05 25) 12px);
  color: var(--st-batal);
  border: 1px dashed var(--st-batal);
  text-decoration: line-through;
}
.cal-block .blk-cust { opacity: .92; font-weight: 500; font-size: 10.5px; }

/* legend */
.cal-legend { display: flex; gap: 14px; align-items: center; }
.lgnd { display: flex; gap: 6px; font-size: 12px; color: var(--ink-2); align-items: center; }
.lgnd .sw { width: 10px; height: 10px; border-radius: 3px; }

/* ============================================================
   Login
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.login-side {
  background: linear-gradient(150deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-side::before, .login-side::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: oklch(1 0 0 / .08);
}
.login-side::before { width: 320px; height: 320px; right: -100px; top: -80px; }
.login-side::after { width: 200px; height: 200px; left: -60px; bottom: 60px; }
.login-side .brandblock { position: relative; z-index: 1; }
.login-side .brandblock .logo {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: white;
  color: var(--brand);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 22px;
}
.login-side h1 {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 36px 0 14px;
  line-height: 1.1;
  position: relative; z-index: 1;
}
.login-side p { font-size: 15px; opacity: .85; max-width: 380px; position: relative; z-index: 1; }
.login-side .foot {
  font-size: 12px;
  opacity: .65;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 600;
  position: relative; z-index: 1;
}
.login-form-wrap {
  display: grid;
  place-items: center;
  padding: 48px;
}
.login-form {
  width: 100%;
  max-width: 380px;
}
.login-form h2 {
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.login-form .sub { color: var(--ink-mute); margin-bottom: 28px; font-size: 14px; }
.demo-credentials {
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--surface-sunken);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  font-size: 12px;
  color: var(--ink-2);
}
.demo-credentials strong { display: block; margin-bottom: 4px; font-size: 11.5px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .05em; }
.demo-credentials code { font-family: var(--font-mono); font-size: 11.5px; background: var(--surface); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border); }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: oklch(0.2 0.02 250 / .5);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 24px;
}
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.modal-head .close {
  margin-left: auto;
  border: 0; background: none;
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
  color: var(--ink-mute);
}
.modal-head .close:hover { background: var(--surface-sunken); }
.modal-body { padding: 22px; overflow: auto; flex: 1; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--divider);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--surface-2);
}
.modal-wide { max-width: 880px; }

/* ============================================================
   Toolbar (filter row)
   ============================================================ */
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.toolbar .search {
  position: relative;
  width: 260px;
}
.toolbar .search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 13px;
  outline: none;
}
.toolbar .search input:focus { border-color: var(--brand); }
.toolbar .search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--ink-mute); }
.toolbar .chip-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.toolbar .chip-filter select {
  border: 0; background: transparent;
  font-size: 13px;
  outline: none;
  padding-right: 4px;
}
.toolbar .sp { flex: 1; }

/* ============================================================
   Avatar list / list rows
   ============================================================ */
.bus-mini {
  display: flex; align-items: center; gap: 10px;
}
.bus-mini .thumb {
  width: 36px; height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, oklch(0.85 0.04 235), oklch(0.65 0.10 235));
  color: white;
  font-size: 9.5px;
  font-weight: 700;
  display: grid; place-items: center;
  flex: none;
  letter-spacing: .04em;
}
.bus-mini .nm { font-weight: 600; font-size: 13px; }
.bus-mini .sub { color: var(--ink-mute); font-size: 11.5px; font-family: var(--font-mono); }

.person-mini {
  display: flex; align-items: center; gap: 10px;
}
.person-mini .av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-sunken);
  color: var(--ink-2);
  font-weight: 700;
  display: grid; place-items: center;
  font-size: 12px;
  flex: none;
}

/* mini stats row */
.mini-stat {
  padding: 10px 12px;
  background: var(--surface-sunken);
  border-radius: 8px;
  flex: 1;
}
.mini-stat .lbl { font-size: 11px; text-transform: uppercase; color: var(--ink-mute); font-weight: 600; letter-spacing: .04em; }
.mini-stat .val { font-size: 18px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* timeline (dashboard activity) */
.tl-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
  align-items: center;
}
.tl-item:last-child { border-bottom: 0; }
.tl-dot {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--brand-tint);
  color: var(--brand);
  display: grid; place-items: center;
}
.tl-dot.green { background: var(--st-lunas-tint); color: oklch(0.4 0.10 155); }
.tl-dot.red { background: var(--st-batal-tint); color: var(--st-batal); }
.tl-dot.yellow { background: var(--st-dp-tint); color: oklch(0.45 0.13 70); }
.tl-meta { font-size: 11px; color: var(--ink-mute); }

/* ============================================================
   Bar / chart helpers
   ============================================================ */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 200px;
  padding: 12px 0;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-col .bar {
  width: 100%;
  background: var(--brand);
  border-radius: 6px 6px 2px 2px;
  position: relative;
  min-height: 2px;
}
.bar-col .bar.alt { background: oklch(0.7 0.13 245); }
.bar-col .lbl { font-size: 11px; color: var(--ink-mute); }
.bar-col .val { font-size: 11px; font-weight: 600; color: var(--ink); font-family: var(--font-mono); }

/* progress */
.prog {
  width: 100%; height: 6px;
  background: var(--surface-sunken);
  border-radius: 999px;
  overflow: hidden;
}
.prog .fill { height: 100%; background: var(--brand); border-radius: 999px; }

/* ============================================================
   Misc
   ============================================================ */
.divider { height: 1px; background: var(--divider); margin: 12px 0; }
.muted { color: var(--ink-mute); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.text-r { text-align: right; }
.text-c { text-align: center; }

/* ============================================================
   Print menu (dropdown for cetak)
   ============================================================ */
.print-menu {
  min-width: 280px;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  padding: 4px;
  animation: pmIn .12s ease;
}
@keyframes pmIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pm-section {
  padding: 10px 12px 4px;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 700;
}
.pm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
}
.pm-item:hover:not(:disabled) { background: var(--brand-tint); }
.pm-item:disabled { opacity: .4; cursor: not-allowed; }
.pm-item .pm-ic {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface-sunken);
  display: grid; place-items: center;
  color: var(--ink-2);
  flex: none;
}
.pm-item:hover:not(:disabled) .pm-ic { background: white; color: var(--brand); }
.pm-divider { height: 1px; background: var(--divider); margin: 4px 0; }

.toast-stack {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200;
}
.toast {
  padding: 12px 16px;
  background: oklch(0.2 0.02 250);
  color: white;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 280px;
  animation: tslide .25s ease;
}
.toast.success { background: oklch(0.32 0.10 155); }
.toast.error { background: oklch(0.4 0.16 25); }
@keyframes tslide {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* form section card */
.fs-card { padding: 18px 20px; }
.fs-card + .fs-card { border-top: 1px solid var(--divider); }
.fs-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-mute);
  margin-bottom: 14px;
  white-space: nowrap;
}
.fs-title .num {
  width: 22px; height: 22px;
  background: var(--brand-tint);
  color: var(--brand);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px;
}

/* drawer (right side) */
.drawer-overlay {
  position: fixed; inset: 0;
  background: oklch(0.2 0.02 250 / .35);
  z-index: 90;
  animation: fade .15s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 480px;
  background: var(--surface);
  z-index: 91;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideR .2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideR { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--divider);
  display: flex; align-items: center; gap: 10px;
}
.drawer-head h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.drawer-body { flex: 1; overflow: auto; padding: 22px; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--divider); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }

/* details key/value pairs */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; font-size: 13px; }
.kv .k { color: var(--ink-mute); font-weight: 500; }
.kv .v { color: var(--ink); font-weight: 500; }

/* utility */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }

/* ============================================================
   Menu button (hidden on desktop)
   ============================================================ */
.menu-btn {
  display: none;
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  place-items: center;
  color: var(--ink-2);
  cursor: pointer;
  flex: none;
}
.menu-btn:hover { background: var(--surface-sunken); }

.sb-close-btn { display: none; margin-left: auto; }

.sidebar-overlay { display: none; }

/* ============================================================
   Responsive — Tablet (≤1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .app { display: flex; flex-direction: column; }
  .main { flex: 1; min-height: 0; width: 100%; }

  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 80;
    width: 270px;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    display: block;
    position: fixed; inset: 0;
    background: oklch(0.15 0.02 250 / .45);
    backdrop-filter: blur(2px);
    z-index: 79;
    animation: fade .2s ease;
  }

  .sb-close-btn { display: grid; }
  .menu-btn { display: grid; }

  .topbar-search { width: 200px; }
  .content { padding: 18px 16px 32px; }

  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-5 { grid-template-columns: repeat(2, 1fr) !important; }

  .drawer { width: 400px; }

  .login-wrap { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .login-form-wrap { min-height: 100vh; }

  .modal-wide { max-width: 92vw; }

  .cal-grid { min-width: 800px; }
}

/* ============================================================
   Responsive — Mobile (≤640px)
   ============================================================ */
@media (max-width: 640px) {
  .topbar { padding: 0 12px; height: 52px; gap: 10px; }
  .topbar h1 { font-size: 15px; }
  .topbar .crumb { display: none; }
  .topbar-search { display: none; }
  .topbar .icon-btn { width: 34px; height: 34px; }

  .content { padding: 14px 12px 24px; }

  .grid, .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr !important; }
  .row { flex-direction: column; }

  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head .actions { margin-left: 0; }
  .page-head .ttl h2 { font-size: 18px; }

  .toolbar { gap: 6px; }
  .toolbar .search { width: 100%; flex: 1; min-width: 0; }
  .toolbar .chip-filter { flex: 1; min-width: 0; }
  .toolbar .sp { display: none; }

  .kpi { padding: 14px 16px; }
  .kpi .value { font-size: 20px; }
  .kpi .label { font-size: 11.5px; }

  .drawer { width: 100%; }
  .drawer-body { padding: 16px; }
  .drawer-head { padding: 14px 16px; }

  .modal { max-width: 100%; border-radius: var(--r-md); max-height: 94vh; }
  .modal-wide { max-width: 100%; }
  .modal-overlay { padding: 10px; }
  .modal-body { padding: 16px; }
  .modal-head { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px; }

  .field-row { grid-template-columns: 1fr !important; }

  .cal-grid { min-width: 600px; }

  .kv { grid-template-columns: 100px 1fr; gap: 6px 10px; font-size: 12.5px; }

  .btn { font-size: 12.5px; height: 34px; padding: 0 11px; }
  .btn-sm { height: 28px; padding: 0 8px; font-size: 12px; }

  .toast-stack { bottom: 12px; right: 12px; left: 12px; }
  .toast { min-width: auto; font-size: 12.5px; }

  .bar-chart { height: 160px; gap: 8px; }

  .tbl { font-size: 12px; }
  .tbl thead th { padding: 8px 10px; font-size: 10.5px; }
  .tbl tbody td { padding: 10px; }
  .row-actions { gap: 2px; }

  .tabs { gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { padding: 9px 10px; font-size: 12.5px; white-space: nowrap; flex: none; }

  .card-pad { padding: 14px 16px; }
  .card-head { padding: 12px 14px; }

  .fs-card { padding: 14px 16px; }

  .mini-stat .val { font-size: 16px; }

  .tl-item { grid-template-columns: 34px 1fr auto; gap: 8px; padding: 8px 0; }

  .print-menu { min-width: 240px; }

  .login-form-wrap { padding: 24px 20px; }
  .login-form h2 { font-size: 20px; }
}

/* ============================================================
   Responsive — Small Mobile (≤380px)
   ============================================================ */
@media (max-width: 380px) {
  .topbar h1 { font-size: 14px; }
  .menu-btn { width: 34px; height: 34px; }
  .content { padding: 10px 10px 20px; }
  .page-head .ttl h2 { font-size: 16px; }
  .kpi .value { font-size: 18px; }
  .btn { font-size: 12px; height: 32px; padding: 0 10px; }
}
