@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: none; text-size-adjust: none; }
body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: #f0f2f5;
  color: #18202a;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
input, select, textarea {
  width: 100%;
  padding: .85rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #18202a;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #046a70;
  box-shadow: 0 0 0 3px rgba(4,106,112,.12);
}
textarea { min-height: 110px; resize: vertical; }
label span {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .4rem;
  color: #475569;
}
.hidden { display: none !important; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: .7rem 1.2rem;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
  transition: all .2s;
  white-space: nowrap;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-primary {
  background: #046a70;
  color: #fff;
  border-color: #046a70;
}
.btn-primary:hover { background: #035c62; }
.btn-sm { min-height: 34px; padding: .4rem .85rem; font-size: .82rem; border-radius: 8px; }
.btn-danger { background: #fff0f3; color: #be123c; border-color: #fecdd3; }
.btn-danger:hover { background: #ffe4e6; }

/* ============================================================
   ALERTS (inline)
   ============================================================ */
.alert {
  padding: .9rem 1.1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-weight: 500;
  font-size: .92rem;
}
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }

/* ============================================================
   TOAST NOTIFICATION (modern, menggantikan alert biasa)
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  padding: .85rem 1.1rem;
  border-radius: 16px;
  font-size: .88rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(15,23,42,.14), 0 2px 8px rgba(15,23,42,.08);
  pointer-events: all;
  animation: toastIn .35s cubic-bezier(.34,1.56,.64,1) both;
  position: relative;
  overflow: hidden;
}
.toast::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}
.toast-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.toast-success::before { background: #16a34a; }
.toast-error {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
}
.toast-error::before { background: #e11d48; }
.toast-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.toast-info::before { background: #2563eb; }
.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.toast-body { flex: 1; }
.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  opacity: .5;
  transition: opacity .15s;
  min-height: unset;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  border-radius: 4px;
}
.toast-close:hover { opacity: 1; background: rgba(0,0,0,.06); }
.toast.hide {
  animation: toastOut .3s ease forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(.95); }
  to   { opacity: 1; transform: translateX(0)   scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(40px) scale(.95); }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body, .install-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #e8f4f5 0%, #f0f2f5 50%, #e8f0f5 100%);
}
.login-shell, .install-shell {
  width: min(100%, 1180px);
  padding: 24px;
}
.login-card, .install-card {
  background: #fff;
  border: 1.5px solid #e8edf3;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(4,106,112,.1);
  padding: 32px;
  max-width: 440px;
  margin: 0 auto;
}
.install-card.wide { max-width: 1120px; }
.brand-line, .brand-box, .brand-preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1.5rem;
}
.brand-mark, .sheet-logo {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, #d6a315, #046a70);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}
.brand-mark.large { width: 72px; height: 72px; font-size: 1.3rem; }
.brand-logo, .brand-logo-lg {
  width: 52px; height: 52px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
}
.brand-logo-lg { width: 72px; height: 72px; }
.login-card h1, .install-header h1 { margin: .2rem 0 0; font-size: 1.6rem; font-weight: 800; }
.login-card p, .install-header p  { margin: .3rem 0 0; color: #64748b; font-size: .95rem; }

/* ============================================================
   FORMS GRID
   ============================================================ */
.grid-form { display: grid; gap: 1rem; }
.grid-form.compact { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid.two, .content-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid .full { grid-column: 1 / -1; }
.actions-row { display: flex; justify-content: flex-end; }

/* ============================================================
   INSTALL CARDS
   ============================================================ */
.card-block {
  padding: 1.1rem;
  border: 1.5px solid #e8edf3;
  border-radius: 16px;
  background: #fafbfd;
}
.card-block h3, .card-block h2 { margin: 0 0 1rem; font-size: 1rem; font-weight: 700; }
.require-list { display: grid; gap: .6rem; }
.require-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1rem;
  border: 1.5px solid #e8edf3;
  border-radius: 12px;
  background: #fff;
  font-size: .9rem;
}
.status-ok  { color: #16a34a; font-weight: 700; }
.status-bad { color: #dc2626; font-weight: 700; }
.compact-panel { padding: 1rem; }

/* ============================================================
   APP SHELL — DESKTOP SIDEBAR LAYOUT
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  padding: 20px 16px;
  background: #fff;
  border-right: 1.5px solid #e8edf3;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 20px;
  border-bottom: 1.5px solid #f1f5f9;
  margin-bottom: 8px;
}
.sidebar-brand h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}
.sidebar-brand p {
  margin: 2px 0 0;
  font-size: .75rem;
  color: #94a3b8;
}

/* ── Menu items with icon support ── */
.menu { display: grid; gap: 4px; }
.menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .75rem 1rem;
  border-radius: 12px;
  color: #64748b;
  font-weight: 600;
  font-size: .9rem;
  transition: all .2s;
}
.menu-link:hover { background: #f1f5f9; color: #0f172a; }
.menu-link.active {
  background: linear-gradient(90deg, #e8f4f5 0%, #f0fafb 100%);
  color: #046a70;
  box-shadow: inset 3px 0 0 #046a70;
}
.menu-link .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: .65;
  transition: opacity .2s;
}
.menu-link:hover .icon { opacity: .9; }
.menu-link.active .icon { opacity: 1; }
.menu-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}
.menu-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.menu-section {
  font-size: .72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 12px 10px 4px;
}
.menu-logout {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1.5px solid #f1f5f9;
}

/* ── Main content ── */
.main-content {
  padding: 28px;
  min-width: 0;
}

/* ── Topbar ── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.topbar h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
}
.topbar p { margin: .2rem 0 0; color: #64748b; font-size: .9rem; }
.topbar > div:first-child h1 { margin: 0; font-size: 1.6rem; font-weight: 800; }
.topbar > div:first-child p  { margin: .2rem 0 0; color: #64748b; font-size: .9rem; }
.topbar-left h1 { margin: 0; font-size: 1.6rem; font-weight: 800; }
.topbar-left p  { margin: .2rem 0 0; color: #64748b; font-size: .9rem; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Hamburger toggle — desktop hidden */
.hamburger { display: none; }

/* ============================================================
   STAT CARDS — Warna per kategori (Fase 1)
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: #fff;
  border: 1.5px solid #e8edf3;
  border-radius: 20px;
  padding: 1.2rem 1.2rem 1rem;
  box-shadow: 0 2px 12px rgba(15,23,42,.04);
  transition: transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 20px 20px 0 0;
  background: #e2e8f0;
}
/* Warna accent top-border per kategori */
.stat-card.card-teal::before   { background: linear-gradient(90deg, #046a70, #0891b2); }
.stat-card.card-gold::before   { background: linear-gradient(90deg, #d6a315, #f59e0b); }
.stat-card.card-green::before  { background: linear-gradient(90deg, #16a34a, #22c55e); }
.stat-card.card-rose::before   { background: linear-gradient(90deg, #e11d48, #f43f5e); }

.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(15,23,42,.1); }
.stat-card-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: .8rem;
}
.stat-card-icon svg { width: 22px; height: 22px; }
.stat-card-icon.teal   { background: #e8f4f5; color: #046a70; }
.stat-card-icon.gold   { background: #fef9ec; color: #b45309; }
.stat-card-icon.green  { background: #f0fdf4; color: #16a34a; }
.stat-card-icon.rose   { background: #fff1f2; color: #e11d48; }
.stat-card span {
  display: block;
  color: #64748b;
  font-size: .82rem;
  font-weight: 500;
  margin-bottom: .3rem;
}
.stat-card strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  display: block;
  line-height: 1.15;
}
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .78rem;
  font-weight: 600;
  margin-top: .4rem;
  padding: 2px 8px;
  border-radius: 999px;
}
.stat-trend.up   { background: #f0fdf4; color: #16a34a; }
.stat-trend.down { background: #fff1f2; color: #e11d48; }

/* Hero dashboard card (dark teal gradient) */
.dash-hero {
  background: linear-gradient(135deg, #046a70 0%, #035c62 60%, #024a50 100%);
  border-radius: 24px;
  padding: 1.5rem;
  color: #fff;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}
.dash-hero::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
}
.dash-hero::before {
  content: '';
  position: absolute;
  bottom: -60px; left: -30px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,.03);
  border-radius: 50%;
}
.dash-hero h2 { margin: 0 0 .3rem; font-size: 1.3rem; font-weight: 800; position: relative; z-index: 1; }
.dash-hero p  { margin: 0 0 1.2rem; opacity: .75; font-size: .88rem; position: relative; z-index: 1; }
.dash-hero-stats {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.dash-hero-stat {
  flex: 1;
  min-width: 100px;
  padding-right: 1rem;
  border-right: 1px solid rgba(255,255,255,.15);
  margin-right: 1rem;
}
.dash-hero-stat:last-child { border-right: none; margin-right: 0; }
.dash-hero-stat .lbl { font-size: .78rem; opacity: .7; margin-bottom: .2rem; }
.dash-hero-stat .val { font-size: 1.4rem; font-weight: 800; }
.dash-hero-stat .chg { font-size: .75rem; color: #6ee7b7; margin-top: 2px; }

/* ============================================================
   PANELS & CARDS
   ============================================================ */
.panel {
  background: #fff;
  border: 1.5px solid #e8edf3;
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 2px 12px rgba(15,23,42,.04);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
}
.panel-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.content-grid { display: grid; gap: 1rem; }
.content-grid.wide-right { grid-template-columns: 1fr 1.3fr; }

/* ── Chart container ── */
.chart-wrap {
  position: relative;
  height: 240px;
  margin-top: .5rem;
}
.chart-panel {
  background: #fff;
  border: 1.5px solid #e8edf3;
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 2px 12px rgba(15,23,42,.04);
  margin-bottom: 1.25rem;
}
.chart-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.chart-panel-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.chart-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .78rem;
  font-weight: 600;
}
.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
}
.chart-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chart-toggle {
  display: flex;
  gap: 4px;
}
.chart-toggle button {
  padding: 4px 12px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  color: #64748b;
  transition: all .15s;
}
.chart-toggle button.active {
  background: #046a70;
  color: #fff;
  border-color: #046a70;
}

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1.5px solid #e8edf3;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
th, td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  white-space: nowrap;
  font-size: .88rem;
}
th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
}
.badge-sale     { background: #f0fdf4; color: #16a34a; }
.badge-purchase { background: #eff6ff; color: #1d4ed8; }
.link-inline {
  color: #046a70;
  font-weight: 600;
  font-size: .82rem;
  margin-right: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  transition: background .15s;
}
.link-inline:hover { background: #e8f4f5; }
.danger-link { color: #dc2626; }
.danger-link:hover { background: #fff1f2; }

/* ============================================================
   SUMMARY BOX (invoice form preview)
   ============================================================ */
.summary-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
  border: 1.5px solid #e8edf3;
  border-radius: 16px;
  background: #f8fafc;
}
.summary-box strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  margin-top: .2rem;
  color: #046a70;
}

/* ============================================================
   FILTER PANEL
   ============================================================ */
.filter-panel { margin-bottom: 1rem; }
.inline-filter { align-items: end; }
.filter-actions { display: flex; gap: .75rem; align-items: end; }

/* ============================================================
   BOTTOM NAVIGATION — Mobile only
   ============================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1.5px solid #e8edf3;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(15,23,42,.08);
}
.bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 480px;
  margin: 0 auto;
}
.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  color: #94a3b8;
  font-size: .65rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s;
  text-decoration: none;
}
.bnav-item svg { width: 22px; height: 22px; }
.bnav-item.active { color: #046a70; }
.bnav-item.active svg {
  filter: drop-shadow(0 0 4px rgba(4,106,112,.35));
}
.bnav-fab {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #046a70, #035c62);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -16px;
  box-shadow: 0 4px 18px rgba(4,106,112,.45);
  transition: transform .2s, box-shadow .2s;
}
.bnav-fab:hover { transform: scale(1.08); box-shadow: 0 6px 22px rgba(4,106,112,.55); }
.bnav-fab svg { width: 24px; height: 24px; }
.bnav-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #046a70;
  margin-top: 1px;
}
/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.4);
  z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ============================================================
   PREVIEW CARD
   ============================================================ */
.preview-card small { color: #64748b; }

/* ============================================================
   PRINT / INVOICE SHEET — ⚠️ ZONA TERPROTEKSI — JANGAN UBAH
   ============================================================ */
.print-body { background: #eef2f5; padding: 24px; }
.print-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 0 auto 18px;
  max-width: 210mm;
}
.sheet {
  width: min(100%, 960px);
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(15,23,42,.08);
}
.sheet-half-a4 {
  width: 190mm;
  min-height: 133mm;
  margin: 0 auto;
  background: #fff;
  border-radius: 0;
  box-shadow: 0 0 0 1px #d9d9d9;
  padding: 9mm 10mm 8mm;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid #141414;
  padding-bottom: 18px;
  margin-bottom: 20px;
}
.sheet-brand { display: flex; gap: 14px; align-items: flex-start; }
.sheet-logo-img { width: 58px; height: 58px; object-fit: cover; border-radius: 18px; }
.sheet-brand h1 { margin: 0; font-size: 1.8rem; }
.sheet-brand p, .sheet-meta div:last-child, .muted { margin: .2rem 0 0; color: #5a5a5a; }
.sheet-meta { text-align: right; }
.sheet-meta .label { text-transform: uppercase; letter-spacing: .08em; color: #777; font-size: .8rem; }
.sheet-meta .number { font-size: 1.18rem; font-weight: 800; margin: .2rem 0; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.sheet-box { border: 1px solid #e1e1e1; border-radius: 16px; padding: 16px; }
.sheet-box h3 { margin: 0 0 .6rem; font-size: .92rem; text-transform: uppercase; letter-spacing: .08em; color: #666; }
.sheet-box p { margin: 0; }
.sheet-table { width: 100%; border-collapse: collapse; }
.sheet-table th, .sheet-table td { padding: 12px; border-bottom: 1px solid #e9e9e9; text-align: left; }
.sheet-summary { margin-left: auto; max-width: 360px; margin-top: 18px; }
.sheet-summary .line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #d7d7d7; }
.sheet-summary .line.total { border-bottom: 2px solid #111; padding-top: 14px; font-size: 1.1rem; }
.notes-box { margin-top: 20px; }
.no-print {}

/* Print rebuild v3 */
.print-body .sheet-head {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 8mm;
  align-items: start;
  padding-bottom: 4mm;
  margin-bottom: 4mm;
  border-bottom: 0.5mm solid #222;
}
.print-body .sheet-brand { gap: 4mm; align-items: flex-start; }
.print-body .sheet-brand h1 { margin: 0 0 2mm; font-size: 16pt; line-height: 1.15; }
.print-body .sheet-brand p,
.print-body .sheet-meta,
.print-body .sheet-box,
.print-body .sheet-table,
.print-body .sheet-summary { font-size: 10.5pt; line-height: 1.35; }
.print-body .sheet-logo,
.print-body .sheet-logo-img { width: 18mm; height: 18mm; min-width: 18mm; object-fit: contain; border-radius: 0; }
.print-body .sheet-meta { text-align: right; }
.print-body .sheet-meta .label { text-transform: uppercase; letter-spacing: .08em; color: #6a6a6a; font-size: 9pt; }
.print-body .sheet-meta .number { margin: 1mm 0; font-size: 14pt; font-weight: 700; }
.print-body .sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; margin-bottom: 4mm; }
.print-body .sheet-box { min-height: 29mm; border: 0.35mm solid #cfcfcf; border-radius: 0; padding: 4mm; }
.print-body .sheet-box h3 { margin: 0 0 3mm; font-size: 9pt; text-transform: uppercase; letter-spacing: .12em; color: #5b5b5b; }
.print-body .sheet-box p { margin: 0; white-space: pre-line; }
.print-body .sheet-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-bottom: 4mm; }
.print-body .sheet-table th, .print-body .sheet-table td { border: 0.3mm solid #bdbdbd; padding: 3mm 2.5mm; vertical-align: middle; }
.print-body .sheet-table th { background: #f3f3f3; font-weight: 700; text-align: left; }
.print-body .sheet-table th:nth-child(1), .print-body .sheet-table td:nth-child(1) { width: 30%; }
.print-body .sheet-table th:nth-child(2), .print-body .sheet-table td:nth-child(2) { width: 14%; text-align: center; }
.print-body .sheet-table th:nth-child(3), .print-body .sheet-table td:nth-child(3) { width: 14%; text-align: center; }
.print-body .sheet-table th:nth-child(4), .print-body .sheet-table td:nth-child(4) { width: 19%; text-align: right; }
.print-body .sheet-table th:nth-child(5), .print-body .sheet-table td:nth-child(5) { width: 23%; text-align: right; }
.print-body .sheet-summary { width: 78mm; margin-left: auto; margin-top: 1mm; border-top: 0.5mm solid #222; padding-top: 2mm; }
.print-body .sheet-summary .line { display: grid; grid-template-columns: 1fr auto; gap: 4mm; padding: 2mm 0; border-bottom: 0.2mm dashed #c9c9c9; }
.print-body .sheet-summary .line.total { font-size: 11pt; font-weight: 700; border-bottom: 0.5mm solid #222; }
.print-body .notes-box { display: none !important; }

/* ============================================================
   RESPONSIVE — MOBILE FIRST
   ============================================================ */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    z-index: 200;
    box-shadow: 4px 0 24px rgba(15,23,42,.15);
    overflow-y: auto;
  }
  .sidebar.open { display: flex; }
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
  }
  .hamburger svg { width: 20px; height: 20px; color: #334155; }
  .bottom-nav { display: block; }
  .main-content {
    padding: 16px 16px 90px;
  }
  .topbar { margin-bottom: 1rem; }
  .topbar h1,
  .topbar-left h1 { font-size: 1.3rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .content-grid.two-col,
  .content-grid.wide-right,
  .grid.two,
  .summary-box { grid-template-columns: 1fr; }
  .filter-actions { display: grid; }
  .dash-hero-stats { gap: .5rem; }
  .dash-hero-stat { min-width: calc(50% - .5rem); }
  .toast-container { top: 12px; right: 12px; left: 12px; }
  .toast { min-width: unset; max-width: 100%; }
  .chart-wrap { height: 200px; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .stat-card strong { font-size: 1.2rem; }
}

/* ============================================================
   @media print — ⚠️ ZONA TERPROTEKSI — JANGAN UBAH
   ============================================================ */
@page { size: A4 portrait; margin: 10mm; }
@media print {
  html, body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .no-print, .sidebar, .topbar, .page-head, .actions, .app-shell, .bottom-nav, .hamburger, .sidebar-overlay {
    display: none !important;
  }
  .print-body { background: #fff !important; padding: 0 !important; }
  .sheet-half-a4 {
    width: 190mm !important;
    min-height: 133mm !important;
    margin: 0 auto !important;
    padding: 8mm 9mm 7mm !important;
    box-shadow: none !important;
    border: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .print-body .sheet-head,
  .print-body .sheet-grid,
  .print-body .sheet-table,
  .print-body .sheet-summary { break-inside: avoid; page-break-inside: avoid; }
}
