/* ========================================
   Design Tokens
   ======================================== */
:root {
  --bg: #ffffff;
  --bg-alt: #f7f7f8;
  --bg-hover: #f3f3f4;
  --ink: #18181b;
  --ink-soft: #52525b;
  --ink-muted: #a1a1aa;
  --line: #e4e4e7;
  --line-soft: #ececef;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --ok-bg: #dcfce7;
  --warn-bg: #fef3c7;
  --danger-bg: #fee2e2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ========================================
   Layout
   ======================================== */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

main {
  background: var(--bg);
  padding: 28px 32px 64px;
  overflow-x: hidden;
}

/* ========================================
   Sidebar
   ======================================== */
aside {
  border-right: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 24px;
}
.brand-mark {
  width: 28px; height: 28px;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.brand-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.brand-name small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 1px;
}

nav { flex: 1; }
nav ul { list-style: none; }
nav li { margin-bottom: 1px; }
nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
nav a:hover { background: var(--bg-hover); color: var(--ink); }
nav a.active {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0,0,0,0.03);
}
nav a svg { flex-shrink: 0; opacity: 0.7; }
nav a.active svg { opacity: 1; }
nav a .num {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-muted);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
nav a.active .num { background: var(--bg-alt); }

.nav-section {
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  padding: 0 10px;
  margin: 18px 0 6px;
  font-weight: 600;
}

.sidebar-foot {
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
}
.sidebar-foot .name { font-weight: 500; font-size: 13px; }
.sidebar-foot .role { font-size: 11.5px; color: var(--ink-muted); }
.sidebar-foot .info { flex: 1; min-width: 0; }
.logout-form { margin: 0; }
.logout-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-muted);
  width: 28px; height: 28px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logout-btn:hover { background: var(--bg-hover); color: var(--ink); border-color: var(--line); }

/* ========================================
   Page Header
   ======================================== */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-head h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}
.page-head p {
  color: var(--ink-soft);
  font-size: 13.5px;
}
.page-head-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.page-head-text { flex: 1; min-width: 0; }
.page-head-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  transition: background 0.12s, border 0.12s;
  white-space: nowrap;
  height: 34px;
  text-decoration: none;
}
.btn:hover { background: var(--bg-alt); border-color: #d4d4d8; }
.btn-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn-primary:hover { background: #27272a; border-color: #27272a; }
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-block { width: 100%; justify-content: center; }

.menu-toggle {
  display: none;                    /* hidden di desktop, shown @≤1024px */
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
  margin-right: 4px;
}
.menu-toggle:hover { background: var(--bg-alt); border-color: var(--ink-muted); }

/* ========================================
   Top Navbar (mobile/tablet only)
   Hamburger di kiri + brand di tengah + avatar di kanan.
   Hidden di desktop — sidebar full di kiri.
   ======================================== */
.topbar { display: none; }

@media (max-width: 1024px) {
  .topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    padding: 0 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    z-index: 30;
  }
  .topbar-menu {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s, border-color 0.12s;
  }
  .topbar-menu:hover  { background: var(--line); border-color: var(--ink-muted); }
  .topbar-menu:active { background: var(--line); }

  .topbar-brand {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    overflow: hidden;
  }
  .topbar-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-brand-sub {
    font-size: 11px;
    color: var(--ink-muted);
    white-space: nowrap;
  }

  .topbar-user { flex-shrink: 0; }
  .topbar-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
  }
}

/* ========================================
   Alerts
   ======================================== */
.alert {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: rgba(22,163,74,0.2); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: rgba(220,38,38,0.2); }
.alert-info  { background: var(--accent-soft); color: var(--accent);  border-color: rgba(37,99,235,0.2); }
.alert-warn  { background: var(--warn-bg);    color: var(--warn);    border-color: rgba(217,119,6,0.25); }

/* ========================================
   Welcome / Dashboard
   ======================================== */
.welcome-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.welcome-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border 0.12s, box-shadow 0.12s;
}
.welcome-card:hover {
  border-color: var(--ink-muted);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.welcome-icon {
  width: 40px; height: 40px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  margin-bottom: 4px;
}
.welcome-card h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.welcome-card p {
  font-size: 13px;
  color: var(--ink-soft);
}

/* ========================================
   Error page
   ======================================== */
.error-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-card {
  text-align: center;
  max-width: 400px;
}
.error-card h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}
.error-card p {
  color: var(--ink-soft);
  margin-bottom: 20px;
}

/* ========================================
   Scrim (mobile drawer overlay)
   ======================================== */
.scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 40;
}
.scrim.show { display: block; }

/* ========================================
   TABLET & MOBILE (≤ 1024px)
   Sidebar slide-in pattern dengan LABEL PENUH (bukan icon-only).
   Hamburger + scrim dipakai untuk navigasi.
   ======================================== */
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }

  aside {
    position: fixed;
    top: 0; left: 0;
    width: 260px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    z-index: 50;
    padding: 20px 16px;
    box-shadow: 2px 0 12px rgba(0,0,0,0.1);
    overflow-y: auto;
  }
  aside.open { transform: translateX(0); }

  /* Pastikan label & section header tetap visible saat slide-in */
  aside .brand-name,
  aside nav a span,
  aside nav .nav-section,
  aside nav a .num,
  aside .sidebar-foot .info,
  aside .logout-form { display: revert; }

  aside .brand { padding: 6px 8px 24px; justify-content: flex-start; align-items: center; }
  aside nav a { justify-content: flex-start; padding: 8px 10px; }
  aside .sidebar-foot { justify-content: flex-start; padding: 12px 10px; }

  /* Hamburger inline per-page tidak dipakai lagi (handled di topbar).
     Force hide kalau ada sisa markup di page lama. */
  .menu-toggle { display: none !important; }
  .sidebar-close { display: inline-flex; }

  /* padding-top 56px untuk ruang topbar fixed */
  main { padding: 80px 24px 48px; }

  /* Lock body scroll saat sidebar terbuka */
  body.sidebar-open { overflow: hidden; }

  .welcome-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========================================
   MOBILE (≤ 720px) — penyesuaian padding/typography
   ======================================== */
@media (max-width: 720px) {
  main { padding: 72px 16px 48px; }

  .page-head { gap: 12px; margin-bottom: 18px; }
  .page-head h1 { font-size: 19px; }
  .page-head p { font-size: 12.5px; }

  .welcome-grid { grid-template-columns: 1fr; }
}

/* ========================================
   Sidebar close button (mobile/tablet only)
   ======================================== */
.sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.sidebar-close:hover { background: var(--bg-alt); color: var(--ink); }

/* ========================================
   Form Page
   ======================================== */
.form-page { max-width: 720px; }

.form-section {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}
.form-section-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}
.form-section-head h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.field {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
}
.field:nth-child(2n) { border-right: none; }
.field:last-child, .field:nth-last-child(2):nth-child(odd) { border-bottom: none; }
.field:nth-last-child(-n+2) { border-bottom: none; }
.field--full {
  grid-column: 1 / -1;
  border-right: none;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.required { color: var(--danger); margin-left: 2px; }
.optional  { color: var(--ink-muted); font-weight: 400; font-size: 12px; }

.field input[type="text"],
.field input[type="number"],
.field select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13.5px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

.field-error input,
.field-error select { border-color: var(--danger); }
.field-error input:focus,
.field-error select:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(220,38,38,0.1);
}
.field-msg {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
}
.field-hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 5px;
}

.input-prefix-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input-prefix-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}
.field-error .input-prefix-wrap,
.input-prefix-wrap.has-error { border-color: var(--danger); }
.field-error .input-prefix-wrap:focus-within { box-shadow: 0 0 0 2px rgba(220,38,38,0.1); }
.input-prefix {
  padding: 0 10px;
  height: 36px;
  display: flex;
  align-items: center;
  background: var(--bg-alt);
  border-right: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.input-with-prefix {
  flex: 1;
  height: 36px;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 10px;
  font-family: inherit;
  font-size: 13.5px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  min-width: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 0 8px;
}
.form-warning {
  font-size: 12px;
  color: var(--warn);
  margin-top: 4px;
}
.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .field { border-right: none; }
  .field:nth-last-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .field:last-child { border-bottom: none; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; justify-content: center; }
}

/* ========================================
   Stat Cards
   ======================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 20px;
}
.stat--warn { border-color: rgba(217,119,6,0.25); background: #fffbf0; }
.stat--danger { border-color: rgba(220,38,38,0.2); background: #fff8f8; }
.stat-icon {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.stat-icon--warn { background: var(--warn-bg); border-color: rgba(217,119,6,0.2); color: var(--warn); }
.stat-icon--danger { background: var(--danger-bg); border-color: rgba(220,38,38,0.15); color: var(--danger); }
.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 4px;
}
.stat-value--sm { font-size: 18px; letter-spacing: -0.02em; }
.stat-value--warn  { color: var(--warn); }
.stat-value--danger { color: var(--danger); }
.stat-sub { font-size: 12px; color: var(--ink-muted); }

/* ========================================
   Keyboard shortcuts hint
   ======================================== */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-alt);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1;
}
.shortcuts-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-muted);
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ========================================
   Toolbar + Search
   ======================================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}
.search-input::placeholder { color: var(--ink-muted); }

/* ========================================
   Filter Chips
   ======================================== */
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.chip:hover { background: var(--bg-alt); color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ========================================
   Table
   ======================================== */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 9px 16px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-alt); }
.row-nonaktif td { opacity: 0.55; }

/* ========================================
   Product Thumbnail + Info
   ======================================== */
.prod-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* min-width: 0 pada flex child biar text-overflow ellipsis jalan */
.prod-info > div:not(.prod-thumb) { min-width: 0; }
.prod-thumb {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0;
}
.prod-name {
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}
.prod-meta { font-size: 12px; color: var(--ink-muted); }
.prod-meta code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--bg-alt);
  padding: 0 4px;
  border-radius: 3px;
  border: 1px solid var(--line);
}

.badge-nonaktif {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-left: 6px;
  vertical-align: middle;
}

/* ========================================
   Category Tag
   ======================================== */
.cat-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
  white-space: nowrap;
}

/* ========================================
   Price
   ======================================== */
.price-jual {
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}
.price-jual.price-warn { color: var(--warn); }
.warn-icon { flex-shrink: 0; color: var(--warn); }
.price-modal { font-size: 12px; color: var(--ink-muted); }

/* ========================================
   Stock Bar
   ======================================== */
.stock-cell { min-width: 130px; }
.stock-bar-wrap {
  height: 4px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 5px;
}
.stock-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
  min-width: 0;
}
.stock-bar--ok     { background: var(--ok); }
.stock-bar--warn   { background: var(--warn); }
.stock-bar--danger { background: var(--danger); }
.stock-num { font-size: 12.5px; font-weight: 500; }
.stock-num--ok     { color: var(--ok); }
.stock-num--warn   { color: var(--warn); }
.stock-num--danger { color: var(--danger); }
.stock-satuan { font-weight: 400; color: var(--ink-muted); }

/* ========================================
   Action Buttons
   ======================================== */
.actions-cell { display: flex; gap: 4px; align-items: center; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.icon-btn:hover {
  background: var(--bg-alt);
  border-color: var(--line);
  color: var(--ink);
}
.icon-btn--danger:hover {
  background: var(--danger-bg);
  border-color: rgba(220,38,38,0.2);
  color: var(--danger);
}
.btn--danger-outline {
  color: var(--danger);
  border-color: rgba(220,38,38,0.3);
}
.btn--danger-outline:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

/* ========================================
   Pagination
   ======================================== */
.pagi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0 8px;
}
.pagi-info { font-size: 13px; color: var(--ink-muted); }
.pagi-pages { display: flex; gap: 4px; align-items: center; }
.pagi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px; height: 32px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.pagi-btn:hover { background: var(--bg-alt); color: var(--ink); }
.pagi-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagi-btn[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
.pagi-ellipsis { color: var(--ink-muted); font-size: 13px; padding: 0 2px; }

/* ========================================
   Mobile Card List (produk)
   ======================================== */
.prod-cards {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.prod-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}
.prod-card--nonaktif { opacity: 0.6; }
.prod-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.prod-card-title { flex: 1; min-width: 0; }
.prod-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.prod-card-foot {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.prod-card-foot .btn { flex: 1; justify-content: center; }

/* ========================================
   Empty State
   ======================================== */
.empty-state {
  text-align: center;
  padding: 64px 20px;
}
.empty-state svg {
  display: block;
  margin: 0 auto 20px;
  color: var(--ink-muted);
  opacity: 0.25;
}
.empty-state h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.empty-state p {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

/* ========================================
   Responsive — Produk page additions
   ======================================== */
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .stats { gap: 8px; margin-bottom: 16px; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 22px; }
  .stat-value--sm { font-size: 16px; }

  .search-wrap { max-width: none; width: 100%; }
  .shortcuts-hint { display: none; }

  .table-wrap { display: none; }
  .prod-cards { display: flex; }

  .pagi { flex-wrap: wrap; justify-content: center; }
  .pagi-info { width: 100%; text-align: center; order: -1; }
}

/* ========================================
   Danger Zone (edit form)
   ======================================== */
.danger-zone {
  margin-top: 24px;
  padding: 20px 24px;
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: 8px;
  background: var(--danger-bg);
  max-width: 720px;
}
.danger-zone-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 4px;
}
.danger-zone-desc {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ========================================
   Modal
   ======================================== */
#modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Shown saat [hidden] attribute dihapus via JS */
#modal:not([hidden]) { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  animation: modal-backdrop-in 0.15s ease;
}

@keyframes modal-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  position: relative;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--line);
  width: 100%;
  max-width: 420px;
  animation: modal-card-in 0.15s ease;
}

@keyframes modal-card-in {
  from { opacity: 0; transform: scale(0.96) translateY(-6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head { padding: 20px 24px 0; }
.modal-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.modal-body {
  padding: 10px 24px 20px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.modal-body strong { color: var(--ink); font-weight: 600; }

.modal-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 720px) {
  #modal { padding: 16px; align-items: flex-end; }
  .modal-card { max-width: none; border-radius: 10px 10px 8px 8px; }
}

/* ========================================
   Button variants (tambahan)
   ======================================== */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-muted);
}
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--line); color: var(--ink); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }

/* ========================================
   Kasir Layout
   ======================================== */

/* Undo main's padding agar kasir bisa ambil full height */
.kasir-layout {
  margin: -28px -32px -64px;
  display: grid;
  grid-template-columns: 3fr 2fr;
  min-height: 100vh;
}

/* ── Kiri: Scan area ── */
.kasir-scan-area {
  padding: 28px 24px 40px 32px;
  overflow-y: auto;
  position: relative;
}

/* ── Kanan: Cart area ── */
.kasir-cart-area {
  border-left: 1px solid var(--line);
  background: var(--bg-alt);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Scan input ── */
.scan-input-wrapper {
  position: relative;
  margin-bottom: 10px;
}
.scan-input {
  width: 100%;
  height: 56px;
  padding: 0 48px 0 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 17px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.scan-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.scan-input::placeholder { color: var(--ink-muted); }
.scan-input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

/* ── Scan status indicator ── */
.scan-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-muted);
  min-height: 22px;
  margin-bottom: 16px;
}
.scan-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--ink-muted);
  transition: background 0.15s;
}
.scan-status.idle      .scan-status-dot { background: var(--ok); }
.scan-status.searching .scan-status-dot { background: var(--warn); animation: pulse 0.8s ease infinite; }
.scan-status.success   .scan-status-dot { background: var(--ok); }
.scan-status.error     .scan-status-dot { background: var(--danger); }
.scan-status.idle      { color: var(--ink-muted); }
.scan-status.searching { color: var(--warn); }
.scan-status.success   { color: var(--ok); }
.scan-status.error     { color: var(--danger); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
.scan-hint { margin-left: auto; font-size: 12px; color: var(--ink-muted); }

/* ── Autocomplete dropdown ── */
.autocomplete-dropdown {
  position: absolute;
  top: 70px; /* below input + status */
  left: 32px;
  right: 24px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
}
.autocomplete-dropdown.hidden { display: none; }

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.1s;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.active { background: var(--accent-soft); }
.autocomplete-item.active { outline: none; }

.autocomplete-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
}
.autocomplete-item-meta {
  font-size: 12px;
  color: var(--ink-muted);
}
.autocomplete-empty {
  padding: 20px 14px;
  font-size: 13.5px;
  color: var(--ink-muted);
  text-align: center;
}

/* ── Cart header ── */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.cart-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

/* ── Cart items (scrollable) ── */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* ── Cart empty state ── */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-muted);
  height: 100%;
  min-height: 180px;
}
.cart-empty svg { margin-bottom: 14px; opacity: 0.2; }
.cart-empty p { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.cart-empty small { font-size: 12.5px; }

/* ── Individual cart item ── */
.cart-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.1s;
}
.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: var(--bg-hover); }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.cart-item-price { font-size: 12px; color: var(--ink-muted); }

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.qty-btn {
  width: 28px; height: 28px;
  min-width: 28px; /* touch target */
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s;
  touch-action: manipulation; /* prevent double-tap zoom on iOS */
  flex-shrink: 0;
  line-height: 1;
}
.qty-btn:hover { background: var(--bg-alt); }
.qty-input {
  width: 44px;
  height: 28px;
  padding: 0 4px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: inherit;
  font-size: 13px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty-input:focus { border-color: var(--accent); }

.cart-item-subtotal {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  min-width: 72px;
  text-align: right;
  flex-shrink: 0;
}

.cart-item-remove {
  width: 28px; height: 28px;
  min-width: 28px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s;
  flex-shrink: 0;
  touch-action: manipulation;
}
.cart-item-remove:hover { background: var(--danger-bg); color: var(--danger); }

/* ── Cart summary (footer) ── */
.cart-summary {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  flex-shrink: 0;
}
.cart-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cart-total-label { font-size: 14px; color: var(--ink-soft); }
.cart-total-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ── Tombol bayar ── */
.btn-bayar {
  width: 100%;
  height: 56px;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  border-radius: 8px;
  gap: 10px;
  transition: background 0.12s, transform 0.08s;
}
.btn-bayar:hover:not(:disabled) { background: #27272a; border-color: #27272a; }
.btn-bayar:active:not(:disabled) { transform: scale(0.99); }
.btn-bayar:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-kbd {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
  font-size: 11px;
}
.btn-bayar:disabled .btn-kbd { opacity: 0.5; }

/* ========================================
   Toast notification system
   ======================================== */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 320px;
}
.toast {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.toast--show    { opacity: 1; transform: translateX(0); }
.toast--success { background: var(--ok);     color: #fff; }
.toast--error   { background: var(--danger); color: #fff; }
.toast--warn    { background: var(--warn);   color: #fff; }
.toast--info    { background: var(--ink);    color: #fff; }

/* ========================================
   Kasir — Responsive
   ======================================== */
@media (max-width: 1024px) {
  /* Topbar fixed 56px → reset margin-top untuk full-bleed layouts
     (kasir-layout, restok-layout, struk-page). Main padding-top sudah
     80px, layout mulai 80px dari top viewport (24px gap di bawah topbar). */
  .kasir-layout  { grid-template-columns: 3fr 2fr; margin-top: 0; }
  .restok-layout { margin-top: 0; }
  .struk-page    { margin-top: 0; }
}

@media (max-width: 720px) {
  .kasir-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: auto;
    margin: -16px -16px 0; /* mobile main padding lebih kecil */
  }
  .kasir-scan-area {
    padding: 16px;
    overflow-y: visible;
  }
  .kasir-cart-area {
    position: static; /* tidak sticky di mobile — stack normal */
    height: auto;
    min-height: 300px;
    border-left: none;
    border-top: 2px solid var(--line);
  }
  .cart-summary {
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  }
  .autocomplete-dropdown {
    left: 16px;
    right: 16px;
    top: 78px;
  }
  .scan-hint { display: none; } /* hide kbd hints on mobile */
}

/* ========================================
   Modal Pembayaran Tunai
   ======================================== */

.modal-bayar {
  position: fixed;
  inset: 0;
  z-index: 300; /* di atas modal generik (z-index 200) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
  animation: modal-bayar-fade 0.15s ease;
}

.modal-bayar.hidden { display: none; }

@keyframes modal-bayar-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-bayar-card {
  background: var(--bg);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.16), 0 0 0 1px var(--line);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-bayar-scale 0.15s ease;
}

@keyframes modal-bayar-scale {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-bayar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-bayar-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.modal-close:hover { background: var(--bg-hover); color: var(--ink); }

.modal-bayar-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Total tagihan */
.bayar-total-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 20px;
}
.bayar-total-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}
.bayar-total-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}

/* Quick fill buttons */
.bayar-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bayar-quick-btn {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.bayar-quick-btn:hover  { background: var(--bg-alt); border-color: var(--ink-muted); color: var(--ink); }
.bayar-quick-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* Input uang diterima */
.bayar-input-group { display: flex; flex-direction: column; gap: 6px; }
.bayar-input-label { font-size: 13px; font-weight: 500; color: var(--ink); }
.bayar-input-wrap {
  display: flex;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.bayar-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.bayar-input-prefix {
  padding: 0 12px;
  height: 52px;
  display: flex; align-items: center;
  background: var(--bg-alt);
  border-right: 2px solid var(--line);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.bayar-input-wrap input {
  flex: 1;
  height: 52px;
  border: none;
  outline: none;
  padding: 0 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  text-align: right;
  min-width: 0;
}
.bayar-input-wrap input::placeholder { color: var(--ink-muted); font-weight: 400; }

/* Kembalian */
.bayar-kembalian-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.bayar-kembalian-label { font-size: 14px; color: var(--ink-soft); }
.bayar-kembalian-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-muted); /* default: belum diisi */
  transition: color 0.15s;
}
.bayar-kembalian-value.positive { color: var(--ok); }
.bayar-kembalian-value.negative { color: var(--danger); }

/* Catatan */
.bayar-catatan-toggle { font-size: 13px; color: var(--ink-muted); }
.bayar-catatan-toggle summary {
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  color: var(--ink-soft);
  transition: color 0.12s;
}
.bayar-catatan-toggle summary:hover { color: var(--ink); }
.bayar-catatan-toggle textarea {
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  outline: none;
  transition: border-color 0.12s;
}
.bayar-catatan-toggle textarea:focus { border-color: var(--accent); }

/* Footer */
.modal-bayar-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  border-radius: 0 0 12px 12px;
}

.modal-confirm-btn { min-width: 180px; justify-content: center; }
.modal-confirm-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Responsive modal bayar */
@media (max-width: 720px) {
  .modal-bayar { padding: 12px; align-items: flex-end; }
  .modal-bayar-card { max-width: none; border-radius: 12px 12px 8px 8px; max-height: 95vh; }
  .bayar-quick { grid-template-columns: 1fr 1fr; }
  .modal-bayar-footer { flex-direction: column-reverse; gap: 8px; }
  .modal-bayar-footer .btn { width: 100%; justify-content: center; }
  .modal-confirm-btn { min-width: unset; }
}

/* ========================================
   Halaman Struk (Receipt)
   ======================================== */

/* Background abu-abu untuk kontras dengan receipt putih */
.struk-page {
  margin: -28px -32px -64px;
  /* padding kiri = 32px (sama dengan main) biar struk sejajar dengan konten halaman lain */
  padding: 28px 24px 64px 32px;
  background: var(--bg-alt);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

/* Tombol aksi — lebar menyesuaikan struk agar aligned */
.struk-actions {
  width: 320px;     /* sama dengan max-width struk-area */
  max-width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.struk-actions-right { display: flex; gap: 8px; }

/* Hint shortcut */
.struk-hint {
  font-size: 12px;
  color: var(--ink-muted);
  text-align: center;
}

/* ── Struk (receipt card) ── */
.struk-area {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: #fff;
  padding: 20px;
  /* Font mono biar mirip thermal printer */
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #111;
  /* Shadow floating receipt */
  box-shadow:
    0 1px 3px rgba(0,0,0,0.08),
    0 4px 16px rgba(0,0,0,0.06);
}

.struk-header {
  text-align: center;
  margin-bottom: 12px;
}

.struk-toko {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #000;
}

.struk-toko-sub {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

.struk-divider {
  border: none;
  border-top: 1px solid #000;
  margin: 8px 0;
}

.struk-divider.dashed { border-top: 1px dashed #999; }

.struk-info { display: flex; flex-direction: column; gap: 1px; }

.struk-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
}

.struk-info-row span:first-child {
  color: #555;
  flex-shrink: 0;
  min-width: 56px;
}

.struk-info-row span:last-child {
  text-align: right;
  word-break: break-word;
}

.struk-info-batal span { color: var(--danger); }

.struk-items { display: flex; flex-direction: column; gap: 6px; }

.struk-item-name {
  font-weight: 600;
  color: #000;
  word-break: break-word;
}

.struk-item-detail {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  font-size: 12px;
  color: #444;
}

.struk-item-detail span:last-child {
  flex-shrink: 0;
  font-weight: 700;
  color: #000;
}

.struk-item-empty {
  text-align: center;
  color: #999;
  font-size: 12px;
  padding: 8px 0;
}

.struk-totals { display: flex; flex-direction: column; gap: 2px; }

.struk-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  padding: 1px 0;
}

.struk-total-row span:last-child { font-weight: 600; }

.struk-total-grand {
  font-size: 15px;
  font-weight: 700;
  color: #000;
  padding: 4px 0 4px;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  margin: 2px 0;
}

.struk-catatan {
  font-size: 12px;
  color: #555;
  word-break: break-word;
  padding: 4px 0;
}

.struk-footer {
  text-align: center;
  font-size: 11px;
  margin-top: 4px;
}

.struk-footer p { margin: 0; color: #333; }
.struk-footer-sub { font-size: 10px; color: #888; margin-top: 2px; }

/* Watermark transaksi dibatalkan */
.struk-dibatalkan-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: rgba(220, 38, 38, 0.18);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* Struk — mobile */
@media (max-width: 720px) {
  .struk-page {
    margin: -16px -16px 0;
    padding: 16px;
    align-items: stretch; /* full width di mobile */
  }
  .struk-area   { max-width: 100%; }
  .struk-actions {
    width: 100%;
    flex-direction: column;
  }
  .struk-actions .btn { width: 100%; justify-content: center; }
  .struk-actions-right { flex-direction: column; width: 100%; }
  .struk-actions-right .btn { width: 100%; justify-content: center; }
}

/* ========================================
   Print — hanya tampilkan area struk
   ======================================== */
@media print {
  /* Sembunyikan semua, lalu tampilkan hanya struk */
  body * { visibility: hidden; }
  #struk-area, #struk-area * { visibility: visible; }

  #struk-area {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: 80mm;    /* kertas thermal 80mm; ubah ke 58mm jika pakai kertas lebih kecil */
    margin: 0;
    padding: 8mm;
    box-shadow: none;
    background: white;
    font-size: 11px;    /* sedikit lebih kecil untuk efisiensi kertas */
  }

  /* Hide elemen yang tidak perlu */
  .no-print { display: none !important; }
  aside     { display: none !important; }

  /* Reset layout agar struk tidak kena sidebar grid */
  .app  { display: block !important; }
  main  { padding: 0 !important; background: white !important; }

  /* Page setup thermal */
  @page {
    margin: 0;
    size: 80mm auto;    /* width fixed, height mengikuti konten */
  }

  /* Pastikan link tidak punya style */
  a { color: black !important; text-decoration: none !important; }

  /* Sembunyikan watermark di print (opsional — uncommment kalau mau watermark tetap muncul) */
  /* .struk-dibatalkan-badge { display: block; } */
}

/* ========================================
   Stok Masuk — list, detail, modal pembatalan
   ======================================== */

/* Filter bar */
.stok-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.stok-filter .search-wrap {
  flex: 1 1 240px;
  margin-bottom: 0;
}
.stok-filter-dates {
  display: flex;
  gap: 8px;
}
.stok-filter-dates label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stok-filter-label {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stok-filter-date {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
}
.stok-filter-date:focus {
  outline: none;
  border-color: var(--ink);
}
.stok-filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  height: 36px;
}
.stok-filter-toggle input[type="checkbox"] { cursor: pointer; }

/* Status badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-aktif {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: rgba(22,163,74,0.18);
}
.badge-dibatalkan {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(220,38,38,0.18);
}

/* Row dibatalkan: opacity + line-through di total */
.row-dibatalkan td { opacity: 0.6; }
.stok-total-batal {
  text-decoration: line-through;
  color: var(--ink-muted);
}

/* Nomor stok masuk (mono font, link styled) */
.stok-nomor {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}
.stok-nomor:hover { color: var(--accent); }
.stok-nomor-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-soft);
}

/* Mobile cards */
.stok-cards {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.stok-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  color: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.stok-card:hover { border-color: var(--ink); }
.stok-card--batal { opacity: 0.65; }
.stok-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.stok-card-meta {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.stok-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

/* Detail page back link */
.page-back { margin-bottom: 12px; }
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 500;
  padding: 6px 0;
}
.btn-link:hover { color: var(--ink); }

/* Detail info cards */
.info-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.info-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
}
.info-card-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.info-card-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13.5px;
}
.info-label { color: var(--ink-muted); flex-shrink: 0; }
.info-value { color: var(--ink); text-align: right; }
.info-value-large {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* Pembatalan section */
.pembatalan-section {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--danger-bg);
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: 8px;
}

/* Modal batalkan (custom — punya form input alasan) */
.modal-batalkan-wrap {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-batalkan-wrap[hidden] { display: none; }
.modal-batalkan-wrap textarea:focus {
  outline: none;
  border-color: var(--ink) !important;
}

/* Mobile responsive */
@media (max-width: 720px) {
  .stok-filter {
    padding: 12px;
    gap: 8px;
  }
  .stok-filter-dates {
    width: 100%;
    flex-wrap: wrap;
  }
  .stok-filter-dates label { flex: 1; min-width: 130px; }
  .stok-filter-toggle { width: 100%; }
  .stok-filter .btn { flex: 1; }

  .info-card-grid { grid-template-columns: 1fr; gap: 10px; }
  .info-card { padding: 14px 16px; }
  .info-value-large { font-size: 18px; }

  /* Hide desktop table, show mobile cards */
  .table-wrap:not(.table-wrap--keep) { /* default keep table for detail items */ }
}

/* Khusus halaman list /stok: swap table ↔ cards di mobile.
   .stok-list-table-wrap di-hide, .stok-cards di-show.
   Tabel detail (yang TIDAK pakai .stok-list-table-wrap) tetap muncul. */
@media (max-width: 720px) {
  .stok-cards { display: flex; }
  .stok-list-table-wrap { display: none; }
}

/* ========================================
   Restok form (/stok/baru) — layout 2 kolom mirror dari kasir
   ======================================== */
.restok-layout {
  margin: -28px -32px -64px;
  display: grid;
  grid-template-columns: 3fr 2fr;
  min-height: 100vh;
}
.restok-input-area {
  padding: 24px 24px 40px 32px;
  overflow-y: auto;
  position: relative;
}
.restok-page-head { margin-bottom: 20px; }
.restok-page-head h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 4px;
}
.restok-page-head p { font-size: 13.5px; color: var(--ink-soft); }

.restok-section { margin-bottom: 24px; }
.restok-section-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

/* Form rows reusable di restok */
.restok-input-area .form-row {
  margin-bottom: 12px;
}
.restok-input-area .form-row label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.restok-input-area .form-row .hint {
  color: var(--ink-muted);
  font-weight: 400;
  font-size: 12px;
}
.restok-input-area .form-row input[type="text"],
.restok-input-area .form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
}
.restok-input-area .form-row input[type="text"]:focus,
.restok-input-area .form-row textarea:focus {
  outline: none;
  border-color: var(--ink);
}

/* Kanan: list area */
.restok-list-area {
  border-left: 1px solid var(--line);
  background: var(--bg-alt);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.restok-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.restok-list-count {
  font-size: 12.5px;
  color: var(--ink-muted);
  font-weight: 500;
}
.restok-items {
  flex: 1;
  overflow-y: auto;
}

/* Item row */
.restok-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  align-items: flex-start;
  background: var(--bg);
}
.restok-item:hover { background: var(--bg-hover); }
.restok-item-info {
  grid-column: 1;
  min-width: 0;
}
.restok-item-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.restok-item-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.restok-item-barcode {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  background: var(--bg-alt);
  padding: 0 4px;
  border-radius: 3px;
  border: 1px solid var(--line);
}
.restok-item-detail {
  grid-column: 1;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.restok-item-qty {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.restok-item-subtotal {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.restok-item-catatan {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-style: italic;
}
.restok-item-actions {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Summary footer */
.restok-summary {
  flex-shrink: 0;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.restok-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.restok-total-label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.restok-total-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* ========================================
   Modal Edit Item (stok masuk) — standalone, tidak reuse .modal-bayar
   ======================================== */

.modal-edit-item {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
  animation: meit-fade 0.15s ease;
}
.modal-edit-item.hidden { display: none; }

@keyframes meit-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes meit-scale {
  from { opacity: 0; transform: scale(0.96) translateY(-6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-edit-item-card {
  background: var(--bg);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.16), 0 0 0 1px var(--line);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  animation: meit-scale 0.15s ease;
}

.modal-edit-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-edit-item-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.modal-edit-item-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Produk info banner */
.meit-produk {
  padding: 12px 14px;
  background: var(--bg-alt);
  border-radius: 6px;
}
.meit-produk-nama {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
  letter-spacing: -0.005em;
}
.meit-produk-meta {
  font-size: 12px;
  color: var(--ink-muted);
}

/* Field wrapper + label */
.meit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.meit-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.meit-label-hint {
  color: var(--ink-muted);
  font-weight: 400;
  font-size: 12px;
}

/* Inputs (qty number, harga money, catatan text) */
.meit-input {
  width: 100%;
  height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.meit-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}
.meit-input::placeholder {
  color: var(--ink-muted);
  font-style: italic;
}

/* Money input variant — text input, right-aligned, monospace, no Rp prefix box */
.meit-input-money {
  text-align: right;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.meit-input-money::placeholder {
  font-style: normal;
}

/* Inline error under field */
.meit-error {
  font-size: 12px;
  color: var(--danger);
}

/* Subtotal display */
.meit-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-alt);
  border-radius: 6px;
}
.meit-subtotal-label {
  font-size: 13px;
  color: var(--ink-soft);
}
.meit-subtotal-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Footer */
.modal-edit-item-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  border-radius: 0 0 10px 10px;
}

/* Shared error highlight (tetap dipakai input-error class dari JS) */
.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(220,38,38,0.1);
}

@media (max-width: 720px) {
  .modal-edit-item { padding: 12px; align-items: flex-end; }
  .modal-edit-item-card { max-width: none; border-radius: 10px 10px 8px 8px; max-height: 95vh; }
  .modal-edit-item-footer { flex-direction: column-reverse; gap: 8px; }
  .modal-edit-item-footer .btn { width: 100%; justify-content: center; }
}

/* Override dropdown positioning untuk halaman restok.
   Dropdown share class .autocomplete-dropdown dengan kasir, di kasir
   pakai top:70px absolute (scan input langsung di puncak area).
   Di restok scan input ada di tengah column → posisi salah.
   Pakai position: static (in-flow) supaya dropdown muncul tepat
   di bawah scan-status. */
.restok-input-area .autocomplete-dropdown {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  margin-top: 4px;
  width: 100%;
}

/* Mobile responsive */
@media (max-width: 720px) {
  .restok-layout {
    grid-template-columns: 1fr;
    margin: 0 -16px -64px;  /* margin-top 0: hindari overlap topbar */
  }
  .restok-input-area { padding: 16px 16px 24px; }
  .restok-list-area {
    position: static;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .restok-items { max-height: 50vh; }
  .restok-page-head h1 { font-size: 19px; }
  .restok-total-value { font-size: 19px; }
}

/* ========================================
   Halaman Laporan Penjualan
   ======================================== */

/* Filter bar */
.laporan-filter {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.laporan-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.laporan-tab {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.laporan-tab:hover { background: var(--bg-alt); color: var(--ink); }
.laporan-tab.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.laporan-custom {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--bg-alt);
  border-radius: 8px;
  margin-bottom: 12px;
}
.laporan-custom.hidden { display: none; }
.laporan-custom .form-row { flex: 1; min-width: 140px; margin-bottom: 0; }
.laporan-custom label {
  font-size: 12px;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}
.laporan-custom input[type="date"] {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}
.laporan-custom input[type="date"]:focus { border-color: var(--ink); }

.laporan-periode-info {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
}
.laporan-periode-info strong { color: var(--ink); font-weight: 600; }

/* Section */
.laporan-section { margin-bottom: 28px; }
.laporan-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.laporan-section .section-header h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.laporan-section .section-sub {
  font-size: 12px;
  color: var(--ink-muted);
}

/* Chart */
.chart-wrapper {
  position: relative;
  height: 280px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

/* Empty state kompak (variant dari .empty-state, padding lebih kecil) */
.empty-state-sm {
  padding: 32px 16px;
  text-align: center;
  background: var(--bg-alt);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.empty-state-sm p { margin: 0 0 12px; }
.empty-state-sm > *:last-child { margin-bottom: 0; }

/* Numeric column right-align untuk tabel laporan */
.t-right { text-align: right; font-variant-numeric: tabular-nums; }

/* Link di dalam cell tabel */
.cell-link {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.cell-link:hover { color: var(--accent); text-decoration: underline; }

/* Margin % di stat sub */
.stat-sub--ok { color: var(--ok); font-weight: 500; }
.stat-sub--danger { color: var(--danger); font-weight: 500; }

@media (max-width: 720px) {
  .laporan-tabs { gap: 4px; }
  .laporan-tab { padding: 0 10px; font-size: 12.5px; flex: 1; justify-content: center; min-width: 0; }
  .chart-wrapper { height: 240px; padding: 8px; }
  .laporan-section .section-header h2 { font-size: 15px; }
  .laporan-custom { padding: 10px; gap: 8px; }
}


