/* Cegah scroll horizontal di semua halaman */
html { overflow-x: hidden; }
body { overflow-x: hidden; max-width: 100vw; }

:root {
  --navy: #1552a5;
  --navy-light: #1e6bc9;
  --navy-dark: #0e3a7a;
  --green: #375623;
  --green-light: #4A7230;
  --green-accent: #70AD47;
  --white: #ffffff;
  --gray-50: #F8F9FA;
  --gray-100: #F1F3F4;
  --gray-200: #E8EAED;
  --gray-400: #9AA0A6;
  --gray-600: #5F6368;
  --gray-800: #3C4043;
  --shadow: 0 2px 8px rgba(0,0,0,0.12);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
  --radius: 10px;
  --radius-sm: 6px;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  font-size: 14px;
}

/* ===== HEADER ===== */
.app-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 2px;
}
.header-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.header-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.header-subtitle {
  font-size: 11px;
  opacity: 0.75;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.role-badge {
  background: var(--green-accent);
  color: var(--white);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: none;
}

.btn-logout {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.btn-logout:hover { background: rgba(255,255,255,0.2); }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(150deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-icon {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.login-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-logo h1 {
  color: var(--navy);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-logo p {
  color: var(--gray-600);
  font-size: 13px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.2s;
  background: var(--white);
  color: var(--gray-800);
}

.form-control:focus {
  outline: none;
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(31,78,121,0.1);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  border: none;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 8px;
}

.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.error-msg {
  background: #FEE2E2;
  color: #DC2626;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 12px;
  display: none;
}

/* ===== MAIN LAYOUT ===== */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--navy);
}

.stat-card.green { border-left-color: var(--green-accent); }
.stat-card.orange { border-left-color: #F59E0B; }
.stat-card.purple { border-left-color: #8B5CF6; }
.stat-card[style*="cursor:pointer"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  transition: transform .15s, box-shadow .15s;
}

.stat-label {
  font-size: 11px;
  color: var(--gray-600);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.stat-sub {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 3px;
}

/* ===== CARD COMPONENT ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}

.card-body { padding: 20px; }

/* ===== CHARTS GRID ===== */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.chart-container {
  position: relative;
  height: 280px;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-100);
  margin-bottom: 16px;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s;
}

.tab-btn.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

.tab-btn:hover { color: var(--navy); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== TABLE ===== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  background: var(--gray-50);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0.5px;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
}

tr:hover td { background: var(--gray-50); }
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.badge-bbb { background: #DBEAFE; color: #1D4ED8; }
.badge-bbk { background: #D1FAE5; color: #065F46; }

/* ===== STAFF FORM ===== */
.staff-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.staff-header h2 { font-size: 16px; font-weight: 700; }
.staff-header p { font-size: 12px; opacity: 0.8; margin-top: 3px; }

.date-picker-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.1);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.date-picker-group label { font-size: 12px; opacity: 0.85; white-space: nowrap; }

#input-date {
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#input-date::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  border: 1.5px solid var(--gray-200);
}

.search-bar input {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 14px;
  outline: none;
  color: var(--gray-800);
}

.search-bar svg { color: var(--gray-400); flex-shrink: 0; }

.ingredient-table th:first-child { width: 36px; }
.ingredient-table .col-name { min-width: 160px; }
.ingredient-table .col-unit { width: 60px; }
.ingredient-table .col-input { width: 120px; }
.ingredient-table .col-total { width: 110px; }

.qty-input, .price-input {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: right;
  transition: border-color 0.2s;
}

.qty-input:focus, .price-input:focus {
  outline: none;
  border-color: var(--navy-light);
}

.qty-input.has-value, .price-input.has-value {
  border-color: var(--green-accent);
  background: #F0FDF4;
}

.row-total {
  font-weight: 600;
  color: var(--navy);
  text-align: right;
  font-size: 13px;
}

.row-total.has-value { color: var(--green); }

.sticky-footer {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 2px solid var(--gray-200);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
  flex-wrap: wrap;
}

.sticky-footer .summary { font-size: 14px; color: var(--gray-600); }
.sticky-footer .summary strong { color: var(--navy); font-size: 16px; }

.btn-save {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
  color: var(--white);
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-save:hover { opacity: 0.9; }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar select, .filter-bar input[type="date"], .filter-bar input[type="month"] {
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--white);
  color: var(--gray-800);
  cursor: pointer;
}

.filter-bar select:focus, .filter-bar input:focus {
  outline: none;
  border-color: var(--navy-light);
}

.btn-secondary {
  padding: 8px 16px;
  border: 1.5px solid var(--navy);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover { background: var(--gray-50); }

/* ===== TOAST ===== */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gray-800);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#toast.success { background: var(--green); }
#toast.error { background: #DC2626; }

/* ===== LOADING ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--gray-400);
  font-size: 14px;
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray-400);
}

.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  background: var(--gray-200);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--navy-light);
  transition: width 0.5s;
}

.progress-fill.green { background: var(--green-accent); }

/* ===== HIGHLIGHT ROW ===== */
tr.filled td { background: #F0FDF4 !important; }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  /* Header */
  .app-header { height: 56px; padding: 0 14px; }
  .header-user { gap: 6px; }
  .header-user .user-badge { display: none; }
  .header-user #deptBadge { display: none; }
  .btn-logout { padding: 6px 10px; font-size: 11px; }

  /* Layout */
  .main-container { padding: 12px 10px; }

  /* Charts */
  .charts-grid { grid-template-columns: 1fr; gap: 14px; }
  .chart-container { height: 220px; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 17px; }

  /* Settings tabs — horizontal scroll */
  .settings-tabs {
    width: 100%; overflow-x: auto; flex-wrap: nowrap;
    gap: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .settings-tabs::-webkit-scrollbar { display: none; }
  .settings-tab { flex-shrink: 0; padding: 8px 14px; font-size: 12px; }

  /* Regular tabs — horizontal scroll */
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; padding: 10px 14px; font-size: 13px; }

  /* Cards — judul di atas, filter di bawahnya (tidak berebut ruang ke samping) */
  .card-header { flex-direction: column; align-items: stretch; flex-wrap: wrap; gap: 8px; padding: 14px 16px; }
  .card-header .card-title { width: 100%; }
  .card-body { padding: 14px 16px; }

  /* Filter bar — grid kompak 2 kolom, tinggi kontrol normal (bukan kolom melar) */
  .filter-bar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .filter-bar select,
  .filter-bar input[type="date"],
  .filter-bar input[type="month"] {
    flex: 1 1 calc(50% - 4px);
    width: auto;
    min-width: 0;
    height: 42px;
    padding: 6px 10px;
  }
  .filter-bar .btn-secondary,
  .filter-bar button { flex: 1 1 calc(50% - 4px); min-width: 0; }

  /* Settings toolbar */
  .settings-toolbar { flex-direction: column; align-items: stretch; }
  .settings-toolbar-right { width: 100%; justify-content: space-between; }
  .settings-toolbar-right input { flex: 1; }

  /* Staff header */
  .staff-header { padding: 14px; flex-direction: column; align-items: stretch; gap: 10px; }
  .date-picker-group { width: 100%; }

  /* Mode toggle */
  .mode-toggle { width: 100%; }
  .mode-btn { flex: 1; text-align: center; padding: 9px 8px; }

  /* Footer */
  .sticky-footer { padding: 12px 14px; }
  .btn-save { padding: 12px 18px; font-size: 13px; }

  /* Touch targets minimum 44px */
  .btn-add, .btn-export, .btn-secondary, .btn-save { min-height: 44px; }

  /* Input 16px — cegah iOS auto-zoom saat fokus */
  .form-control,
  .qty-input, .price-input,
  select, input[type="date"], input[type="time"],
  input[type="month"], input[type="number"] { font-size: 16px !important; }

  /* Tabel */
  th, td { padding: 8px 10px; }
  .ingredient-table .col-name { min-width: 130px; }
  .col-input { width: 100px; }

  /* Export grid */
  .export-grid { grid-template-columns: 1fr; }

  /* Stock status grid */
  .stock-status-grid { grid-template-columns: 1fr 1fr; }

  /* Modal → bottom sheet */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-card { width: 100%; border-radius: 20px 20px 0 0; max-height: 92vh; overflow-y: auto; }

  /* Override inline grid 2-kolom di settings page */
  #tab-config [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .app-header { height: 52px; }
  .header-logo { width: 36px; height: 36px; }
  .header-title { font-size: 13px; }
  .header-subtitle { display: none; }
  .stat-value { font-size: 15px; }
  .stat-label { font-size: 10px; }
  .login-card { padding: 24px 18px; }
  .cat-tab-btn { font-size: 12px; padding: 10px 6px; }
  .cat-tab-btn .tab-badge { display: none; }
  .stock-status-grid { grid-template-columns: 1fr; }
}

/* ===== MOBILE CARD TABLE (semua tabel besar) ===== */
@media (max-width: 768px) {
  .mobile-card-table thead { display: none; }
  .mobile-card-table tbody tr {
    display: block;
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
  }
  .mobile-card-table tbody tr.no-data { box-shadow: none; border: none; background: none; }
  .mobile-card-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border: none;
    font-size: 13px;
    text-align: left !important;
    white-space: normal !important;
  }
  .mobile-card-table tbody td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    color: #9AA0A6;
    text-transform: none;
    letter-spacing: .03em;
    flex-shrink: 0;
    margin-right: 10px;
  }
  .mobile-card-table tbody td[data-label=""] { display: none; }
  .mobile-card-table tbody td.mc-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    border-bottom: 1px solid #F3F4F6;
    padding-bottom: 8px;
    margin-bottom: 4px;
  }
  .mobile-card-table tbody td.mc-title::before { display: none; }
  .mobile-card-table tbody td.mc-aksi {
    justify-content: flex-end;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid #F3F4F6;
  }
  .mobile-card-table tbody td.mc-aksi::before { display: none; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-600); }

/* ===== NO DATA ROWS ===== */
.no-data td { text-align: center; color: var(--gray-400); font-style: italic; padding: 24px; }

/* ===== CATEGORY TABS (BBB / BBK) ===== */
.cat-tab-wrap {
  display: flex;
  border-bottom: 2px solid var(--gray-100);
}

.cat-tab-btn {
  flex: 1;
  padding: 13px 12px;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--gray-400);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  text-align: center;
}

.cat-tab-btn:hover { color: var(--gray-600); background: var(--gray-50); }

.cat-tab-btn[data-cat="BBB"].active { color: #1D4ED8; border-bottom-color: #1D4ED8; background: #F8FBFF; }
.cat-tab-btn[data-cat="BBK"].active { color: #065F46; border-bottom-color: #065F46; background: #F0FDF9; }

.cat-tab-btn .tab-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 6px;
  background: var(--gray-200);
  color: var(--gray-600);
  transition: background 0.2s, color 0.2s;
}

.cat-tab-btn[data-cat="BBB"].active .tab-badge { background: #DBEAFE; color: #1D4ED8; }
.cat-tab-btn[data-cat="BBK"].active .tab-badge { background: #D1FAE5; color: #065F46; }

/* ===== MODE TOGGLE ===== */
.mode-toggle {
  display: flex;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.mode-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: rgba(255,255,255,0.7);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.mode-btn.active {
  background: var(--white);
  color: var(--navy);
}

.mode-btn:not(.active):hover {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}

/* Mode OUT = green accent */
.mode-out .mode-btn.active { color: #DC2626; }
.mode-out .staff-header { background: linear-gradient(135deg, #991B1B 0%, #DC2626 100%); }
.mode-out .btn-save { background: linear-gradient(135deg, #991B1B 0%, #DC2626 100%); }

/* ===== STOCK BADGE ===== */
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.stock-ok    { background: #D1FAE5; color: #065F46; }
.stock-low   { background: #FEF3C7; color: #92400E; }
.stock-empty { background: #FEE2E2; color: #991B1B; }

/* ===== STOCK STATUS TABLE ===== */
.stock-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.stock-item-card {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border-left: 3px solid var(--green-accent);
}

.stock-item-card.empty  { border-left-color: #EF4444; background: #FFF5F5; }
.stock-item-card.low    { border-left-color: #F59E0B; background: #FFFBEB; }

/* ===== EXPORT CARD ===== */
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.export-block {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.export-block-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.export-block-desc {
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.4;
}

.export-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.export-controls select,
.export-controls input[type="date"],
.export-controls input[type="month"] {
  font-size: 13px;
  padding: 6px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--navy);
  flex: 1;
  min-width: 100px;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #1552a5 0%, #1e6bc9 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.btn-export:hover  { opacity: .9; }
.btn-export:active { opacity: .75; }
.btn-export.green  { background: linear-gradient(135deg, #065F46 0%, #059669 100%); }
.btn-export.amber  { background: linear-gradient(135deg, #92400E 0%, #B45309 100%); }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .mode-btn { padding: 7px 10px; font-size: 12px; }
  .mode-toggle { width: 100%; }
  .mode-btn { flex: 1; text-align: center; }
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal-card {
  background: #fff;
  border-radius: 16px;
  width: min(480px, 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;
  animation: modalIn .18s ease;
}
@keyframes modalIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { margin: 0; font-size: 16px; color: var(--navy); }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: var(--gray-100); cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  color: var(--gray-600); transition: background .15s;
}
.modal-close:hover { background: var(--gray-200); }

.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }

.modal-body .form-group { margin: 0; }
.modal-body label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-600); margin-bottom: 5px; text-transform: none; letter-spacing: .04em; }
.modal-body .form-control { width: 100%; box-sizing: border-box; }
.modal-body select.form-control { padding: 10px 12px; }

.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 22px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.btn-modal-cancel {
  padding: 9px 20px; border-radius: 8px; border: 1.5px solid var(--gray-200);
  background: #fff; color: var(--gray-600); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn-modal-cancel:hover { background: var(--gray-100); }

.btn-modal-save {
  padding: 9px 22px; border-radius: 8px; border: none;
  background: linear-gradient(135deg, #1552a5 0%, #1e6bc9 100%);
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
}
.btn-modal-save:hover   { opacity: .9; }
.btn-modal-save:disabled { opacity: .55; cursor: not-allowed; }

/* ===== SETTINGS PAGE ===== */
.settings-tabs {
  display: flex; gap: 4px;
  background: var(--gray-100); border-radius: 10px; padding: 4px;
  margin-bottom: 20px; width: fit-content;
}
.settings-tab {
  padding: 9px 20px; border-radius: 8px; border: none; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--gray-600);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.settings-tab.active { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

.settings-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.settings-toolbar-right { display: flex; gap: 8px; align-items: center; }

.btn-add {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; border: none;
  background: linear-gradient(135deg, #1552a5 0%, #1e6bc9 100%);
  color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity .15s; white-space: nowrap;
}
.btn-add:hover { opacity: .9; }
.btn-add.green { background: linear-gradient(135deg, #065F46 0%, #059669 100%); }

.badge-active   { background: #D1FAE5; color: #065F46; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-inactive { background: #F3F4F6; color: #6B7280; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }

.btn-icon {
  padding: 5px 10px; border-radius: 6px; border: 1.5px solid var(--gray-200);
  background: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
  color: var(--gray-600); transition: all .15s; white-space: nowrap;
}
.btn-icon:hover { background: var(--gray-100); }
.btn-icon.danger { border-color: #FCA5A5; color: #DC2626; }
.btn-icon.danger:hover { background: #FFF5F5; }
.btn-icon.success { border-color: #6EE7B7; color: #059669; }
.btn-icon.success:hover { background: #F0FDF9; }

/* ── Live Activity Feed ──────────────────────────────────────────────────── */
.live-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: #9AA0A6;
  margin-right: 6px; vertical-align: middle;
  transition: background .3s;
}
.live-dot.connected {
  background: #22C55E;
  box-shadow: 0 0 0 0 rgba(34,197,94,.6);
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0   rgba(34,197,94,.6); }
  70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0);  }
  100% { box-shadow: 0 0 0 0   rgba(34,197,94,0);  }
}

.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--gray-100);
  transition: background .25s;
}
.activity-item:last-child  { border-bottom: none; }
.activity-item.new-entry   { animation: flashIn .7s ease; }
@keyframes flashIn {
  from { background: #EFF6FF; }
  to   { background: transparent; }
}

.activity-time {
  font-size: 12px; font-weight: 700; color: var(--navy);
  white-space: nowrap; min-width: 42px; margin-top: 2px;
}
.activity-body { flex: 1; }
.activity-name {
  font-size: 13px; font-weight: 700; color: var(--gray-800);
}
.activity-detail {
  font-size: 12px; color: var(--gray-600); margin-top: 2px;
}
.activity-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.activity-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; letter-spacing: .03em;
}
.activity-badge.in      { background: #D1FAE5; color: #065F46; }
.activity-badge.out     { background: #FEE2E2; color: #991B1B; }
.activity-badge.sk      { background: #EFF6FF; color: #1D4ED8; }
.activity-badge.proc    { background: #FFF7ED; color: #C2410C; }
.activity-badge.outlet  { background: var(--gray-100); color: var(--gray-600); }
.activity-badge.date    { background: #F5F3FF; color: #6D28D9; }

/* ================================================================
   MOBILE RESPONSIVE — Komprehensif untuk semua halaman
   ================================================================ */

/* ── Cegah elemen manapun melebihi lebar layar ── */
@media (max-width: 768px) {
  .card, .main-container, .card-header, .card-body { max-width: 100%; }

  /* Card header: paksa wrap, bukan scroll horizontal */
  .card-header > div {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
  }

  /* Semua tabel di dalam table-wrapper tetap bisa scroll internal */
  .table-wrapper { max-width: 100%; overflow-x: auto; }

  /* ── Staff Input Table (BBB/BBK) → card layout mobile ── */
  .staff-input-table thead { display: none; }
  .staff-input-table tbody tr {
    display: block;
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 10px 14px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
  }
  .staff-input-table tbody tr.no-data {
    box-shadow: none; border: none; background: transparent;
    display: table-row;
  }
  .staff-input-table tbody tr.no-data td { display: table-cell; }
  .staff-input-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border: none;
    font-size: 13px;
    text-align: left !important;
    white-space: normal !important;
    min-height: 36px;
  }
  .staff-input-table tbody td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    color: #9AA0A6;
    text-transform: none;
    letter-spacing: .04em;
    flex-shrink: 0;
    margin-right: 10px;
    min-width: 64px;
  }
  .staff-input-table tbody td[data-label=""]  { display: none; }
  .staff-input-table tbody td.si-name {
    display: block;
    font-weight: 700;
    color: var(--navy);
    font-size: 14px;
    border-bottom: 1px solid #F3F4F6;
    padding-bottom: 8px;
    margin-bottom: 2px;
    min-height: unset;
  }
  .staff-input-table tbody td.si-name::before { display: none; }

  /* Input qty & harga lebih lebar di mobile card */
  .staff-input-table .qty-input   { width: 130px !important; font-size: 16px !important; }
  .staff-input-table .price-input { width: 130px !important; font-size: 14px !important; }

  /* ── Status stok table (Nama/Satuan/Stok/Buffer) → card ── */
  .stock-mini-table thead { display: none; }
  .stock-mini-table tbody tr {
    display: block;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #fff;
  }
  .stock-mini-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    border: none;
    font-size: 12px;
    text-align: left !important;
  }
  .stock-mini-table tbody td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    color: #9AA0A6;
    text-transform: none;
    flex-shrink: 0;
    margin-right: 8px;
    min-width: 56px;
  }
  .stock-mini-table tbody td[data-label=""] { display: none; }
  .stock-mini-table tbody td.sm-name {
    display: block;
    font-weight: 700;
    color: var(--navy);
    font-size: 13px;
    border-bottom: 1px solid #F3F4F6;
    padding-bottom: 6px;
    margin-bottom: 2px;
  }
  .stock-mini-table tbody td.sm-name::before { display: none; }

  /* ── Stat cards: 2 kolom konsisten ── */
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* ── Ringkasan nilai (pTotal, usageTotalCost, dll) ── */
  #pTotal, #usageTotalCost { font-size: 17px !important; }
  #pBBB, #pBBK, #usageBBBCost, #usageBBKCost { font-size: 15px !important; }

  /* ── Tab kategori ── */
  .cat-tab-btn { font-size: 12px; padding: 10px 6px; }
  .cat-tab-btn .tab-badge { display: none; }

  /* ── Main container padding lebih kecil ── */
  .main-container { padding: 10px 8px; }

  /* ── Card padding ── */
  .card-header { padding: 12px 14px; }
  .card-body   { padding: 12px 14px; }

  /* ── Owner filter select & date: 2 kolom, tinggi tetap.
       CATATAN: jangan pakai flex-basis px di sini — parent .filter-bar pernah
       column, basis 120px jadi TINGGI dan kontrol melar raksasa. ── */
  .card-header select,
  .card-header input[type="date"],
  .card-header input[type="month"] {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    max-width: 100%;
    height: 42px;
    font-size: 16px !important;
  }

  /* ── Chip status stok (TOTAL/TERSEDIA/MENIPIS/HABIS): 4 kolom sejajar ── */
  #stockSummaryStrip {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px 12px !important;
  }
  #stockSummaryStrip .stock-filter-chip { min-width: 0 !important; padding: 6px 4px !important; }
  #stockSummaryStrip .stock-filter-chip > div:first-child { font-size: 9px !important; white-space: nowrap; }
  #stockSummaryStrip .stock-filter-chip > div:last-child { font-size: 14px !important; }
  #stripPeriodLabel { grid-column: 1 / -1; margin-left: 0 !important; text-align: right; }

  /* ── Pengeluaran picker mingguan label wrap ── */
  #pWeekLabel, #usageWeekLabel { width: 100%; text-align: left; font-size: 11px; }

  /* ── Header user area ── */
  .header-user { gap: 4px; }
  #outletLabel  { display: none; }

  /* ── Sticky footer ── */
  .sticky-footer { padding: 10px 12px; }
  .btn-save { font-size: 13px; padding: 12px 16px; }

  /* ── Prevent long text overflow ── */
  td, th { word-break: break-word; }

  /* ── Tabel Kelola Akun: jangan pecah nama jadi 2 baris — biarkan
       scroll horizontal di dalam wrapper (lebih mudah dibaca) ── */
  #userTableBody td { white-space: nowrap; word-break: normal; }
}

@media (max-width: 480px) {
  .app-header { padding: 0 10px; height: 52px; }
  .header-title { font-size: 13px; }
  .header-subtitle { display: none; }
  .stat-card { padding: 10px 10px; }
  .stat-value { font-size: 15px; }
  .stat-label { font-size: 10px; }
  .cat-tab-btn { padding: 9px 4px; font-size: 11px; }
  .card-header { padding: 10px 12px; }
  .main-container { padding: 8px 6px; }
  /* Tabel owner analytics: font kecil agar muat */
  .mobile-card-table tbody td { font-size: 12px; }
  .mobile-card-table tbody td.mc-title { font-size: 13px; }
}

/* Hapus nested scroll container di mobile — biarkan page scroll */
@media (max-width: 768px) {
  .tab-content .table-wrapper { max-height: none !important; overflow-y: visible; }
  /* Satuan cell di stock-mini-table sudah ada di nama — sembunyikan */
  .stock-mini-table td[data-label="Satuan"] { display: none; }
}

/* ===== APP MENU GRID (mobile, ala aplikasi marketplace) ===== */
#appMenu { display: none; }

@media (max-width: 768px) {
  #appMenu { display: block; margin-bottom: 14px; }

  .app-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 6px;
    background: #fff;
    border-radius: 16px;
    padding: 16px 8px;
    box-shadow: var(--shadow);
  }

  .app-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .app-menu-item:active .app-menu-icon { transform: scale(.92); }

  .app-menu-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    border: 1px solid rgba(0,0,0,.05);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    transition: transform .12s;
  }

  .app-menu-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-800);
    text-align: center;
    line-height: 1.25;
  }

  .app-menu-item.active .app-menu-icon { outline: 2.5px solid var(--navy); outline-offset: 1px; }
  .app-menu-item.active .app-menu-label { color: var(--navy); font-weight: 800; }

  /* Header dibersihkan di mobile — navigasi pindah ke menu grid */
  .header-user a.btn-logout { display: none !important; }
  .header-user #logoutBtn   { display: none !important; }
}

/* ===== TOMBOL BACK (mobile) ===== */
.mobile-back-btn { display: none; }

@media (max-width: 768px) {
  .mobile-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 8px;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-back-btn:active { background: rgba(255,255,255,.32); }
}

@media (max-width: 768px) {
  /* Back btn + brand rapat di kiri, user area tetap di kanan */
  .app-header { justify-content: flex-start; }
  .app-header .header-user { margin-left: auto; }
}

/* Tab kategori DRINK */
.cat-tab-btn[data-cat="DRINK"].active,
.cat-tab-btn[data-pcat="DRINK"].active { color: #BE185D; border-bottom-color: #BE185D; background: #FDF2F8; }
.cat-tab-btn[data-cat="DRINK"].active .tab-badge { background: #FCE7F3; color: #BE185D; }

/* ===== BOTTOM NAVIGATION (mobile) ===== */
.bottom-nav { display: none; }

@media (max-width: 768px) {
  .bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 900;
    display: flex;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 12px rgba(0,0,0,.07);
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(60px + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--gray-400);
    font-size: 10px;
    font-weight: 700;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s;
    position: relative;
  }
  .bottom-nav a .bn-icon { font-size: 22px; line-height: 1; }
  .bottom-nav a.active { color: var(--navy); }
  .bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: 0; left: 20%; right: 20%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--navy);
  }
  .bottom-nav a:active .bn-icon { transform: scale(.9); }

  /* Beri ruang konten & elemen bawah agar tidak tertutup nav */
  body.has-bottom-nav { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body.has-bottom-nav .sticky-footer { bottom: calc(60px + env(safe-area-inset-bottom)); }
}

/* ===== SUMMARY BAR (Input Stok) ===== */
.summary-bar {
  padding: 14px 20px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
}
.summary-bar .sb-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-600);
  letter-spacing: .04em;
  text-transform: none;
}
.summary-bar .sb-value { font-size: 17px; font-weight: 800; color: var(--navy); margin-top: 2px; }
.summary-bar .sb-total .sb-value { font-size: 21px; }

@media (max-width: 768px) {
  .summary-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 14px;
    padding: 12px 16px;
  }
  .summary-bar .sb-total {
    grid-column: 1 / -1;
    border-bottom: 1px dashed var(--gray-200);
    padding-bottom: 10px;
  }
  .summary-bar .sb-total .sb-value { font-size: 24px; }
  .summary-bar .sb-value { font-size: 16px; }
}

/* ===== TAB INPUT STOK: grid segmen di mobile ===== */
@media (max-width: 768px) {
  .tabs {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    border-bottom: none !important;
    overflow: visible !important;
  }
  .tabs .tab-btn {
    border: 1.5px solid var(--gray-200) !important;
    border-radius: 12px;
    background: #fff;
    padding: 13px 6px !important;
    font-size: 13px !important;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    margin: 0;
  }
  .tabs .tab-btn.active {
    background: var(--navy);
    color: #fff !important;
    border-color: var(--navy) !important;
  }
  .tab-long { display: none; }
  /* Jika jumlah tab ganjil, tab terakhir melebar penuh */
  .tabs .tab-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ===== FEEDBACK BESAR (sukses/gagal) ===== */
.result-overlay {
  position: fixed; inset: 0; z-index: 6000;
  background: rgba(10, 20, 40, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: resFade .18s ease;
}
.result-overlay.bye { opacity: 0; transition: opacity .3s; }
.result-card {
  background: #fff; border-radius: 22px;
  padding: 34px 30px; max-width: 340px; width: 100%;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  animation: resPop .25s cubic-bezier(.34,1.56,.64,1);
}
.result-icon {
  width: 92px; height: 92px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; font-weight: 900; color: #fff;
  margin-bottom: 16px;
}
.result-icon.ok   { background: #16A34A; box-shadow: 0 0 0 12px rgba(22,163,74,.15); }
.result-icon.fail { background: #DC2626; box-shadow: 0 0 0 12px rgba(220,38,38,.13); }
.result-title { font-size: 19px; font-weight: 800; color: #166534; line-height: 1.3; }
.result-sub   { font-size: 13px; color: var(--gray-600); margin-top: 6px; line-height: 1.5; }
.result-btn {
  flex: 1; padding: 13px 20px; border-radius: 12px; border: none;
  font-size: 14px; font-weight: 700; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.result-btn.retry { background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: #fff; }
.result-btn.close { background: var(--gray-100); color: var(--gray-800); }
@keyframes resPop  { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes resFade { from { opacity: 0; } to { opacity: 1; } }

/* ===== WIZARD INPUT STOK (3 langkah) ===== */
.wz-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--gray-200); transition: background .2s; }
.wz-bar.active { background: var(--navy); }

.wz-item {
  background: #fff; border: 1.5px solid var(--gray-200); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 7px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wz-item.picked { border-color: var(--navy); background: #F0F6FF; }
.wz-item .wz-check {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--gray-200); display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: #fff; transition: all .12s;
}
.wz-item.picked .wz-check { background: var(--navy); border-color: var(--navy); }

.wz-qty-row {
  background: #fff; border: 1.5px solid var(--gray-200); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px;
}
.wz-stepper { display: flex; align-items: center; gap: 8px; }
.wz-stepper button {
  width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--gray-200);
  background: #F8FAFC; font-size: 22px; font-weight: 800; color: var(--navy); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wz-stepper button:active { background: var(--gray-100); transform: scale(.95); }
.wz-stepper input {
  flex: 1; min-width: 60px; text-align: center; font-size: 18px; font-weight: 800;
  border: 1.5px solid var(--gray-200); border-radius: 10px; padding: 9px 4px;
}

.wz-nav {
  position: fixed; left: 0; right: 0;
  bottom: calc(60px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--gray-200);
  padding: 10px 14px; display: flex; gap: 10px; z-index: 850;
}
@media (min-width: 769px) { .wz-nav { bottom: 0; } }
body:not(.has-bottom-nav) .wz-nav { bottom: 0; }
.wz-btn {
  flex: 1; padding: 15px; border-radius: 12px; border: none;
  font-size: 15px; font-weight: 800; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wz-btn.back { background: var(--gray-100); color: var(--gray-800); flex: 0 0 32%; }
.wz-btn.next { background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: #fff; }
.wz-btn.save-in  { background: linear-gradient(135deg, #166534, #16A34A); color: #fff; }
.wz-btn.save-out { background: linear-gradient(135deg, #991B1B, #DC2626); color: #fff; }
.wz-btn:disabled { opacity: .4; }
