/* ==========================================================================
   HET MBG (Harga Eceran Tertinggi Makan Bergizi Gratis) - Stylesheet
   Modern, Ultra-responsive, Dashboard System with Dark/Light Mode & Glassmorphism
   ========================================================================== */

:root {
  /* Color Palette - Light Mode Default */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-glass: rgba(255, 255, 255, 0.7);

  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  /* Accent Colors */
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --primary-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);

  --emerald: #10b981;
  --emerald-light: #d1fae5;
  --emerald-dark: #047857;

  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --amber-dark: #b45309;

  --rose: #ef4444;
  --rose-light: #fee2e2;
  --rose-dark: #b91c1c;

  --indigo: #6366f1;
  --indigo-light: #e0e7ff;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 25px rgba(2, 132, 199, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-bounce: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark Mode Theme */
[data-theme="dark"] {
  --bg-primary: #0b1120;
  --bg-secondary: #131c31;
  --bg-tertiary: #1e293b;
  --bg-card: rgba(19, 28, 49, 0.85);
  --bg-card-hover: rgba(28, 40, 68, 0.95);
  --bg-glass: rgba(19, 28, 49, 0.7);

  --border-color: #1e293b;
  --border-subtle: #334155;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-light: rgba(56, 189, 248, 0.15);
  --primary-gradient: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);

  --emerald: #34d399;
  --emerald-light: rgba(52, 211, 153, 0.15);
  --emerald-dark: #6ee7b7;

  --amber: #fbbf24;
  --amber-light: rgba(251, 191, 36, 0.15);
  --amber-dark: #fde68a;

  --rose: #f87171;
  --rose-light: rgba(248, 113, 113, 0.15);
  --rose-dark: #fca5a5;

  --indigo: #818cf8;
  --indigo-light: rgba(129, 140, 248, 0.15);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 30px -5px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.2);
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(99, 102, 241, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Glassmorphism utility */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.glass-panel:hover {
  border-color: var(--border-subtle);
}

/* Top Navigation Bar */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  transition: background var(--transition-normal), border var(--transition-normal);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo-wrap {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  flex-shrink: 0;
}

.brand-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-info h1 span.badge-title {
  background: var(--primary-gradient);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Region Quick Selector in Header */
.region-selector-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.65rem 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.region-selector-bar .region-icon {
  color: var(--primary);
  font-size: 0.95rem;
}

.region-selector-bar label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.region-select {
  background: transparent;
  border: none;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  padding-right: 0.5rem;
}

.region-select option {
  background: var(--bg-secondary);
  color: var(--text-main);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Theme toggle & button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-full);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--emerald);
  color: #ffffff;
}

.btn-success:hover {
  background: var(--emerald-dark);
}

.btn-warning {
  background: var(--amber);
  color: #ffffff;
}

.btn-warning:hover {
  background: var(--amber-dark);
}

.btn-danger {
  background: var(--rose);
  color: #ffffff;
}

.btn-danger:hover {
  background: var(--rose-dark);
}

/* Main Layout */
.main-wrapper {
  max-width: 1440px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Hero Regional Info Banner */
.regional-hero {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08) 0%, rgba(99, 102, 241, 0.06) 100%), var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.regional-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-gradient);
}

.regional-hero-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.kitchen-badge-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.regional-hero-title h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.regional-hero-title .tag-provinsi {
  font-size: 0.72rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.regional-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.regional-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.regional-hero-meta i {
  color: var(--primary);
}

.regional-hero-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-pill-stat {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  text-align: right;
}

.hero-pill-stat .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.hero-pill-stat .val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

/* KPI Overview Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.kpi-card {
  padding: 1.15rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.kpi-card.kpi-total::before { background: var(--primary); }
.kpi-card.kpi-safe::before { background: var(--emerald); }
.kpi-card.kpi-warning::before { background: var(--amber); }
.kpi-card.kpi-danger::before { background: var(--rose); }
.kpi-card.kpi-compliance::before { background: var(--indigo); }

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.kpi-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.kpi-total .kpi-icon { background: var(--primary-light); color: var(--primary); }
.kpi-safe .kpi-icon { background: var(--emerald-light); color: var(--emerald); }
.kpi-warning .kpi-icon { background: var(--amber-light); color: var(--amber); }
.kpi-danger .kpi-icon { background: var(--rose-light); color: var(--rose); }
.kpi-compliance .kpi-icon { background: var(--indigo-light); color: var(--indigo); }

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1;
}

.kpi-unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-footer {
  margin-top: 0.65rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Tabs Navigation */
.tabs-navigation {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-navigation::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  position: relative;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-tertiary);
}

.tab-btn.active {
  color: var(--primary);
  background: var(--bg-card);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.tab-badge {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 800;
}

.tab-btn.active .tab-badge {
  background: var(--primary-light);
  color: var(--primary);
}

/* Tab Panels */
.tab-content-panel {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Filter Bar & Controls */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.search-input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.category-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.cat-pill {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.cat-pill:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.cat-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-filter-select {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

/* Modern Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.het-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

.het-table thead th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.het-table tbody tr {
  transition: background var(--transition-fast);
}

.het-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.het-table tbody td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.het-table tbody tr:last-child td {
  border-bottom: none;
}

/* Table Item Cell */
.commodity-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.commodity-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.commodity-title-wrap strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.commodity-code {
  font-size: 0.7rem;
  font-family: monospace;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.price-display {
  display: flex;
  flex-direction: column;
}

.price-display .price-num {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.price-display .price-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-aman {
  background: var(--emerald-light);
  color: var(--emerald-dark);
}
.badge-aman::before {
  background: var(--emerald);
}

.badge-waspada {
  background: var(--amber-light);
  color: var(--amber-dark);
}
.badge-waspada::before {
  background: var(--amber);
}

.badge-melebihi {
  background: var(--rose-light);
  color: var(--rose-dark);
  animation: pulseMelebihi 2s infinite ease-in-out;
}
.badge-melebihi::before {
  background: var(--rose);
}

@keyframes pulseMelebihi {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.disparity-indicator {
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.disparity-indicator.positive {
  color: var(--rose);
}
.disparity-indicator.neutral {
  color: var(--amber);
}
.disparity-indicator.negative {
  color: var(--emerald);
}

/* Kitchen Officer Row Actions */
.cell-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Card Grid View (Alternative View) */
.card-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.15rem;
}

.commodity-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  transition: transform var(--transition-bounce), box-shadow var(--transition-normal);
}

.commodity-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-prices-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.card-price-col {
  display: flex;
  flex-direction: column;
}

.card-price-col.het-col {
  border-left: 1px dashed var(--border-subtle);
  padding-left: 0.5rem;
}

.card-price-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card-price-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.card-meta-notes {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  border-left: 2px solid var(--primary);
  padding-left: 0.5rem;
}

/* Comparison & Disparity Section */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 992px) {
  .comparison-grid {
    grid-template-columns: 1.6fr 1.2fr;
  }
}

.chart-card-wrapper {
  padding: 1.5rem;
}

.chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.chart-canvas-container {
  position: relative;
  height: 350px;
  width: 100%;
}

/* Calculator Section */
.calculator-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 992px) {
  .calculator-grid {
    grid-template-columns: 1fr 1.6fr;
  }
}

.calc-config-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.calc-summary-banner {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%), var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-around;
  gap: 1rem;
  text-align: center;
}

.calc-summary-item .title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.calc-summary-item .value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  padding: 1rem;
  overflow-y: auto;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 580px;
  max-height: min(92vh, 800px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--transition-bounce);
  margin: auto;
}

.modal-container form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--rose);
  background: rgba(239, 68, 68, 0.1);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  scrollbar-width: thin;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

/* Audit History Timeline */
.timeline {
  position: relative;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-secondary);
}

.timeline-content {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.timeline-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  min-width: 300px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.84rem;
  font-weight: 600;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all var(--transition-normal);
}

.toast.toast-success { border-left: 4px solid var(--emerald); }
.toast.toast-error { border-left: 4px solid var(--rose); }
.toast.toast-warning { border-left: 4px solid var(--amber); }
.toast.toast-info { border-left: 4px solid var(--primary); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-container {
    flex-wrap: wrap;
  }
  .region-selector-bar {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .regional-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .regional-hero-stats {
    width: 100%;
    justify-content: space-between;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    max-width: 100%;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* 10 Dapur Horizontal Quick Switcher */
.dapur-switcher-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 0.65rem;
  scrollbar-width: thin;
  margin-bottom: 0.25rem;
}

.dapur-switcher-bar::-webkit-scrollbar {
  height: 6px;
}

.dapur-switcher-bar::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}

.dapur-card-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  user-select: none;
}

.dapur-card-pill:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.dapur-card-pill.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%), var(--bg-secondary);
  box-shadow: 0 0 0 2px var(--primary-light), var(--shadow-md);
}

.dapur-card-pill.selected-only {
  cursor: default;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--primary);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.18);
}

.dapur-pill-num {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dapur-card-pill.active .dapur-pill-num {
  background: var(--primary);
  color: #ffffff;
}

.dapur-pill-info strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.dapur-pill-info span {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Quick Percentage Preset Buttons */
.preset-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.preset-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Logo Upload & Preview Box */
.logo-preview-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

.logo-preview-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--border-color);
  background: #ffffff;
}

/* User Session Profile Chip */
.user-session-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

.user-session-chip:hover {
  border-color: var(--primary);
  background: var(--bg-tertiary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.user-avatar-badge {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, var(--emerald) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-info-text strong {
  font-size: 0.78rem;
  color: var(--text-main);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-role {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.badge-role.badge-admin {
  color: #dc2626;
}

.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  border-radius: var(--radius-sm);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--rose);
}

.btn-danger-outline:hover {
  background: var(--rose);
  color: #ffffff;
}

/* Petugas & Katalog Management Tables */
.petugas-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.petugas-table th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.petugas-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.petugas-table tr:hover td {
  background: var(--bg-tertiary);
}

.badge-public-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
}

