/* =====================================================================
   HPP KOPI & BAKERY STUDIO - MODERN ARTISANAL DESIGN SYSTEM
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
  /* Artisanal Cafe & Bakery Palette */
  --bg-primary: #120e0b;
  --bg-secondary: #1a1410;
  --bg-tertiary: #231b15;
  --bg-card: rgba(35, 27, 21, 0.75);
  --bg-card-hover: rgba(46, 36, 28, 0.85);
  --bg-elevated: #2d221b;
  --bg-input: #17110d;

  --border-subtle: rgba(217, 155, 67, 0.14);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: #d99b43;

  /* Accent Colors */
  --accent-gold: #d99b43;
  --accent-gold-hover: #eaad56;
  --accent-gold-soft: rgba(217, 155, 67, 0.16);
  --accent-espresso: #4a2e1d;
  --accent-crema: #f3dfc8;
  --accent-emerald: #10b981;
  --accent-emerald-soft: rgba(16, 185, 129, 0.15);
  --accent-amber: #f59e0b;
  --accent-amber-soft: rgba(245, 158, 11, 0.15);
  --accent-rose: #f43f5e;
  --accent-rose-soft: rgba(244, 63, 94, 0.15);
  --accent-blue: #38bdf8;
  --accent-blue-soft: rgba(56, 189, 248, 0.15);

  /* Typography Colors */
  --text-main: #fcf9f5;
  --text-secondary: #c7bcaf;
  --text-muted: #8e8073;
  --text-inverse: #120e0b;

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  --shadow-gold: 0 8px 30px rgba(217, 155, 67, 0.25);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 160ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 260ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Overrides */
body.theme-light {
  --bg-primary: #f7f3ec;
  --bg-secondary: #f0eae0;
  --bg-tertiary: #e6decb;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-elevated: #ffffff;
  --bg-input: #fbf9f5;

  --border-subtle: rgba(130, 88, 56, 0.18);
  --border-card: rgba(130, 88, 56, 0.12);
  --border-focus: #b87b2e;

  --accent-gold: #b87b2e;
  --accent-gold-hover: #9e6722;
  --accent-gold-soft: rgba(184, 123, 46, 0.14);
  --accent-crema: #4a2e1d;

  --text-main: #231b15;
  --text-secondary: #57483c;
  --text-muted: #827265;
  --text-inverse: #ffffff;

  --shadow-sm: 0 2px 8px rgba(66, 44, 25, 0.08);
  --shadow-md: 0 8px 25px rgba(66, 44, 25, 0.12);
  --shadow-lg: 0 16px 45px rgba(66, 44, 25, 0.16);
  --shadow-gold: 0 8px 30px rgba(184, 123, 46, 0.2);
}

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

html {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 10% 20%, rgba(217, 155, 67, 0.07) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(130, 88, 56, 0.09) 0%, transparent 45%),
              var(--bg-primary);
  background-attachment: fixed;
}

/* Typography Helpers */
h1, h2, h3, h4, h5 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.font-serif {
  font-family: 'Playfair Display', serif;
}

/* Header & Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(18, 14, 11, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-normal);
}

body.theme-light .navbar {
  background: rgba(247, 243, 236, 0.88);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  cursor: pointer;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #e8ab56, #8b4a22);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-gold);
  color: #fff;
  font-size: 1.35rem;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.brand-title span {
  color: var(--accent-gold);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-secondary);
  padding: 0.35rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-card);
}

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab-btn.active {
  color: var(--text-inverse);
  background: var(--accent-gold);
  box-shadow: 0 2px 10px rgba(217, 155, 67, 0.4);
}

/* Header Utilities (Status, Sync, Theme) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cloud-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border-card);
  cursor: pointer;
  transition: var(--transition-fast);
}

.cloud-status-pill.connected {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

.cloud-status-pill.disconnected {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
}

/* App Main Container */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.8rem 1.5rem 3.5rem;
  width: 100%;
  flex: 1;
}

/* Hero Banner on top */
.hero-banner {
  background: linear-gradient(135deg, rgba(74, 46, 29, 0.7) 0%, rgba(35, 27, 21, 0.85) 100%),
              url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80" opacity="0.04"><circle cx="40" cy="40" r="28" fill="none" stroke="%23ffffff" stroke-width="2"/></svg>');
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2.2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(217, 155, 67, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content h1 {
  font-size: 1.85rem;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.hero-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 650px;
}

.hero-stats {
  display: flex;
  gap: 1.25rem;
}

.hero-stat-card {
  background: rgba(18, 14, 11, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-card);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  text-align: right;
  min-width: 130px;
}

body.theme-light .hero-stat-card {
  background: rgba(255, 255, 255, 0.8);
}

.hero-stat-num {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--accent-gold);
}

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

/* Tab Views */
.tab-view {
  display: none;
  animation: fadeIn 220ms ease-out forwards;
}

.tab-view.active {
  display: block;
}

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

/* =====================================================================
   TAB 1: KALKULATOR HPP (FORM & REAL-TIME PREVIEW GRID)
   ===================================================================== */
.calculator-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 2rem;
  align-items: start;
}

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

.calc-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-card);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.25rem;
}

.panel-title-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Form Groups & Controls */
.form-section {
  margin-bottom: 1.75rem;
}

.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.85rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 1rem;
}

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

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control, .form-select {
  width: 100%;
  padding: 0.68rem 0.95rem;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-gold-soft);
}

/* Category Selector Pills */
.category-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.category-pill {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.category-pill:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.category-pill.active {
  background: linear-gradient(135deg, var(--accent-gold), #b37324);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(217, 155, 67, 0.35);
}

/* Ingredient Items Table / List in Calculator */
.items-list-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.items-header {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1.2fr 40px;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.item-row {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1.2fr 40px;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  align-items: center;
  border-top: 1px solid var(--border-card);
  transition: background var(--transition-fast);
}

.item-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.item-name-col {
  display: flex;
  flex-direction: column;
}

.item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.item-unit-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.item-qty-input {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  text-align: right;
  width: 100%;
}

.item-unit-badge {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  background: var(--bg-tertiary);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
}

.item-subtotal {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-align: right;
}

.btn-remove-row {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.btn-remove-row:hover {
  color: var(--accent-rose);
  background: var(--accent-rose-soft);
}

.empty-items-notice {
  padding: 1.75rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Quick Add Ingredient Selector */
.add-ingredient-bar {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.65rem;
}

.add-ingredient-bar select {
  flex: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), #b87522);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217, 155, 67, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-gold-hover), #cb832a);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(217, 155, 67, 0.45);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-card);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-gold);
}

.btn-outline-gold {
  background: transparent;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.btn-outline-gold:hover {
  background: var(--accent-gold-soft);
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.85rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Margin Tier Selector Chips */
.margin-presets {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.margin-chip {
  flex: 1;
  padding: 0.4rem 0.3rem;
  text-align: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.margin-chip:hover {
  color: var(--text-main);
  border-color: var(--accent-gold);
}

.margin-chip.active {
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  font-weight: 700;
}

/* =====================================================================
   CALCULATOR PREVIEW PANEL (STICKY SUMMARY)
   ===================================================================== */
.preview-sticky {
  position: sticky;
  top: 5rem;
}

.cost-hero-card {
  background: linear-gradient(145deg, rgba(45, 34, 27, 0.95), rgba(26, 20, 16, 0.95));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.cost-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-gold), #e26d5c);
}

.price-headline-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-crema);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.recommended-price {
  font-size: 2.35rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.price-subtext {
  font-size: 0.84rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profit-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  font-weight: 700;
  font-size: 0.78rem;
}

/* Metric Row in Preview */
.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 1.35rem 0;
}

.metric-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-card);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
}

body.theme-light .metric-box {
  background: rgba(255, 255, 255, 0.6);
}

.metric-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.metric-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
}

/* Food Cost Health Indicator */
.food-cost-status-card {
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.35rem;
  border: 1px solid transparent;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.food-cost-status-card.success {
  background: var(--accent-emerald-soft);
  border-color: rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

.food-cost-status-card.warning {
  background: var(--accent-amber-soft);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.food-cost-status-card.danger {
  background: var(--accent-rose-soft);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fecdd3;
}

.food-cost-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.food-cost-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.food-cost-desc {
  font-size: 0.76rem;
  opacity: 0.9;
  line-height: 1.4;
}

/* Cost Breakdown Stacked Bar */
.breakdown-section {
  margin-bottom: 1.35rem;
}

.breakdown-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.stacked-bar-container {
  height: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-pill);
  display: flex;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  margin-bottom: 0.75rem;
}

.bar-segment {
  height: 100%;
  transition: width var(--transition-normal);
}

.bar-ingredients { background: var(--accent-gold); }
.bar-packaging { background: var(--accent-blue); }
.bar-overhead { background: var(--accent-rose); }

.breakdown-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-color {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

/* Margin Simulation Comparison Table */
.tier-table-container {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border-card);
  padding-top: 1rem;
}

.tier-table-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
}

.tier-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tier-row:hover {
  background: var(--bg-tertiary);
  transform: translateX(2px);
}

.tier-row.active {
  border-left: 3px solid var(--accent-gold);
  background: var(--accent-gold-soft);
  font-weight: 700;
}

/* =====================================================================
   TAB 2: DAFTAR MENU & RESEP
   ===================================================================== */
.recipe-catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 280px;
}

.search-input {
  width: 100%;
  padding: 0.6rem 0.95rem 0.6rem 2.4rem;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  font-size: 0.88rem;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.recipe-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
}

.recipe-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-md);
}

.recipe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.recipe-category-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
  margin-bottom: 0.35rem;
}

.recipe-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
}

.recipe-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin: 1rem 0;
}

.recipe-stat-item {
  display: flex;
  flex-direction: column;
}

.stat-item-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.stat-item-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
}

.stat-item-val.highlight {
  color: var(--accent-gold);
}

.recipe-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recipe-actions {
  display: flex;
  gap: 0.4rem;
}

/* =====================================================================
   TAB 3: MASTER BAHAN BAKU & KEMASAN
   ===================================================================== */
.master-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.custom-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
}

.custom-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-card);
  color: var(--text-main);
}

.custom-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.table-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.table-badge.kopi { background: rgba(184, 123, 46, 0.15); color: #d99b43; }
.table-badge.kue { background: rgba(226, 109, 92, 0.15); color: #e26d5c; }
.table-badge.kemasan { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }

/* =====================================================================
   TAB 4: GOOGLE SHEETS SETTINGS & SYNC
   ===================================================================== */
.integration-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.guide-step {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-gold);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.step-body h4 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.step-body p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.code-snippet-box {
  background: #090705;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  position: relative;
  margin-top: 0.75rem;
}

.code-snippet-box pre {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.8rem;
  color: #e6decb;
  overflow-x: auto;
  max-height: 250px;
}

.btn-copy-code {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

/* =====================================================================
   TAB 5: SIMULASI & ANALISIS BIAYA
   ===================================================================== */
.simulator-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

.custom-range {
  flex: 1;
  accent-color: var(--accent-gold);
  height: 6px;
  border-radius: var(--radius-pill);
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 180ms ease-out;
}

.modal-overlay.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlide 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(15px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--accent-rose);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-card);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 280px;
  animation: toastIn 260ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Print Sheet Styling */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .navbar, .hero-banner, .nav-tabs, .btn, .add-ingredient-bar, .modal-overlay, .toast-container {
    display: none !important;
  }
  .app-container {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .calculator-grid {
    display: block !important;
  }
  .calc-panel, .cost-hero-card {
    border: 1px solid #ddd !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
  }
  .recommended-price {
    color: #000 !important;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-tabs {
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  .hero-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-stats {
    width: 100%;
    justify-content: space-between;
  }
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .items-header, .item-row {
    grid-template-columns: 2fr 1fr 1fr 30px;
  }
  .item-unit-badge {
    display: none;
  }
}

/* =====================================================================
   UTILITY & OPERATIONAL COST COMPONENT STYLES (GAS, LISTRIK, AIR, PARKIR, BENSIN)
   ===================================================================== */
.utility-allocator-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  position: relative;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.utility-allocator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.utility-allocator-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.utility-presets {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.utility-preset-chip {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.utility-preset-chip:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
  border-color: var(--accent-gold-soft);
}

.utility-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

@media (max-width: 900px) {
  .utility-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .utility-grid-3 {
    grid-template-columns: 1fr;
  }
}

.utility-field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 4px;
}

.utility-summary-bar {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

body.theme-light .utility-summary-bar {
  background: rgba(255, 255, 255, 0.7);
}

.utility-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.utility-summary-total {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.utility-summary-total span {
  color: var(--accent-gold);
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
}

.utility-badges-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.badge-utility {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.73rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
}

.badge-utility.gas {
  border-color: rgba(249, 115, 22, 0.3);
  color: #fb923c;
  background: rgba(249, 115, 22, 0.08);
}

.badge-utility.electric {
  border-color: rgba(234, 179, 8, 0.3);
  color: #facc15;
  background: rgba(234, 179, 8, 0.08);
}

.badge-utility.water {
  border-color: rgba(6, 182, 212, 0.3);
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.08);
}

.badge-utility.parking {
  border-color: rgba(168, 85, 247, 0.3);
  color: #c084fc;
  background: rgba(168, 85, 247, 0.08);
}

.badge-utility.petrol {
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
}

.badge-utility.other {
  border-color: rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.08);
}

.allocator-calc-result-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.allocator-result-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.allocator-result-text strong {
  color: var(--accent-emerald);
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
}

.bep-expense-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .bep-expense-grid {
    grid-template-columns: 1fr;
  }
}

