/**
 * QuarryOps — Design System v2
 * Industrial quarry theme: dark nav, warm amber accent, clean data surfaces
 */
:root {
  --font: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;

  --bg: #f4f1eb;
  --bg-elevated: #faf8f4;
  --surface: #ffffff;
  --surface-2: #f8f6f2;
  --ink: #0f1419;
  --text: #1c2430;
  --slate: #3d4a5c;
  --muted: #6b7a8f;
  --fog: #9aa8b8;
  --line: #e4dfd4;
  --line-strong: #d4cdc0;

  --sidebar-bg: #0f1623;
  --sidebar-surface: #161f30;
  --sidebar-text: #b8c4d4;
  --sidebar-active: #ffffff;
  --sidebar-width: 272px;

  --amber: #d4920a;
  --amber-light: #f5c842;
  --amber-glow: rgba(212, 146, 10, 0.22);
  --blue: #2563eb;
  --navy: #0f2744;
  --teal: #0d9488;
  --green: #15803d;
  --gold: #b45309;
  --orange: #ea580c;
  --red: #dc2626;
  --purple: #7c3aed;
  --cyan: #0891b2;

  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(15, 20, 25, 0.04);
  --shadow-sm: 0 4px 16px rgba(15, 20, 25, 0.06);
  --shadow-md: 0 12px 40px rgba(15, 20, 25, 0.1);
  --shadow-lg: 0 24px 60px rgba(15, 20, 25, 0.14);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --topbar-h: 72px;
  --tabbar-h: 56px;
  --bottom-nav: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

[x-cloak] { display: none !important; }
.desktop-only { display: block; }
.mobile-only { display: none; }
body.no-scroll { overflow: hidden; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* ── Form controls ── */
input, select, textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input[type="date"] {
  min-height: 42px;
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
  background: #fff;
}
textarea { min-height: 96px; resize: vertical; }
label {
  display: grid;
  gap: 7px;
  color: var(--slate);
  font-weight: 600;
  font-size: 13px;
}
input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--amber);
  margin-right: 10px; vertical-align: middle;
}
label.card {
  display: flex; align-items: center; gap: 4px;
  padding: 16px 18px; cursor: pointer;
  border-radius: var(--radius); border: 1.5px solid var(--line);
  background: var(--surface); font-weight: 500;
}
label.card:hover { border-color: var(--amber); background: #fffdf8; }

/* ── App shell ── */
.app-body {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  background: var(--bg);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0a1019 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 20px 16px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 10px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 16px;
}
.sidebar-brand strong {
  display: block;
  color: #fff;
  font-size: 16px;
  letter-spacing: -0.3px;
}
.sidebar-brand small {
  display: block;
  color: var(--sidebar-text);
  font-size: 11px;
  margin-top: 2px;
  opacity: 0.75;
}
.brand-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--amber-light) 0%, var(--amber) 55%, #9a6208 100%);
  color: #1a1204;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 8px 24px rgba(212, 146, 10, 0.35);
  flex-shrink: 0;
}
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; }

.nav-group { margin-bottom: 18px; }
.nav-group-label {
  padding: 0 12px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(184, 196, 212, 0.45);
}
.side-nav { display: grid; gap: 3px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-weight: 500;
  font-size: 13.5px;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  position: relative;
}
.side-nav a .side-icon,
.side-nav a svg.side-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; stroke: currentColor; }
.side-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e8edf4;
}
.side-nav a.active {
  background: linear-gradient(90deg, rgba(212, 146, 10, 0.18), rgba(212, 146, 10, 0.06));
  color: var(--sidebar-active);
  font-weight: 600;
}
.side-nav a.active::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--amber-light);
  border-radius: 0 3px 3px 0;
}
.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11px;
  color: rgba(184, 196, 212, 0.5);
}

.app-shell {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  width: 100%;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.topbar-main { flex: 1; min-width: 0; }
.topbar-crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  line-height: 1.3;
}
.crumb-link {
  color: var(--muted);
  font-weight: 600;
  transition: color var(--transition);
}
.crumb-link:hover { color: var(--amber); }
.crumb-sep {
  display: inline-flex;
  align-items: center;
  color: var(--fog);
}
.crumb-sep-icon,
.crumb-sep-icon svg { width: 14px; height: 14px; stroke: currentColor; }
.crumb-group { color: var(--muted); font-weight: 500; }
.crumb-current {
  color: var(--ink);
  font-weight: 700;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.35px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 10px;
  font-weight: 700;
  color: var(--amber);
  margin: 0 0 3px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  flex-shrink: 0;
}
.user-meta { line-height: 1.25; }
.user-meta span { display: block; font-weight: 700; font-size: 13px; color: var(--ink); }
.user-meta small { display: block; color: var(--muted); font-size: 11px; }

/* ── Content ── */
.content {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px 24px 28px;
  box-sizing: border-box;
  min-width: 0;
}
.page-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  display: grid;
  gap: 18px;
  min-width: 0;
}
/* ── Page hero (judul + filter terpadu, gaya welcome banner) ── */
.page-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 24px;
  padding: 24px 26px;
  margin-bottom: 6px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(ellipse 90% 120% at 100% 0%, rgba(255, 220, 140, 0.22), transparent 55%),
    linear-gradient(128deg, #e8a82a 0%, #c2780a 36%, #9a6208 68%, #4a3410 100%);
  box-shadow: 0 14px 40px rgba(154, 98, 8, 0.28);
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -50px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.page-hero-text {
  flex: 1 1 280px;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.page-hero-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: #fff;
}
.page-hero-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  max-width: 520px;
  font-weight: 500;
}
.page-hero-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
}
.hero-filter-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 158px;
}
.hero-filter-field span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.82);
}
.hero-filter-field input[type="date"] {
  height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.hero-filter-field input[type="date"]:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}
.btn-hero {
  height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #fff8eb;
  color: #78350f;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn-hero:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}
.page-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.page-hero:not(.has-filter) .page-hero-actions { margin-left: auto; }
.page-section-header,
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}
.section-heading {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.section-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.section-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ── Alerts & toasts ── */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1.5px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  animation: slideDown 0.35s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

.toast-stack {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 20px;
  z-index: 100;
  display: grid;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}
.toast-stack .alert {
  margin: 0;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ── Cards ── */
.card, .large-card {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-xs);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: box-shadow var(--transition);
}
.card:hover, .large-card:hover { box-shadow: var(--shadow-sm); }
.large-card {
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  background: linear-gradient(180deg, #fff 0%, #fdfbf7 100%);
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.card-title h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.25px;
  color: var(--ink);
}
/* Header kartu — aksen kiri, bersih */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  border-left: 4px solid #d4920a;
}
.card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--ink);
}
.card-head-amber { border-left-color: #d4920a; background: linear-gradient(90deg, #fffbeb 0%, #fff 55%); }
.card-head-amber h3 { color: #92400e; }
.card-head-blue { border-left-color: #2563eb; background: linear-gradient(90deg, #eff6ff 0%, #fff 55%); }
.card-head-blue h3 { color: #1e40af; }
.card-head-green { border-left-color: #16a34a; background: linear-gradient(90deg, #f0fdf4 0%, #fff 55%); }
.card-head-green h3 { color: #166534; }
.card-head-teal { border-left-color: #0d9488; background: linear-gradient(90deg, #f0fdfa 0%, #fff 55%); }
.card-head-teal h3 { color: #0f766e; }
.card-head-purple { border-left-color: #7c3aed; background: linear-gradient(90deg, #f5f3ff 0%, #fff 55%); }
.card-head-purple h3 { color: #5b21b6; }
.card-head-gold { border-left-color: #ea580c; background: linear-gradient(90deg, #fff7ed 0%, #fff 55%); }
.card-head-gold h3 { color: #9a3412; }
.card-head-red { border-left-color: #dc2626; background: linear-gradient(90deg, #fef2f2 0%, #fff 55%); }
.card-head-red h3 { color: #991b1b; }
.card-head-slate { border-left-color: #64748b; background: linear-gradient(90deg, #f8fafc 0%, #fff 55%); }
.card-head-slate h3 { color: #334155; }
.badge-soft {
  background: rgba(255, 255, 255, 0.85);
  color: inherit;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-weight: 700;
  font-size: 11px;
}

/* Kartu panel + tabel full-bleed */
.card-panel,
.collapsible-card,
.summary-card {
  padding: 0;
  overflow: hidden;
}
.card-panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #faf8f4;
  border-bottom: 1px solid var(--line);
}
.card-panel-toolbar .pill-row { width: auto; margin: 0; }
.card-panel-toolbar .table-search { max-width: 280px; min-width: 180px; }
.summary-card-body { padding: 14px 16px 16px; }
.card-panel .table-fullbleed {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  width: 100%;
}
.data-table-fill {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
}
.data-table-fill th,
.data-table-fill td {
  white-space: nowrap;
}
.data-table-fill th:last-child,
.data-table-fill td:last-child {
  width: 1%;
}

/* ── KPI cards ── */
.grid-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
  width: 100%;
  min-width: 0;
}
.kpi-card {
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  color: #fff;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card::after {
  content: "";
  position: absolute;
  right: -20px; top: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.kpi-card .label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.88;
  position: relative;
}
.kpi-card .value {
  font-size: 22px;
  font-weight: 800;
  margin-top: 10px;
  letter-spacing: -0.6px;
  line-height: 1.15;
  position: relative;
  word-break: break-word;
}
.kpi-card small {
  display: block;
  margin-top: 6px;
  opacity: 0.82;
  font-size: 12px;
  position: relative;
}
.kpi-blue { background: linear-gradient(135deg, #1d4ed8 0%, #0f2744 100%); }
.kpi-teal { background: linear-gradient(135deg, #0d9488 0%, #064e3b 100%); }
.kpi-green { background: linear-gradient(135deg, #16a34a 0%, #14532d 100%); }
.kpi-gold { background: linear-gradient(135deg, #d4920a 0%, #78350f 100%); }
.kpi-red { background: linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%); }
.kpi-purple { background: linear-gradient(135deg, #7c3aed 0%, #3b0764 100%); }
.kpi-slate { background: linear-gradient(135deg, #475569 0%, #0f172a 100%); }
.kpi-cyan { background: linear-gradient(135deg, #0891b2 0%, #164e63 100%); }

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  width: 100%;
  min-width: 0;
}

/* ── Filter bar (periode tanggal, kompak) ── */
.filter-bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  padding: 14px 16px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 4px;
}
.filter-bar .filter-field {
  min-width: 0;
  width: 168px;
  margin: 0;
}
.filter-bar .filter-field input {
  padding: 10px 12px;
  font-size: 13px;
}
.filter-bar .filter-submit {
  height: 42px;
  padding-inline: 18px;
  flex-shrink: 0;
}

/* ── Toolbar & tabs ── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  width: 100%;
}
.toolbar h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--ink);
}
.toolbar .pill-row {
  margin-left: auto;
  justify-content: flex-end;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  color: var(--slate);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.tabs a:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.tabs a.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--line);
}

/* ── Buttons ── */
.btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), opacity var(--transition);
  white-space: nowrap;
  line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn.sm { padding: 7px 11px; font-size: 12px; border-radius: 9px; }
.btn.full { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--amber-light) 0%, var(--amber) 100%);
  color: #1a1204;
  box-shadow: 0 2px 10px var(--amber-glow);
  font-weight: 700;
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(212, 146, 10, 0.32); }
.btn-dark {
  background: #1e293b;
  color: #fff;
  border: 0;
  box-shadow: 0 2px 8px rgba(15, 22, 35, 0.2);
}
.btn-dark:hover { background: #0f172a; }
.btn-outline {
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  color: var(--slate);
}
.btn-outline:hover { border-color: var(--amber); color: var(--ink); background: #fffdf8; }
.btn-danger { background: #fef2f2; color: #991b1b; border: 1.5px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-soft { background: var(--surface-2); color: var(--slate); border: 1.5px solid var(--line); }
.btn-soft:hover { background: #fff; border-color: var(--line-strong); }
.btn-success { background: #dcfce7; color: #166534; border: 1.5px solid #bbf7d0; }
.btn-warning { background: #fef3c7; color: #92400e; border: 1.5px solid #fde68a; }

/* ── Forms ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.one { grid-template-columns: 1fr; }
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ── Tables ── */
.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.data-table th, .data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.data-table th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table tbody tr { transition: background var(--transition), box-shadow var(--transition); }
.data-table tbody tr:hover td { background: #faf8f4; }
.data-table tbody tr.row-clickable { cursor: pointer; }
.data-table tbody tr.row-clickable:hover td { background: #fff9ee; }
.data-table tbody tr.row-clickable:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  position: sticky;
  right: 0;
  background: var(--surface);
  box-shadow: -6px 0 10px rgba(15, 22, 35, 0.04);
}
.data-table thead .col-actions { background: var(--surface-2); }
.data-table-fill .col-actions { min-width: 118px; }
.row-actions {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
  opacity: 1;
  transform: none;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition);
}
.data-table tbody tr:hover .row-actions,
.data-table tbody tr:focus-within .row-actions {
  box-shadow: var(--shadow-sm);
}
.row-action {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.row-action svg { width: 15px; height: 15px; stroke: currentColor; }
.row-action:hover { transform: scale(1.06); }
.row-action-preview:hover { background: #dbeafe; color: #1d4ed8; }
.row-action-edit:hover { background: #fef3c7; color: #b45309; }
.row-action-delete:hover { background: #fee2e2; color: #dc2626; }
.table-search {
  max-width: 260px;
  padding: 9px 12px 9px 36px;
  font-size: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7a8f' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-teal { background: #ccfbf1; color: #0f766e; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gold { background: #fef3c7; color: #92400e; }
.badge-slate { background: #e2e8f0; color: #334155; }

/* ── Summary & stats ── */
.summary-list { display: grid; gap: 0; }
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.summary-row:last-child { border-bottom: 0; }
.summary-row span { color: var(--muted); font-size: 13px; }
.summary-row strong { font-weight: 700; color: var(--ink); font-size: 14px; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat {
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color var(--transition);
}
.stat:hover { border-color: var(--amber); }
.stat span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.stat strong { display: block; font-size: 17px; font-weight: 800; margin-top: 6px; color: var(--ink); letter-spacing: -0.3px; }

.chart-box { min-height: 280px; max-height: 320px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.danger-text { color: var(--red); font-weight: 700; }
.ok-text { color: var(--green); font-weight: 700; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ── Utilities ── */
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* ── Login ── */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: #0a1019;
}
.login-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 16, 25, 0.55) 0%, rgba(10, 16, 25, 0.82) 55%, rgba(10, 16, 25, 0.92) 100%),
    url("https://images.unsplash.com/photo-1581094794329-cd293ae1a82e?auto=format&fit=crop&w=1920&q=80") center / cover no-repeat;
  pointer-events: none;
}
.login-center {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
}
.login-card {
  padding: 32px 28px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px) saturate(1.2);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.login-brand strong { display: block; font-size: 16px; color: var(--ink); }
.login-brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.login-card h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--ink);
}
.login-card .login-sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; line-height: 1.55; }
.login-demo {
  margin-top: 18px;
  padding: 0;
  border-radius: var(--radius);
  border: 1.5px dashed var(--line);
  background: var(--surface-2);
  overflow: hidden;
}
.login-demo summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--slate);
  list-style: none;
}
.login-demo summary::-webkit-details-marker { display: none; }
.login-demo p {
  margin: 0;
  padding: 0 14px 14px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.login-demo code {
  font-family: var(--mono);
  font-size: 11px;
  background: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

/* ── Error page ── */
.error-page {
  text-align: center;
  padding: 48px 32px;
  max-width: 480px;
  margin: 40px auto;
}
.error-code {
  font-size: 72px;
  font-weight: 900;
  letter-spacing: -4px;
  background: linear-gradient(135deg, var(--amber), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
}
.error-page h1 { font-size: 24px; margin: 0 0 12px; color: var(--ink); }
.error-page p { margin: 0 0 28px; }

/* ── Mobile tab bar & drawer ── */
.mobile-shell {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  pointer-events: none;
  width: 100%;
  max-width: 100%;
}
.mobile-shell > * { pointer-events: auto; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.55);
  backdrop-filter: blur(6px);
  z-index: 51;
}

.mobile-drawer {
  position: fixed;
  left: 0; right: 0; bottom: var(--bottom-nav);
  z-index: 52;
  max-height: min(78vh, 680px);
  background: linear-gradient(180deg, #fff 0%, #faf8f4 100%);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(15, 22, 35, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer-enter { transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1); }
.drawer-enter-from, .drawer-leave-to { transform: translateY(100%); }
.drawer-enter-to, .drawer-leave-from { transform: translateY(0); }
.drawer-leave { transition: transform 0.28s cubic-bezier(0.4, 0, 1, 1); }

.drawer-handle {
  width: 40px; height: 4px;
  background: var(--line-strong);
  border-radius: 999px;
  margin: 10px auto 6px;
  flex-shrink: 0;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer-user { display: flex; align-items: center; gap: 12px; }
.drawer-user strong { display: block; font-size: 15px; color: var(--ink); }
.drawer-user small { display: block; color: var(--muted); font-size: 12px; }
.drawer-close {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--slate);
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.drawer-close svg { width: 18px; height: 18px; }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 10px;
  -webkit-overflow-scrolling: touch;
}
.drawer-group { margin-bottom: 14px; }
.drawer-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0;
  padding: 10px 14px 6px;
}
.drawer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.drawer-list li + li { border-top: 1px solid var(--line); }
.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  transition: background var(--transition), color var(--transition);
}
.drawer-link:active { background: var(--surface-2); }
.drawer-link.active {
  background: #fffdf8;
  color: var(--ink);
  font-weight: 600;
}
.drawer-link.active .drawer-link-icon { color: var(--amber); stroke: var(--amber); }
.drawer-link-icon,
.drawer-link-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
  stroke: var(--muted);
}
.drawer-link-text { flex: 1; min-width: 0; }
.drawer-link-chevron,
.drawer-link-chevron svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.35;
  stroke: var(--muted);
}
.drawer-link.active .drawer-link-chevron { opacity: 0.55; }
.drawer-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.drawer-link-logout { color: var(--red); border-radius: 12px; border: 1px solid #fecaca; background: #fef2f2; }
.drawer-link-logout .drawer-link-icon { color: var(--red); stroke: var(--red); }

.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 53;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 0;
  min-height: var(--tabbar-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #0f1623;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.12);
}
.tab-item {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(184, 196, 212, 0.72);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color var(--transition);
  min-height: var(--tabbar-h);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tab-item span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}
.tab-item .tab-icon,
.tab-item .tab-icon svg { width: 20px; height: 20px; stroke: currentColor; flex-shrink: 0; }
.tab-item.active {
  color: var(--amber-light);
  box-shadow: inset 0 -2px 0 var(--amber-light);
}
.tab-item.tab-menu {
  font-family: inherit;
}
.tab-item:active { opacity: 0.85; }
.topbar-mobile-actions {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.topbar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--slate);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.topbar-icon-btn svg { width: 20px; height: 20px; stroke: currentColor; }
.topbar-avatar-mobile { display: block; }
.topbar-user-menu { position: relative; }
.topbar-avatar-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
}
.user-avatar-light {
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.topbar-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 22, 35, 0.16);
  padding: 8px;
  z-index: 60;
}
.topbar-user-dropdown[hidden] { display: none; }
.user-dropdown-head {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.user-dropdown-head strong { display: block; font-size: 14px; color: var(--ink); }
.user-dropdown-head small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #991b1b;
  font-weight: 700;
  font-size: 14px;
}
.user-dropdown-item:hover { background: #fef2f2; }
.user-dropdown-item svg { width: 16px; height: 16px; }

/* Filter mobile ringkas (ganti page-hero) */
.page-filter-mobile {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.page-filter-mobile-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}
.page-filter-mobile-form .hero-filter-field span { font-size: 10px; font-weight: 700; color: var(--muted); }
.page-filter-mobile-form input[type="date"] {
  height: 38px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
}
.btn-hero-sm {
  height: 38px;
  padding: 0 14px;
  font-size: 12px;
  white-space: nowrap;
}

/* ── Preview modal ── */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.preview-modal.open { pointer-events: auto; opacity: 1; }
.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 25, 0.52);
  backdrop-filter: blur(8px);
}
.preview-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: min(88vh, 780px);
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 28px 72px rgba(15, 22, 35, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.preview-modal.open .preview-panel { transform: translateY(0) scale(1); }
.preview-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98) 0%, #fff 100%),
    radial-gradient(ellipse 80% 120% at 0% 0%, rgba(251, 191, 36, 0.12), transparent 55%);
}
.preview-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.preview-header-icon svg { width: 20px; height: 20px; stroke: currentColor; }
.preview-header-text { flex: 1; min-width: 0; }
.preview-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amber);
}
.preview-header h3 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.35px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--slate);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.preview-close:hover { background: var(--surface-2); border-color: var(--line-strong); }
.preview-close svg { width: 18px; height: 18px; }
.preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 20px;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #faf8f4 0%, #fff 120px);
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.preview-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 15px;
  min-width: 0;
  border-left: 3px solid #fde68a;
  box-shadow: 0 1px 0 rgba(15, 22, 35, 0.03);
}
.preview-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}
.preview-chip-green { background: #dcfce7; color: #166534; }
.preview-chip-slate { background: #e2e8f0; color: #334155; }
.preview-chip-teal { background: #ccfbf1; color: #0f766e; }
.preview-item.span-2 { grid-column: 1 / -1; }
.preview-item dt,
.preview-item .preview-label {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.preview-item dd,
.preview-item .preview-value {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
  word-break: break-word;
}
.preview-dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
}
.preview-dl dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 12px;
}
.preview-dl dt:first-child { margin-top: 0; }
.preview-dl dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}
.preview-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: #faf8f4;
}
.preview-footer .btn { min-width: 100px; justify-content: center; }
.preview-footer .btn-preview-close { margin-right: auto; }

/* ── Edit modal ── */
.edit-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.edit-modal.open { pointer-events: auto; opacity: 1; }
.edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 25, 0.52);
  backdrop-filter: blur(8px);
}
.edit-panel {
  position: relative;
  width: min(600px, 100%);
  max-height: min(90vh, 820px);
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 28px 72px rgba(15, 22, 35, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.edit-modal.open .edit-panel { transform: translateY(0) scale(1); }
.edit-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98) 0%, #fff 100%),
    radial-gradient(ellipse 80% 120% at 100% 0%, rgba(251, 191, 36, 0.14), transparent 55%);
}
.edit-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.edit-header-icon svg { width: 20px; height: 20px; stroke: currentColor; }
.edit-header-text { flex: 1; min-width: 0; }
.edit-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amber);
}
.edit-header h3 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.35px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.edit-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--slate);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.edit-close svg { width: 18px; height: 18px; }
.edit-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.edit-body .form-grid { gap: 12px; }
.edit-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: #faf8f4;
  margin-top: 16px;
}

.span-full { grid-column: 1 / -1; }

/* ── SweetAlert2 ── */
.swal2-popup {
  font-family: var(--font) !important;
  border-radius: 20px !important;
  padding: 1.5rem !important;
}
.swal2-title { font-weight: 800 !important; letter-spacing: -0.3px !important; }
.swal2-confirm {
  border-radius: 12px !important;
  font-weight: 700 !important;
  padding: 10px 20px !important;
}
.swal2-cancel {
  border-radius: 12px !important;
  font-weight: 600 !important;
  padding: 10px 20px !important;
}

/* ── Form edit mode ── */
.large-card.is-editing {
  border-color: rgba(212, 146, 10, 0.45);
  box-shadow: 0 0 0 3px var(--amber-glow), var(--shadow-sm);
}

/* ── Print ── */
.print-only { display: none; }
.print-page { background: #fff; color: #111; padding: 28px; }
.print-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #111;
  padding-bottom: 16px;
  margin-bottom: 18px;
}
.print-table { width: 100%; border-collapse: collapse; }
.print-table th, .print-table td { border: 1px solid #333; padding: 8px; text-align: left; }
.signature { display: flex; justify-content: flex-end; margin-top: 60px; }
.signature div { text-align: center; min-width: 220px; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .section-grid { grid-template-columns: 1fr; }
  .form-grid.three { grid-template-columns: repeat(2, 1fr); }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block; }
  .sidebar { display: none !important; }
  .app-body { overflow-x: clip; }
  .app-shell {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }
  .topbar {
    padding: 12px 14px;
    min-height: 58px;
    gap: 10px;
    border-bottom: 0;
    background:
      radial-gradient(ellipse 90% 120% at 100% 0%, rgba(255, 220, 140, 0.22), transparent 55%),
      linear-gradient(128deg, #e8a82a 0%, #c2780a 36%, #9a6208 68%, #4a3410 100%);
    box-shadow: 0 4px 18px rgba(154, 98, 8, 0.22);
  }
  .topbar-mobile-head { min-width: 0; }
  .topbar-title {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
    line-height: 1.2;
  }
  .topbar-subtitle {
    margin: 3px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.82);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .topbar-mobile-actions { display: flex; flex-shrink: 0; align-items: center; }
  .page-hero.no-print { display: none !important; }
  .content {
    padding: 12px 12px calc(var(--bottom-nav) + 12px);
  }
  .page-inner,
  .card,
  .large-card,
  .grid-kpi,
  .section-grid,
  .toolbar,
  .tabs,
  .table-wrap,
  .stat-strip {
    max-width: 100%;
    min-width: 0;
  }
  .section-grid { gap: 12px; }
  .grid-kpi { grid-template-columns: 1fr; gap: 8px; margin-bottom: 10px; }
  .kpi-card { min-height: 100px; padding: 16px; }
  .kpi-card .value { font-size: clamp(18px, 5.5vw, 22px); }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .filter-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }
  .filter-bar .filter-field { width: 100%; max-width: none; }
  .filter-bar .filter-submit { width: 100%; height: 44px; }
  .table-search { max-width: 100%; }
  .pill-row { width: 100%; }
  .row-actions { opacity: 1; transform: none; }
  .col-actions { position: static; }
  .toast-stack {
    top: auto;
    bottom: calc(var(--bottom-nav) + 12px);
    right: 12px;
    left: 12px;
    max-width: none;
  }
  .login-center { max-width: 100%; }
  .login-card { padding: 28px 22px; }
  .stat-strip { grid-template-columns: 1fr; }
  .card, .large-card { border-radius: var(--radius-lg); }
  .card:not(.card-panel):not(.collapsible-card):not(.summary-card),
  .large-card:not(.collapsible-card) { padding: 14px; }
  .tabs {
    border-radius: var(--radius-sm);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .data-table { min-width: 680px; width: 100%; }
  .table-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card-panel-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .card-panel-toolbar .table-search { max-width: 100%; width: 100%; }
  .card-panel-toolbar .pill-row { width: 100%; }
  .page-filter-mobile-form {
    grid-template-columns: 1fr 1fr;
  }
  .page-filter-mobile-form .btn-hero-sm {
    grid-column: 1 / -1;
    width: 100%;
  }
  .page-section-header { flex-direction: column; align-items: flex-start; }
  .section-heading { font-size: 20px; }
  .preview-modal,
  .edit-modal { padding: 0; align-items: flex-end; }
  .preview-panel,
  .edit-panel {
    width: 100%;
    max-height: 90vh;
    border-radius: 22px 22px 0 0;
  }
  .preview-grid { grid-template-columns: 1fr; }
  .edit-body .form-grid { grid-template-columns: 1fr; }
  .row-actions { opacity: 1; transform: none; background: transparent; border: 0; padding: 0; box-shadow: none; }
}

/* ── Collapsible form cards ── */
.collapsible-card .collapsible-trigger {
  cursor: pointer;
  user-select: none;
  margin: 0;
  border-radius: 0;
}
.collapsible-card.is-collapsed { padding-bottom: 0; }
.collapsible-card:not(.is-collapsed) .collapsible-body {
  padding: 16px;
}
.collapsible-card .collapsible-arrow {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.08);
}
.collapsible-title-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.collapsible-arrow {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--slate);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition);
}
.collapsible-arrow svg { width: 18px; height: 18px; }
.collapsible-card.is-collapsed .collapsible-arrow { transform: rotate(-90deg); }
.collapsible-body {
  overflow: hidden;
  transition: max-height 0.32s ease, opacity 0.22s ease, margin 0.22s ease;
  max-height: 4000px;
  opacity: 1;
  margin-top: 14px;
}
.collapsible-card.is-collapsed .collapsible-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

/* ── Record detail pages ── */
.record-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  border-top: 4px solid #e8a82a;
}
.record-header-main { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; min-width: 0; }
.record-back { flex-shrink: 0; }
.record-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber);
}
.record-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.record-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.record-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
}
.record-header-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.record-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.record-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: #fff;
}
.record-card-amber .record-card-head { background: linear-gradient(135deg, #e8a82a, #c2780a); }
.record-card-slate .record-card-head { background: linear-gradient(135deg, #64748b, #475569); }
.record-card-teal .record-card-head { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.record-card-blue .record-card-head { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.record-card-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.record-card-icon {
  width: 36px; height: 36px; border-radius: 12px;
  background: rgba(255,255,255,.18);
  display: grid; place-items: center;
}
.record-card-icon svg { width: 18px; height: 18px; stroke: #fff; }
.record-dl { margin: 0; padding: 12px 16px 16px; }
.record-dl-row {
  display: grid;
  grid-template-columns: minmax(120px, 38%) 1fr;
  gap: 8px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.record-dl-row:last-child { border-bottom: 0; }
.record-dl dt { margin: 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.record-dl dd { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); word-break: break-word; }
.record-form-card { margin-top: 0; }
.bukti-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bukti-chip-label { font-weight: 700; color: var(--slate); }

/* ── Bukti preview modal ── */
.bukti-modal {
  position: fixed; inset: 0; z-index: 220;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; pointer-events: none; opacity: 0; transition: opacity .22s;
}
.bukti-modal.open { pointer-events: auto; opacity: 1; }
.bukti-backdrop { position: absolute; inset: 0; background: rgba(10,16,25,.58); backdrop-filter: blur(8px); }
.bukti-panel {
  position: relative; width: min(920px, 100%); max-height: min(90vh, 900px);
  background: #fff; border-radius: 22px; border: 1px solid var(--line);
  box-shadow: 0 28px 72px rgba(15,22,35,.24);
  display: flex; flex-direction: column; overflow: hidden;
}
.bukti-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf8, #fff);
}
.bukti-eyebrow { margin: 0; font-size: 11px; font-weight: 700; color: var(--amber); text-transform: uppercase; letter-spacing: .08em; }
.bukti-header h3 { margin: 2px 0 0; font-size: 17px; font-weight: 800; }
.bukti-header-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bukti-close {
  width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer;
}
.bukti-body { flex: 1; overflow: auto; padding: 16px; background: #f8f6f2; min-height: 280px; }
.bukti-preview-image { display: block; max-width: 100%; margin: 0 auto; border-radius: 14px; box-shadow: var(--shadow-sm); }
.bukti-preview-frame { width: 100%; min-height: 70vh; border: 0; border-radius: 12px; background: #fff; }

.table-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll-x .data-table { min-width: 720px; width: 100%; }
.table-scroll-x .data-table-fill { min-width: max(100%, 720px); }

@media (max-width: 860px) {
  .record-grid { grid-template-columns: 1fr; }
  .record-header { padding: 14px; border-radius: 18px; }
  .record-title { font-size: 18px; }
  .record-dl-row { grid-template-columns: 1fr; gap: 4px; }
  .record-header-actions { width: 100%; margin-left: 0; }
  .bukti-modal { padding: 0; align-items: flex-end; }
  .bukti-panel { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; }
}

@media print {
  .sidebar, .topbar, .mobile-shell, .no-print, .alert, .toast-stack { display: none !important; }
  .app-shell { margin: 0; width: 100%; }
  .content { padding: 0; margin: 0; max-width: none; }
  .print-only { display: block; }
  .card, .large-card { box-shadow: none; border: 0; }
  .print-page { padding: 0; }
  .data-table th { position: static; }
}
