/* ================================================================
   Kapeira - Alma Mater — Design System
   ================================================================
   Orden:
   1. Google Fonts Import
   2. Design Tokens (CSS Variables)
   3. Reset & Base
   4. Layout (header, main, bottom-nav)
   5. Components (cards, buttons, inputs, badges, table)
   6. Page-specific modules
   7. Animations & Transitions
   8. Toast
   9. Utilities
   ================================================================ */

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

/* ================================================================
   1. DESIGN TOKENS
   ================================================================ */
:root {
  /* ── Backgrounds (Kapeira Maroon) ──────── */
  --bg-950:  #0B0002;
  --bg-900:  #150004;
  --bg-800:  #290008;
  --bg-700:  #40000A;
  --bg-600:  #58000e;

  /* ── Surfaces (glassmorphism) ─────────── */
  --glass-1: rgba(255, 246, 238, 0.035);
  --glass-2: rgba(255, 246, 238, 0.065);
  --glass-3: rgba(255, 246, 238, 0.10);
  --glass-active: rgba(224, 126, 39, 0.12);

  /* ── Kapeira Orange palette ───────────── */
  --gold-900: #733c0c;
  --gold-700: #C26E20;
  --gold-500: #E07E27;
  --gold-400: #e89954;
  --gold-300: #f0b582;
  --gold-100: #fdf2e9;

  /* ── Cream text ───────────────────────── */
  --text-primary:   #FFF6EE;
  --text-secondary: rgba(255, 246, 238, 0.65);
  --text-muted:     rgba(255, 246, 238, 0.40);
  --text-disabled:  rgba(255, 246, 238, 0.20);

  /* ── Semantic colors ──────────────────── */
  --success:        #00999E;
  --success-bg:     rgba(0, 153, 158, 0.12);
  --success-border: rgba(0, 153, 158, 0.30);

  --warning:        #F0A840;
  --warning-bg:     rgba(240, 168, 64, 0.10);
  --warning-border: rgba(240, 168, 64, 0.25);

  --error:          #E85555;
  --error-bg:       rgba(232, 85, 85, 0.10);
  --error-border:   rgba(232, 85, 85, 0.25);

  --info:           #5B9BD5;
  --info-bg:        rgba(91, 155, 213, 0.10);
  --info-border:    rgba(91, 155, 213, 0.25);

  /* ── Borders ──────────────────────────── */
  --border:        rgba(224, 126, 39, 0.15);
  --border-hover:  rgba(224, 126, 39, 0.35);
  --border-strong: rgba(224, 126, 39, 0.60);

  /* ── Shadows ──────────────────────────── */
  --shadow-sm:  0 2px 8px  rgba(0,0,0,0.40);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.55);
  --shadow-lg:  0 16px 48px rgba(0,0,0,0.70);
  --shadow-gold:    0 4px 20px rgba(224,126,39,0.22);
  --shadow-gold-lg: 0 8px 40px rgba(224,126,39,0.35);

  /* ── Border Radius ────────────────────── */
  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   22px;
  --r-xl:   32px;
  --r-full: 9999px;

  /* ── Spacing ──────────────────────────── */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px;

  /* ── Typography ───────────────────────── */
  --font:    'Outfit', system-ui, sans-serif;
  --text-xs: 11px; --text-sm: 13px; --text-base: 15px;
  --text-md: 17px; --text-lg: 20px; --text-xl: 24px;
  --text-2xl: 30px; --text-3xl: 38px;

  /* ── Layout ───────────────────────────── */
  --header-h:  68px;
  --nav-h:     72px;
  --max-w:     520px;
}

/* ================================================================
   2. RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family:      var(--font);
  font-size:        var(--text-base);
  color:            var(--text-primary);
  background-color: var(--bg-900);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(125, 16, 36, 0.20) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(224, 126, 39, 0.10) 0%, transparent 60%);
  background-attachment: fixed;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font); }
ul, ol { list-style: none; }

/* Loading state */
body.app-loading .main-content { opacity: 0; }
body.app-ready  .main-content  { opacity: 1; transition: opacity 0.35s ease; }

/* ================================================================
   3. LAYOUT
   ================================================================ */

/* ── App Header ──────────────────────────────────────────────── */
.app-header {
  position:   fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height:  var(--header-h);
  background: rgba(15,8,5,0.82);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-5);
}
.header-brand {
  display:     flex;
  align-items: center;
  gap:         var(--sp-3);
}
.brand-icon {
  font-size: 26px;
  filter: drop-shadow(0 0 8px rgba(224,126,39,0.5));
}
.brand-name {
  font-size:   var(--text-base);
  font-weight: 700;
  color:        var(--text-primary);
  line-height:  1.1;
}
.brand-subtitle {
  font-size:   var(--text-xs);
  color:        var(--text-secondary);
  text-transform: capitalize;
  line-height:  1;
  margin-top:   2px;
}
.btn-icon {
  width:  40px; height: 40px;
  display:         flex;
  align-items:     center;
  justify-content: center;
  border-radius:   var(--r-sm);
  font-size:       20px;
  background:      var(--glass-2);
  border:          1px solid var(--border);
  transition:      background 0.2s, border-color 0.2s;
}
.btn-icon:hover { background: var(--glass-3); border-color: var(--border-hover); }

/* ── Main Content ────────────────────────────────────────────── */
.main-content {
  max-width:  var(--max-w);
  margin:     0 auto;
  padding:    calc(var(--header-h) + var(--sp-5)) var(--sp-4) calc(var(--nav-h) + var(--sp-6));
  transition: opacity 0.35s ease;
}

/* ── Bottom Navigation ───────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: flex-start;
  padding-top: var(--sp-2);
  background: rgba(15,8,5,0.88);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  gap:             3px;
  padding:         var(--sp-1) 0;
  color:           var(--text-muted);
  transition:      color 0.2s;
  position:        relative;
}
.nav-item::before {
  content: '';
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 28px; height: 2px;
  background: var(--gold-500);
  border-radius: var(--r-full);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1);
}
.nav-item.active { color: var(--gold-400); }
.nav-item.active::before { transform: translateX(-50%) scaleX(1); }
.nav-icon  { font-size: 22px; line-height: 1; }
.nav-label { font-size: 10px; font-weight: 500; letter-spacing: 0.3px; }

/* ── Page Title ──────────────────────────────────────────────── */
.page-title {
  font-size:   var(--text-xl);
  font-weight: 800;
  color:        var(--text-primary);
  margin-bottom: var(--sp-1);
}
.page-subtitle {
  font-size: var(--text-sm);
  color:     var(--text-secondary);
  margin-bottom: var(--sp-6);
}

/* ================================================================
   4. SECTIONS
   ================================================================ */
.section { margin-bottom: var(--sp-6); }

.section-header {
  display:     flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.section-title {
  font-size:   var(--text-md);
  font-weight: 700;
  color:        var(--text-primary);
}
.section-badge {
  font-size:    var(--text-xs);
  font-weight:  600;
  color:         var(--gold-500);
  background:    rgba(224,126,39,0.1);
  border:        1px solid rgba(224,126,39,0.2);
  padding:       3px 10px;
  border-radius: var(--r-full);
}
.section-desc {
  font-size:     var(--text-sm);
  color:          var(--text-secondary);
  margin-bottom: var(--sp-4);
}
.section-actions { margin-top: var(--sp-4); }
.link-more {
  font-size:  var(--text-sm);
  font-weight: 600;
  color:       var(--gold-400);
  transition:  color 0.2s;
}
.link-more:hover { color: var(--gold-300); }

/* ================================================================
   5. COMPONENTS
   ================================================================ */

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background:    var(--glass-1);
  border:        1px solid var(--border);
  border-radius: var(--r-md);
  padding:       var(--sp-5);
  transition:    background 0.25s, border-color 0.25s, transform 0.25s;
}
.card:hover {
  background:   var(--glass-2);
  border-color: var(--border-hover);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             var(--sp-2);
  padding:         12px var(--sp-5);
  border-radius:   var(--r-sm);
  font-size:       var(--text-base);
  font-weight:     600;
  letter-spacing:  0.2px;
  transition:      background 0.2s, box-shadow 0.2s, transform 0.15s, opacity 0.2s;
  cursor:          pointer;
  border:          1px solid transparent;
  white-space:     nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  color:      var(--bg-900);
  box-shadow: var(--shadow-gold);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  box-shadow: var(--shadow-gold-lg);
}
.btn-ghost {
  background: var(--glass-2);
  color:      var(--text-secondary);
  border:     1px solid var(--border);
}
.btn-ghost:hover { background: var(--glass-3); border-color: var(--border-hover); color: var(--text-primary); }

.btn-danger {
  background: var(--error-bg);
  color:      var(--error);
  border:     1px solid var(--error-border);
}
.btn-danger:hover { background: rgba(232,85,85,0.18); }

.btn-sm   { padding: 8px 14px; font-size: var(--text-sm); }
.btn-full { width: 100%; }
.btn-icon-sm {
  width: 34px; height: 34px; padding: 0;
  border-radius: var(--r-sm);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Form Fields ─────────────────────────────────────────────── */
.field-group {
  display:        flex;
  flex-direction: column;
  gap:            var(--sp-1);
}
.field-label {
  font-size:   var(--text-xs);
  font-weight: 600;
  color:        var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.field-input {
  background:    var(--glass-2);
  border:        1px solid var(--border);
  border-radius: var(--r-sm);
  padding:       10px 14px;
  font-size:     var(--text-md);
  font-weight:   600;
  color:          var(--text-primary);
  width:          100%;
  transition:     border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -moz-appearance: textfield;
  appearance:    textfield;
}
.field-input::-webkit-inner-spin-button,
.field-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field-input::placeholder { color: var(--text-disabled); }
.field-input:focus {
  outline:      none;
  border-color: var(--gold-500);
  background:   var(--glass-3);
  box-shadow:   0 0 0 3px rgba(224,126,39,0.12);
}
.field-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D4A853' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}
.field-date { padding: 10px 14px; cursor: pointer; }
.field-date::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(2) hue-rotate(5deg);
  cursor: pointer;
}

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display:         inline-flex;
  align-items:     center;
  gap:             4px;
  font-size:       var(--text-xs);
  font-weight:     600;
  padding:         3px 9px;
  border-radius:   var(--r-full);
  white-space:     nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-error   { background: var(--error-bg);   color: var(--error);   border: 1px solid var(--error-border); }
.badge-info    { background: var(--info-bg);     color: var(--info);    border: 1px solid var(--info-border); }
.badge-gold    { background: rgba(224,126,39,0.12); color: var(--gold-400); border: 1px solid rgba(224,126,39,0.25); }

/* ── Table ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); }
.data-table {
  width:           100%;
  border-collapse: collapse;
  font-size:       var(--text-sm);
}
.data-table thead tr {
  background: var(--glass-2);
  border-bottom: 1px solid var(--border);
}
.data-table th {
  padding:       10px 14px;
  text-align:    left;
  font-size:     var(--text-xs);
  font-weight:   700;
  color:          var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space:   nowrap;
}
.data-table td {
  padding:     10px 14px;
  color:        var(--text-primary);
  border-top:   1px solid rgba(224,126,39,0.06);
  vertical-align: middle;
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--glass-1); }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding:    var(--sp-12) var(--sp-6);
  color:      var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: var(--sp-4); }
.empty-state-title { font-size: var(--text-lg); font-weight: 600; color: var(--text-secondary); margin-bottom: var(--sp-2); }
.empty-state-desc  { font-size: var(--text-sm); }

/* ── Divider ─────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: var(--sp-5) 0; }

/* ================================================================
   6. MODULE: KPI CARDS (Dashboard)
   ================================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.kpi-card {
  background:    var(--glass-1);
  border:        1px solid var(--border);
  border-radius: var(--r-md);
  padding:       var(--sp-4);
  display:       flex;
  align-items:   center;
  gap:           var(--sp-3);
  transition:    transform 0.25s, box-shadow 0.25s;
  animation:     fadeUp 0.4s ease both;
}
.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.10s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.20s; }

.kpi-icon { font-size: 26px; line-height: 1; }
.kpi-info { display: flex; flex-direction: column; gap: 2px; }
.kpi-label { font-size: var(--text-xs); color: var(--text-secondary); font-weight: 500; }
.kpi-value { font-size: var(--text-xl); font-weight: 800; line-height: 1; }

.kpi-primary { border-color: rgba(224,126,39,0.20); }
.kpi-primary .kpi-value { color: var(--gold-400); }
.kpi-success { border-color: var(--success-border); }
.kpi-success .kpi-value { color: var(--success); }
.kpi-error   { border-color: var(--error-border); }
.kpi-error .kpi-value   { color: var(--error); }
.kpi-info-card { border-color: var(--info-border); }
.kpi-info-card .kpi-value { color: var(--info); }

.kpi-alert { animation: pulseAlert 1.5s ease 3; }

/* ================================================================
   7. MODULE: BAKING SUGGESTIONS (Dashboard)
   ================================================================ */
.suggestion-grid { display: flex; flex-direction: column; gap: var(--sp-3); }

.suggestion-card {
  background:    var(--glass-1);
  border:        1px solid var(--border);
  border-radius: var(--r-md);
  padding:       var(--sp-4);
  display:       flex;
  align-items:   center;
  gap:           var(--sp-3);
  position:      relative;
  overflow:      hidden;
  transition:    border-color 0.2s, background 0.2s;
  animation:     fadeUp 0.4s ease both;
}
.suggestion-card.registered {
  border-color: var(--success-border);
  background:   var(--success-bg);
}
.suggestion-emoji { font-size: 28px; flex-shrink: 0; }
.suggestion-info  { flex: 1; min-width: 0; }
.suggestion-name  {
  font-size:    var(--text-base);
  font-weight:  600;
  display:      block;
  white-space:  nowrap;
  overflow:     hidden;
  text-overflow: ellipsis;
}
.suggestion-meta { display: flex; gap: var(--sp-3); margin-top: 2px; flex-wrap: wrap; }
.meta-item { font-size: var(--text-xs); color: var(--text-secondary); }
.meta-item.overnight { color: var(--info); }

.suggestion-qty {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  flex-shrink:    0;
  background:     rgba(224,126,39,0.10);
  border:         1px solid rgba(224,126,39,0.20);
  border-radius:  var(--r-sm);
  padding:        6px 12px;
  min-width:      56px;
}
.suggestion-qty.qty-zero {
  background: var(--success-bg);
  border-color: var(--success-border);
}
.qty-number {
  font-size:   22px;
  font-weight: 800;
  color:        var(--gold-400);
  line-height:  1;
}
.suggestion-qty.qty-zero .qty-number { color: var(--success); }
.qty-unit { font-size: var(--text-xs); color: var(--text-muted); font-weight: 500; }

.registered-badge {
  position: absolute;
  top: 8px; right: 8px;
  font-size:     var(--text-xs);
  font-weight:   700;
  color:          var(--success);
  background:    var(--success-bg);
  border:        1px solid var(--success-border);
  border-radius: var(--r-full);
  padding:       2px 8px;
}

/* ================================================================
   8. MODULE: CHART CARD
   ================================================================ */
.chart-card {
  background:    var(--glass-1);
  border:        1px solid var(--border);
  border-radius: var(--r-md);
  padding:       var(--sp-4);
  height:        220px;
}

/* ================================================================
   9. MODULE: WEEKLY STOCK (Dashboard)
   ================================================================ */
.stock-total {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  padding:         var(--sp-3) var(--sp-4);
  background:      rgba(224,126,39,0.07);
  border:          1px solid rgba(224,126,39,0.18);
  border-radius:   var(--r-sm);
  margin-bottom:   var(--sp-3);
}
.stock-total-label { font-size: var(--text-sm); color: var(--text-secondary); font-weight: 500; }
.stock-total-value { font-size: var(--text-lg); font-weight: 800; color: var(--gold-400); }

.stock-item {
  display:     flex;
  align-items: center;
  gap:         var(--sp-3);
  padding:     var(--sp-2) 0;
  border-bottom: 1px solid rgba(224,126,39,0.07);
}
.stock-item:last-child { border-bottom: none; }
.stock-emoji { font-size: 20px; flex-shrink: 0; width: 28px; text-align: center; }
.stock-name  { font-size: var(--text-sm); font-weight: 500; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-bar-wrap { width: 70px; height: 6px; background: var(--glass-3); border-radius: var(--r-full); overflow: hidden; flex-shrink: 0; }
.stock-bar { height: 100%; background: linear-gradient(90deg, var(--gold-700), var(--gold-500)); border-radius: var(--r-full); transition: width 0.6s ease; }
.stock-qty { font-size: var(--text-sm); font-weight: 700; color: var(--gold-400); flex-shrink: 0; min-width: 32px; text-align: right; }

/* ================================================================
   10. MODULE: PRODUCT RECORD CARD (Registro)
   ================================================================ */
.product-record-card {
  background:    var(--glass-1);
  border:        1px solid var(--border);
  border-radius: var(--r-md);
  padding:       var(--sp-4);
  margin-bottom: var(--sp-4);
  transition:    border-color 0.2s;
  animation:     fadeUp 0.35s ease both;
}
.product-record-card.is-saved { border-color: var(--success-border); }

.prc-header {
  display:         flex;
  align-items:     flex-start;
  justify-content: space-between;
  margin-bottom:   var(--sp-4);
  gap:             var(--sp-2);
}
.prc-product { display: flex; align-items: center; gap: var(--sp-3); flex: 1; min-width: 0; }
.prc-emoji { font-size: 28px; flex-shrink: 0; }
.prc-name  { font-size: var(--text-base); font-weight: 700; display: block; }
.prc-hint  { font-size: var(--text-xs); color: var(--text-secondary); display: block; margin-top: 2px; }
.badge-saved {
  font-size: var(--text-xs); font-weight: 700; color: var(--success);
  background: var(--success-bg); border: 1px solid var(--success-border);
  border-radius: var(--r-full); padding: 3px 10px; white-space: nowrap; flex-shrink: 0;
}

.prc-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.prc-sales {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  background:      rgba(224,126,39,0.07);
  border:          1px solid rgba(224,126,39,0.15);
  border-radius:   var(--r-sm);
  padding:         var(--sp-3) var(--sp-4);
}
.sales-label { font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary); }
.sales-value {
  font-size:   var(--text-xl);
  font-weight: 800;
  color:        var(--gold-400);
  transition:   color 0.2s;
}
.sales-value.sales-zero { color: var(--error); }

/* ── Save bar ────────────────────────────────────────────────── */
.save-bar {
  position:   sticky;
  bottom:     calc(var(--nav-h) + var(--sp-3));
  z-index:    50;
  padding:    var(--sp-3);
  background: rgba(15,8,5,0.90);
  backdrop-filter: blur(16px);
  border:     1px solid var(--border);
  border-radius: var(--r-md);
  margin-top: var(--sp-4);
}

/* ================================================================
   11. MODULE: PROJECTION TABLE
   ================================================================ */
.proj-day-header {
  display:     flex;
  align-items: center;
  gap:         var(--sp-2);
  padding:     var(--sp-3) var(--sp-4);
  background:  var(--glass-2);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-2);
}
.proj-day-name {
  font-size:   var(--text-base);
  font-weight: 700;
  color:        var(--text-primary);
}
.proj-day-date { font-size: var(--text-xs); color: var(--text-secondary); }
.proj-today-badge {
  font-size:     var(--text-xs);
  font-weight:   700;
  color:          var(--gold-500);
  background:    rgba(224,126,39,0.12);
  border:        1px solid rgba(224,126,39,0.25);
  border-radius: var(--r-full);
  padding:       2px 9px;
}

.proj-item {
  display:     flex;
  align-items: center;
  gap:         var(--sp-3);
  padding:     var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.proj-item:last-child { border-bottom: none; }
.proj-emoji    { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.proj-name     { flex: 1; font-size: var(--text-sm); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-avg      { font-size: var(--text-xs); color: var(--text-muted); width: 44px; text-align: center; }
.proj-overnight { font-size: var(--text-xs); color: var(--info); width: 44px; text-align: center; }
.proj-suggest  {
  font-size:   var(--text-base);
  font-weight: 800;
  color:        var(--gold-400);
  width:        44px;
  text-align:   right;
}
.proj-suggest.zero { color: var(--success); }

/* ── Projection summary card ─────────────────────────────────── */
.proj-summary {
  background:    var(--glass-1);
  border:        1px solid var(--border);
  border-radius: var(--r-md);
  padding:       var(--sp-5);
  margin-bottom: var(--sp-5);
}
.proj-summary-title {
  font-size:     var(--text-base);
  font-weight:   700;
  margin-bottom: var(--sp-4);
  color:          var(--text-primary);
}

/* ================================================================
   12. MODULE: PRODUCTS CATALOG
   ================================================================ */
.product-grid { display: flex; flex-direction: column; gap: var(--sp-3); }

.product-item {
  display:       flex;
  align-items:   center;
  gap:           var(--sp-3);
  background:    var(--glass-1);
  border:        1px solid var(--border);
  border-radius: var(--r-md);
  padding:       var(--sp-4);
  transition:    border-color 0.2s, background 0.2s, opacity 0.2s;
  animation:     fadeUp 0.35s ease both;
}
.product-item.inactive { opacity: 0.5; }
.product-item-emoji    { font-size: 28px; flex-shrink: 0; }
.product-item-info     { flex: 1; min-width: 0; }
.product-item-name     { font-size: var(--text-base); font-weight: 600; }
.product-item-meta     { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }
.product-item-actions  { display: flex; gap: var(--sp-2); flex-shrink: 0; }

/* ── Add product modal / inline form ─────────────────────────── */
.add-product-form {
  background:    var(--glass-2);
  border:        1px solid var(--border-hover);
  border-radius: var(--r-md);
  padding:       var(--sp-4);
  margin-bottom: var(--sp-4);
  animation:     fadeDown 0.25s ease;
}
.form-row { display: flex; gap: var(--sp-3); align-items: flex-end; }
.emoji-input { width: 64px; text-align: center; font-size: 20px; }

/* ── Toggle switch ───────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: var(--sp-2); }
.toggle {
  width:  42px; height: 24px;
  background:    var(--glass-3);
  border:        1px solid var(--border);
  border-radius: var(--r-full);
  position:      relative;
  cursor:        pointer;
  transition:    background 0.25s, border-color 0.25s;
  flex-shrink:   0;
}
.toggle::after {
  content:       '';
  position:      absolute;
  width:  16px; height: 16px;
  top:   3px; left: 3px;
  background:    var(--text-muted);
  border-radius: var(--r-full);
  transition:    transform 0.25s cubic-bezier(.34,1.56,.64,1), background 0.25s;
}
.toggle.on { background: var(--success); border-color: var(--success-border); }
.toggle.on::after { transform: translateX(18px); background: #fff; }

/* ================================================================
   13. MODULE: HISTORIAL
   ================================================================ */
.filter-bar {
  display:       flex;
  gap:           var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap:     wrap;
}
.filter-bar .field-input { flex: 1; min-width: 140px; font-size: var(--text-sm); padding: 9px 12px; }

.record-row-actions { display: flex; gap: var(--sp-1); }

/* Inline edit form */
.inline-edit {
  background:    var(--glass-2);
  border:        1px solid var(--border-hover);
  border-radius: var(--r-md);
  padding:       var(--sp-4);
  margin:        var(--sp-2) 0;
  animation:     fadeDown 0.2s ease;
}
.inline-edit .prc-fields { margin-bottom: var(--sp-3); }
.inline-edit-actions { display: flex; gap: var(--sp-2); justify-content: flex-end; }

/* ================================================================
   14. TOAST
   ================================================================ */
.toast {
  position:      fixed;
  bottom:        calc(var(--nav-h) + var(--sp-4));
  left:          50%;
  transform:     translateX(-50%) translateY(20px);
  z-index:       999;
  display:       flex;
  align-items:   center;
  gap:           var(--sp-2);
  padding:       12px 20px;
  border-radius: var(--r-full);
  background:    rgba(24,13,7,0.95);
  backdrop-filter: blur(20px);
  border:        1px solid var(--border-hover);
  box-shadow:    var(--shadow-lg);
  font-size:     var(--text-sm);
  font-weight:   500;
  white-space:   nowrap;
  opacity:       0;
  transition:    opacity 0.25s, transform 0.3s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-icon {
  width: 20px; height: 20px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
}
.toast-success .toast-icon { background: var(--success); color: #fff; }
.toast-error   .toast-icon { background: var(--error);   color: #fff; }
.toast-warning .toast-icon { background: var(--warning); color: #fff; }
.toast-info    .toast-icon { background: var(--info);    color: #fff; }
.toast-msg { color: var(--text-primary); }

/* ================================================================
   15. ANIMATIONS
   ================================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0);     }
}
@keyframes pulseAlert {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: 0 0 0 4px rgba(232,85,85,0.25); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

/* Stagger animation for lists */
.suggestion-card:nth-child(1) { animation-delay: 0.05s; }
.suggestion-card:nth-child(2) { animation-delay: 0.10s; }
.suggestion-card:nth-child(3) { animation-delay: 0.15s; }
.suggestion-card:nth-child(4) { animation-delay: 0.20s; }
.suggestion-card:nth-child(5) { animation-delay: 0.25s; }

.product-item:nth-child(1) { animation-delay: 0.05s; }
.product-item:nth-child(2) { animation-delay: 0.08s; }
.product-item:nth-child(3) { animation-delay: 0.11s; }
.product-item:nth-child(4) { animation-delay: 0.14s; }
.product-item:nth-child(5) { animation-delay: 0.17s; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg,
    var(--glass-2) 25%,
    var(--glass-3) 50%,
    var(--glass-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}

/* ================================================================
   16. UTILITIES
   ================================================================ */
.text-gold    { color: var(--gold-400); }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: var(--text-sm); }
.text-xs      { font-size: var(--text-xs); }
.fw-bold      { font-weight: 700; }
.fw-semibold  { font-weight: 600; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ── Responsive: Tablet/Desktop ──────────────────────────────── */
@media (min-width: 600px) {
  :root { --max-w: 600px; }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .prc-fields { grid-template-columns: repeat(4, 1fr); }
  .filter-bar { flex-wrap: nowrap; }
}
@media (min-width: 900px) {
  :root { --max-w: 780px; --nav-h: 0px; --header-h: 72px; }
  .bottom-nav { display: none; }
  .main-content { padding-top: calc(var(--header-h) + var(--sp-8)); padding-bottom: var(--sp-10); }
  /* Side nav could be added here in a future iteration */
}
