
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
  }

  .header {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #b71c1c, #d84315);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(183, 28, 28, 0.4);
  }
  .header h1 { font-size: 2rem; color: #fff; }
  .header p { color: #ffccbc; margin-top: 4px; font-size: 0.95rem; }

  .controls {
    display: flex; justify-content: center; gap: 14px;
    margin-bottom: 24px; flex-wrap: wrap;
  }
  .btn {
    padding: 12px 28px; font-size: 1rem; font-weight: 600;
    border: none; border-radius: 10px; cursor: pointer;
    transition: all 0.2s; display: flex; align-items: center; gap: 8px;
  }
  .btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
  .btn:active { transform: translateY(0); }
  .btn-next { background: #43a047; color: #fff; }
  .btn-next:disabled { background: #555; cursor: not-allowed; transform: none; }
  .btn-reset { background: #e65100; color: #fff; }
  .btn-settings { background: #1565c0; color: #fff; }

  /* ── DEMAND CURVE ── */
  .demand-panel {
    background: #16213e; border-radius: 14px; padding: 20px;
    border: 1px solid #0f3460; margin-bottom: 24px;
  }
  .demand-panel h2 {
    font-size: 1.1rem; margin-bottom: 6px; color: #ffab00;
    display: flex; align-items: center; gap: 8px;
  }
  .demand-phase {
    font-size: 0.9rem; color: #b0bec5; margin-bottom: 14px; min-height: 1.3em;
  }
  .demand-bars-wrap {
    display: flex; align-items: flex-end; gap: 2px; height: 56px;
    margin-bottom: 6px;
  }
  .demand-bar {
    flex: 1; min-width: 2px; border-radius: 2px 2px 0 0;
    transition: height 0.3s, background 0.3s, box-shadow 0.3s;
    position: relative;
  }
  .demand-bar.future { background: #1a2744; }
  .demand-bar.past { background: #2e7d32; }
  .demand-bar.current { background: #ffab00; box-shadow: 0 0 10px rgba(255,171,0,0.5); }
  .demand-bar.stock-out { background: #c62828; }
  .demand-labels {
    display: flex; justify-content: space-between;
    font-size: 0.7rem; color: #546e7a;
  }

  /* ── SETTINGS ── */
  .settings-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); z-index: 100;
    justify-content: center; align-items: center;
  }
  .settings-overlay.open { display: flex; }
  .settings-box {
    background: #16213e; border: 1px solid #0f3460;
    border-radius: 16px; padding: 28px; width: 520px;
    max-width: 95vw; max-height: 85vh; overflow-y: auto;
  }
  .settings-box h2 { color: #ffab00; margin-bottom: 18px; font-size: 1.2rem; }
  .settings-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  }
  .settings-grid label {
    font-size: 0.82rem; color: #90a4ae;
    display: flex; flex-direction: column; gap: 4px;
  }
  .settings-grid input {
    background: #1a1a2e; border: 1px solid #0f3460; color: #fff;
    padding: 8px 10px; border-radius: 6px; font-size: 0.95rem;
  }
  .settings-grid input:focus { outline: none; border-color: #ffab00; }
  .settings-section {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px;
    color: #ffab00; margin-top: 14px; margin-bottom: 6px;
    grid-column: 1 / -1; border-bottom: 1px solid #0f3460; padding-bottom: 4px;
  }
  .settings-actions {
    display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px;
  }
  .settings-actions .btn { padding: 10px 24px; font-size: 0.9rem; }
  .btn-save { background: #43a047; color: #fff; }
  .btn-cancel { background: #555; color: #fff; }

  /* ── KPI BAR ── */
  .kpi-bar {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px; margin-bottom: 24px;
  }
  .kpi-card {
    background: #16213e; border-radius: 12px; padding: 16px;
    text-align: center; border: 1px solid #0f3460;
    transition: border-color 0.3s, box-shadow 0.3s;
  }
  .kpi-card.flash { border-color: #ffab00; box-shadow: 0 0 12px rgba(255,171,0,0.3); }
  .kpi-label { font-size: 0.75rem; color: #90a4ae; text-transform: uppercase; letter-spacing: 1px; }
  .kpi-value { font-size: 1.6rem; font-weight: 700; margin-top: 4px; color: #fff; }
  .kpi-value.money { color: #66bb6a; }
  .kpi-value.bad { color: #ef5350; }
  .kpi-value.phase { font-size: 1.1rem; }

  /* ── MAIN GRID ── */
  .main-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px; margin-bottom: 24px;
  }
  @media (max-width: 900px) { .main-grid { grid-template-columns: 1fr; } }

  .panel {
    background: #16213e; border-radius: 14px; padding: 20px;
    border: 1px solid #0f3460;
  }
  .panel h2 {
    font-size: 1.1rem; margin-bottom: 16px; color: #ffab00;
    display: flex; align-items: center; gap: 8px;
  }

  .inv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  @media (max-width: 600px) { .inv-grid { grid-template-columns: 1fr; } }
  .inv-item { background: #1a1a2e; border-radius: 8px; padding: 10px 12px; }
  .inv-item-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.85rem; }
  .inv-item-name { font-weight: 600; }
  .inv-item-qty { color: #90a4ae; }
  .inv-bar { height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
  .inv-bar-fill {
    height: 100%; border-radius: 3px;
    transition: width 0.5s ease, background 0.5s ease;
  }
  .inv-bar-fill.good { background: linear-gradient(90deg, #43a047, #66bb6a); }
  .inv-bar-fill.mid  { background: linear-gradient(90deg, #f9a825, #ffcc02); }
  .inv-bar-fill.low  { background: linear-gradient(90deg, #e53935, #ff7043); }

  .menu-grid { display: flex; flex-wrap: wrap; gap: 8px; }
  .menu-tag {
    padding: 6px 14px; border-radius: 20px; font-size: 0.82rem;
    font-weight: 600; transition: all 0.3s;
  }
  .menu-tag.available { background: #1b5e20; color: #a5d6a7; }
  .menu-tag.sold-out  { background: #4a1010; color: #ef9a9a; text-decoration: line-through; }

  .orders-list { max-height: 340px; overflow-y: auto; }
  .order-entry {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 12px; background: #1a1a2e; border-radius: 8px;
    margin-bottom: 6px; font-size: 0.9rem; animation: fadeIn 0.3s ease;
  }
  @keyframes fadeIn { from { opacity:0; transform:translateX(-10px); } to { opacity:1; transform:translateX(0); } }
  .order-items { display: flex; gap: 8px; flex-wrap: wrap; }
  .order-items span { background: #0f3460; padding: 3px 10px; border-radius: 12px; font-size: 0.8rem; }
  .order-price { font-weight: 700; color: #66bb6a; white-space: nowrap; }

  .history-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
  .history-table th {
    text-align: left; padding: 8px 10px;
    border-bottom: 2px solid #0f3460; color: #90a4ae;
    font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
  }
  .history-table td { padding: 7px 10px; border-bottom: 1px solid #0d2137; }
  .history-table tr:last-child td { border-bottom: none; }
  .history-table tbody tr { animation: fadeIn 0.3s ease; }
  .history-scroll { max-height: 260px; overflow-y: auto; }

  /* ── BANNERS ── */
  .banner {
    display: none; text-align: center; padding: 20px;
    border-radius: 12px; margin-bottom: 20px;
    font-size: 1.1rem; font-weight: 700; animation: fadeIn 0.5s ease;
  }
  .banner.stock-out { background: linear-gradient(135deg, #b71c1c, #880e4f); }
  .banner.day-over { background: linear-gradient(135deg, #1b5e20, #004d40); }
  .banner-stats {
    display: flex; justify-content: center; gap: 30px;
    margin-top: 12px; font-weight: 400; font-size: 0.95rem; flex-wrap: wrap;
  }
  .banner-stat { text-align: center; }
  .banner-stat-value { font-size: 1.4rem; font-weight: 700; display: block; }

  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: #0f3460; border-radius: 3px; }
