* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

:root {
  color-scheme: light dark;
  --brand: #0060AF;
  --head-a: #0068B8;
  --head-b: #00438C;
  --btn: #0060AF;
  --bg: #EEF3F9;
  --surface: #FFFFFF;
  --surface-2: #F4F7FB;
  --border: #E1E8F1;
  --text: #14263D;
  --muted: #62738A;
  --price: #0060AF;
  --tint: #E4F0FB;
  --row-hover: #F2F8FE;
  --shadow: 0 6px 24px rgba(0, 64, 128, 0.10);
  --overlay: rgba(9, 24, 44, 0.48);
  --danger-bg: #FEF2F2;
  --danger-text: #B42318;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #4DA6EE;
    --head-a: #0B4A86;
    --head-b: #072F57;
    --btn: #1B78CC;
    --bg: #0A1220;
    --surface: #111C2E;
    --surface-2: #172538;
    --border: #1F3049;
    --text: #E8EEF7;
    --muted: #8FA1BB;
    --price: #62B8F7;
    --tint: #16304F;
    --row-hover: #15243A;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    --overlay: rgba(0, 0, 0, 0.62);
    --danger-bg: #3A1618;
    --danger-text: #FCA5A5;
  }
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

input {
  -webkit-user-select: text;
  user-select: text;
}

button {
  font: inherit;
  cursor: pointer;
}

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

/* Shell Layout - Maksimal Luas & Lebar */
.shell {
  height: 100vh;
  height: 100dvh;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Header */
.app-header {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 48px;
  color: #fff;
  background: linear-gradient(160deg, var(--head-a), var(--head-b));
  border-radius: 0 0 24px 24px;
  transition: padding-bottom .3s ease;
}

.app-header.header-collapsed {
  padding-bottom: 16px;
}

.header-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: #fff;
  color: #0060AF;
}

.brand h1 {
  margin: 0;
  font: 800 16px/1.2 'Plus Jakarta Sans', sans-serif;
}

#last-updated {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: rgba(255,255,255,.75);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 0;
  color: #fff;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.16);
  transition: background .2s ease;
}

.icon-btn:active {
  background: rgba(255,255,255,.28);
}

/* Quick Menu Card (Tombol Akses Ke File Lain) */
.quick-card {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  overflow: hidden;
  margin: -32px 14px 0;
  padding: 12px 6px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  max-height: 120px;
  transition: max-height .3s ease, opacity .25s ease, margin-top .3s ease, padding .3s ease;
}

.quick-card.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  box-shadow: none;
}

.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  color: var(--text);
  text-decoration: none;
}

.quick-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--tint);
  color: var(--brand);
}

.quick-label {
  font-size: 12px;
  font-weight: 600;
}

/* SIDEBAR DRAWER HAMBURGER */
.sidebar-overlay {
  background: var(--overlay);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
}

.sidebar-drawer {
  width: 280px;
  max-width: 80vw;
  background: var(--surface);
  color: var(--text);
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.sidebar-drawer.active {
  transform: translateX(0);
}

/* Tab buttons di dalam Hamburger Sidebar Drawer */
#tabs-nav .tab-btn {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  transition: all .2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#tabs-nav .tab-btn.tab-active {
  background: var(--btn);
  color: #ffffff;
  border-color: var(--btn);
  box-shadow: 0 4px 12px rgba(0, 96, 175, 0.25);
}

/* Full Content Area & Table */
.main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 10px calc(10px + env(safe-area-inset-bottom, 0px));
}

.table-card {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.table-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

#data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

#data-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

#data-table td {
  padding: 14px;
  font-size: 13.5px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

#data-table th:nth-child(1), #data-table td:nth-child(1) { width: 50%; text-align: left; font-weight: 600; word-break: break-word; }
#data-table th:nth-child(2), #data-table td:nth-child(2) { width: 25%; text-align: center; }
#data-table th:nth-child(3), #data-table td:nth-child(3) { width: 25%; text-align: right; white-space: nowrap; }

.kode-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font: 500 11.5px ui-monospace, monospace;
}

.harga-chip {
  font: 800 14px 'Plus Jakarta Sans', sans-serif;
  color: var(--price);
}

/* Modals & Bottom Sheets */
.overlay {
  background: var(--overlay);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet {
  width: 100%;
  max-width: 480px;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  color: var(--text);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
}

@media (min-width: 640px) {
  .overlay { align-items: center; padding: 16px; }
  .sheet { border-radius: 24px; }
}

.sheet-handle { width: 40px; height: 4px; margin: 0 auto 16px; border-radius: 999px; background: var(--border); }
.sheet-icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--tint); color: var(--brand); }
.sheet h3 { margin: 0; font: 700 17px 'Plus Jakarta Sans', sans-serif; }
.sheet p.lead { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.center { text-align: center; }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; }

.btn { flex: 1; padding: 13px; border: 0; border-radius: 12px; font-size: 14px; font-weight: 700; text-align: center; }
.btn-primary { background: var(--btn); color: #fff; }
.btn-secondary { background: var(--tint); color: var(--brand); }
.btn-text { background: none; color: var(--muted); font-weight: 600; }

.field { width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 14.5px; color: var(--text); background: var(--surface-2); border: 1.5px solid var(--border); }
.form-error { margin: 6px 2px 0; font-size: 12.5px; font-weight: 600; color: var(--danger-text); }

.option { width: 100%; display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--border); text-align: left; }
.option .sheet-icon { width: 40px; height: 40px; margin: 0; border-radius: 12px; }

.bulk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pill-btn { padding: 6px 12px; border: 0; border-radius: 999px; background: var(--tint); color: var(--brand); font-size: 12.5px; font-weight: 600; }
#bulk-sheet-list { max-height: 40vh; overflow-y: auto; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
#bulk-sheet-list label { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }

.loading-card { display: flex; align-items: center; gap: 12px; padding: 16px 22px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); font-size: 13.5px; font-weight: 600; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--tint); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }



/* Badge Petunjuk Hamburger Berkedip */
.menu-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  display: flex;
  height: 12px;
  width: 12px;
  pointer-events: none;
}

/* Gelombang Radar Berkedip Lambat */
.badge-ping {
  position: absolute;
  display: inline-flex;
  height: 100%;
  width: 100%;
  border-radius: 9999px;
  background-color: #38bdf8; /* Warna Cyan / Biru Terang */
  opacity: 0.75;
  animation: ping-slow 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Titik Pusat */
.badge-dot {
  position: relative;
  display: inline-flex;
  border-radius: 9999px;
  height: 12px;
  width: 12px;
  background-color: #0284c7;
  border: 2px solid #ffffff;
}

/* Keyframe Animasi Kedip Lembut */
@keyframes ping-slow {
  75%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}


