/* ═══════════════════════════════════════════════════════════
   FACTORY OS — Industrial Utilitarian Design System
   Palette: Volcanic Glass + Steel
   Fonts: Syne (display) + Space Mono (data) + Outfit (body)
═══════════════════════════════════════════════════════════ */

:root {
  /* Core Colors */
  --bg-base:       #0F1923;
  --bg-surface:    #162030;
  --bg-card:       #1C2A3A;
  --bg-elevated:   #243447;
  --bg-input:      #1A2535;

  /* Accent */
  --accent-orange: #FF6B2B;
  --accent-amber:  #FFB088;
  --accent-blue:   #3B82F6;
  --accent-teal:   #0EA5E9;

  /* Status */
  --status-critical: #EF4444;
  --status-warning:  #F59E0B;
  --status-healthy:  #22C55E;
  --status-ok:       #22C55E;
  --status-low:      #F59E0B;
  --status-out:      #EF4444;

  /* Text */
  --text-primary:   #E8EDF2;
  --text-secondary: #8FA3B8;
  --text-muted:     #4A6070;
  --text-accent:    #FF6B2B;

  /* Borders */
  --border:         #243447;
  --border-bright:  #2E4055;

  /* Spacing */
  --header-h:  56px;
  --bottom-h:  64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-card: 0 2px 12px rgba(0,0,0,0.4);
  --shadow-fab:  0 4px 20px rgba(255,107,43,0.4);
}

/* ─── 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: 'Outfit', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--header-h);
  padding-bottom: var(--bottom-h);
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

/* ═══════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════ */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-left { display: flex; align-items: center; gap: 12px; }

.menu-btn {
  width: 36px; height: 36px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.menu-btn:active { background: var(--bg-elevated); }
.menu-btn span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s;
}

.header-brand {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}
.brand-icon { font-size: 1.2rem; }
.brand-accent { color: var(--accent-orange); }

.header-right { display: flex; align-items: center; gap: 12px; }

.alert-badge {
  display: flex; align-items: center; gap: 4px;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-family: 'Space Mono', monospace;
  color: var(--status-critical);
  transition: all 0.3s;
}
.alert-badge.hidden { opacity: 0; pointer-events: none; }

.header-date {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.3;
}

/* ═══════════════════════════════════════════════
   SIDE DRAWER
═══════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(2px);
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }

.side-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}
.side-drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}
.drawer-brand { display: flex; align-items: center; gap: 10px; }
.drawer-brand-icon { font-size: 1.8rem; }
.drawer-brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}
.drawer-brand-sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.drawer-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.drawer-close:hover { background: var(--bg-elevated); color: var(--text-primary); }

.drawer-nav {
  flex: 1; overflow-y: auto;
  padding: 12px 8px;
  display: flex; flex-direction: column; gap: 2px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
  text-align: left;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
  background: rgba(255,107,43,0.12);
  color: var(--accent-orange);
  border-left: 3px solid var(--accent-orange);
}
.nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.nav-label { flex: 1; }
.nav-badge {
  background: var(--status-critical);
  color: white;
  font-size: 0.65rem;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.nav-badge:empty { display: none; }

.drawer-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.drawer-footer-text { font-size: 0.75rem; color: var(--text-muted); font-family: 'Space Mono', monospace; }
.drawer-footer-sub { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════ */
.app-main {
  min-height: calc(100vh - var(--header-h) - var(--bottom-h));
  position: relative;
}

.screen {
  display: none;
  padding: 16px;
  animation: screenIn 0.25s ease;
}
.screen.active { display: block; }

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

.screen-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.screen-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.screen-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: 'Space Mono', monospace;
}

/* ═══════════════════════════════════════════════
   KPI GRID
═══════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.kpi-total::before   { background: var(--accent-blue); }
.kpi-critical::before { background: var(--status-critical); }
.kpi-warning::before  { background: var(--status-warning); }
.kpi-healthy::before  { background: var(--status-healthy); }

.kpi-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Space Mono', monospace;
  margin-bottom: 6px;
}
.kpi-value {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
  color: var(--text-primary);
}
.kpi-critical .kpi-value { color: var(--status-critical); }
.kpi-warning  .kpi-value { color: var(--status-warning); }
.kpi-healthy  .kpi-value { color: var(--status-healthy); }

/* ═══════════════════════════════════════════════
   ALERTS BANNER
═══════════════════════════════════════════════ */
.alerts-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.alerts-banner.hidden { display: none; }
.alerts-banner-icon { font-size: 1.2rem; }
.alerts-banner-text { flex: 1; font-size: 0.85rem; color: var(--text-secondary); }
.alerts-banner-text strong { color: var(--status-critical); }
.alerts-banner-btn {
  font-size: 0.8rem;
  color: var(--accent-orange);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,107,43,0.1);
  transition: background 0.2s;
}
.alerts-banner-btn:active { background: rgba(255,107,43,0.2); }

/* ═══════════════════════════════════════════════
   SECTION CARDS
═══════════════════════════════════════════════ */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.section-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.section-card-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}
.section-card-action {
  font-size: 0.8rem;
  color: var(--accent-orange);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,107,43,0.1);
  transition: background 0.2s;
}
.section-card-action:active { background: rgba(255,107,43,0.2); }

/* ═══════════════════════════════════════════════
   STOCK TABLE
═══════════════════════════════════════════════ */
.stock-table-wrap { overflow-x: auto; }
.stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.stock-table th {
  padding: 8px 12px;
  text-align: left;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  white-space: nowrap;
}
.stock-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.stock-table tr:last-child td { border-bottom: none; }
.stock-table tr:active td { background: var(--bg-elevated); }
.stock-table .item-name { color: var(--text-primary); font-weight: 500; }
.stock-table .stock-val {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   STATUS BADGES
═══════════════════════════════════════════════ */
.status-badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.status-badge.CRITICAL, .status-badge.OUT {
  background: rgba(239,68,68,0.15);
  color: var(--status-critical);
  border: 1px solid rgba(239,68,68,0.3);
}
.status-badge.WARNING, .status-badge.LOW {
  background: rgba(245,158,11,0.15);
  color: var(--status-warning);
  border: 1px solid rgba(245,158,11,0.3);
}
.status-badge.HEALTHY, .status-badge.OK {
  background: rgba(34,197,94,0.12);
  color: var(--status-healthy);
  border: 1px solid rgba(34,197,94,0.25);
}
.status-badge.PENDING {
  background: rgba(59,130,246,0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(59,130,246,0.25);
}
.status-badge.IN-PROGRESS, .status-badge.IN\ PROGRESS {
  background: rgba(255,107,43,0.12);
  color: var(--accent-orange);
  border: 1px solid rgba(255,107,43,0.25);
}
.status-badge.COMPLETED {
  background: rgba(34,197,94,0.12);
  color: var(--status-healthy);
  border: 1px solid rgba(34,197,94,0.25);
}
.status-badge.Pending {
  background: rgba(245,158,11,0.12);
  color: var(--status-warning);
  border: 1px solid rgba(245,158,11,0.25);
}
.status-badge.Received {
  background: rgba(34,197,94,0.12);
  color: var(--status-healthy);
  border: 1px solid rgba(34,197,94,0.25);
}
.status-badge.Partial {
  background: rgba(14,165,233,0.12);
  color: var(--accent-teal);
  border: 1px solid rgba(14,165,233,0.25);
}

/* ═══════════════════════════════════════════════
   PRODUCTION LIST (Dashboard)
═══════════════════════════════════════════════ */
.prod-list { padding: 8px 0; }
.prod-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.prod-item:last-child { border-bottom: none; }
.prod-item:active { background: var(--bg-elevated); }
.prod-item-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.prod-item-dot.PENDING      { background: var(--accent-blue); }
.prod-item-dot.IN-PROGRESS  { background: var(--accent-orange); }
.prod-item-dot.COMPLETED    { background: var(--status-healthy); }
.prod-item-info { flex: 1; min-width: 0; }
.prod-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prod-item-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  margin-top: 2px;
}
.prod-item-right { text-align: right; flex-shrink: 0; }

/* ═══════════════════════════════════════════════
   SEARCH & FILTER BAR
═══════════════════════════════════════════════ */
.search-filter-bar {
  display: flex; gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.search-wrap {
  flex: 1; min-width: 160px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
}
.search-icon { font-size: 0.9rem; color: var(--text-muted); }
.search-input {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  padding: 10px 0;
}
.search-input::placeholder { color: var(--text-muted); }

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 8px 10px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.filter-select:focus { border-color: var(--accent-orange); }

/* ═══════════════════════════════════════════════
   INVENTORY LIST
═══════════════════════════════════════════════ */
.inventory-list { display: flex; flex-direction: column; gap: 8px; }

.inv-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.inv-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.inv-card.CRITICAL::before { background: var(--status-critical); }
.inv-card.WARNING::before  { background: var(--status-warning); }
.inv-card.HEALTHY::before  { background: var(--status-healthy); }
.inv-card:active { background: var(--bg-elevated); }

.inv-card-info { flex: 1; min-width: 0; }
.inv-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inv-card-meta {
  display: flex; gap: 8px; align-items: center;
  margin-top: 4px;
  flex-wrap: wrap;
}
.inv-card-type {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 3px;
}
.inv-card-unit {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
}

.inv-card-right { text-align: right; flex-shrink: 0; }
.inv-card-stock {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text-primary);
  line-height: 1;
}
.inv-card-min {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  margin-top: 2px;
}

.inv-card-actions {
  display: flex; gap: 6px;
  margin-top: 8px;
}
.inv-action-btn {
  flex: 1;
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s;
}
.inv-action-edit {
  background: rgba(59,130,246,0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(59,130,246,0.2);
}
.inv-action-delete {
  background: rgba(239,68,68,0.1);
  color: var(--status-critical);
  border: 1px solid rgba(239,68,68,0.2);
}

/* ═══════════════════════════════════════════════
   ENTRY FORM
═══════════════════════════════════════════════ */
.entry-tabs {
  display: flex; gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.entry-tab {
  flex: 1; min-width: 70px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.2s;
  text-align: center;
}
.entry-tab.active {
  background: var(--accent-orange);
  color: white;
}

.entry-panel { display: none; }
.entry-panel.active { display: block; }

.entry-section-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-orange);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(255,107,43,0.08);
  border-left: 3px solid var(--accent-orange);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.form-group { margin-bottom: 14px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.req { color: var(--accent-orange); }

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus { border-color: var(--accent-orange); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }

.status-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.closing-preview {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.closing-preview strong {
  font-family: 'Space Mono', monospace;
  font-size: 1rem;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent-orange);
  color: white;
  border-radius: var(--radius-md);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(255,107,43,0.3);
}
.btn-primary:active { transform: scale(0.98); opacity: 0.9; }

.btn-secondary {
  padding: 12px 20px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.btn-secondary:active { background: var(--bg-card); }

/* ═══════════════════════════════════════════════
   PRODUCTION CARDS
═══════════════════════════════════════════════ */
.prod-cards { display: flex; flex-direction: column; gap: 10px; }

.prod-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.prod-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.prod-card.PENDING::before      { background: var(--accent-blue); }
.prod-card.IN-PROGRESS::before  { background: var(--accent-orange); }
.prod-card.COMPLETED::before    { background: var(--status-healthy); }

.prod-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px;
}
.prod-card-product {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}
.prod-card-process {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  margin-top: 2px;
}
.prod-card-meta {
  display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.prod-card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
}
.prod-card-batches {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: 'Space Mono', monospace;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 3px;
}
.prod-card-notes {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}
.prod-card-actions {
  display: flex; gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════
   RAW MATERIAL LIST
═══════════════════════════════════════════════ */
.rm-list { display: flex; flex-direction: column; gap: 10px; }

.rm-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.rm-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.rm-card-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.rm-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.rm-stat {
  text-align: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
}
.rm-stat-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.rm-stat-value {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.rm-stat.closing .rm-stat-value { color: var(--accent-orange); }

/* ═══════════════════════════════════════════════
   VENDOR LIST
═══════════════════════════════════════════════ */
.vendor-list { display: flex; flex-direction: column; gap: 10px; }

.vendor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.vendor-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px;
}
.vendor-card-vendor {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.vendor-card-process {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  margin-top: 2px;
}
.vendor-card-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
}
.vendor-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.vendor-stat {
  text-align: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
}
.vendor-stat-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.vendor-stat-value {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.vendor-stat.pending .vendor-stat-value { color: var(--status-warning); }

/* ═══════════════════════════════════════════════
   ALERTS SCREEN
═══════════════════════════════════════════════ */
.alerts-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}
.alert-summary-card.critical { border-color: rgba(239,68,68,0.3); }
.alert-summary-card.warning  { border-color: rgba(245,158,11,0.3); }
.alert-summary-count {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
}
.alert-summary-card.critical .alert-summary-count { color: var(--status-critical); }
.alert-summary-card.warning  .alert-summary-count { color: var(--status-warning); }
.alert-summary-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.alerts-list { display: flex; flex-direction: column; gap: 8px; }

.alert-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  position: relative;
  overflow: hidden;
}
.alert-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.alert-item.CRITICAL::before { background: var(--status-critical); }
.alert-item.WARNING::before  { background: var(--status-warning); }

.alert-item-icon { font-size: 1.3rem; flex-shrink: 0; }
.alert-item-info { flex: 1; min-width: 0; }
.alert-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.alert-item-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  margin-top: 3px;
}
.alert-item-right { flex-shrink: 0; }

/* ═══════════════════════════════════════════════
   BOTTOM NAV
═══════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-h);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  z-index: 100;
  padding: 0 4px;
  backdrop-filter: blur(10px);
}

.bottom-nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.2s;
  position: relative;
}
.bottom-nav-item.active { color: var(--accent-orange); }
.bottom-nav-icon { font-size: 1.2rem; line-height: 1; }
.bottom-nav-label { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.03em; }

.bottom-nav-center {
  flex: 0 0 56px;
  margin: 0 8px;
}
.bottom-nav-icon-center {
  width: 48px; height: 48px;
  background: var(--accent-orange);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  color: white;
  font-weight: 300;
  box-shadow: var(--shadow-fab);
  transition: transform 0.2s;
}
.bottom-nav-center:active .bottom-nav-icon-center { transform: scale(0.92); }

.bottom-nav-badge {
  position: absolute;
  top: 4px; right: calc(50% - 18px);
  background: var(--status-critical);
  color: white;
  font-size: 0.6rem;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}
.bottom-nav-badge:empty { display: none; }

/* ═══════════════════════════════════════════════
   FAB
═══════════════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-h) + 16px);
  right: 20px;
  width: 52px; height: 52px;
  background: var(--accent-orange);
  color: white;
  border-radius: 50%;
  font-size: 1.6rem;
  font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-fab);
  z-index: 90;
  transition: transform 0.2s;
}
.fab:active { transform: scale(0.92); }

/* ═══════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-h) + 16px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: rgba(34,197,94,0.4); color: var(--status-healthy); }
.toast.error   { border-color: rgba(239,68,68,0.4); color: var(--status-critical); }

/* ═══════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 400;
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  width: 100%;
  background: var(--bg-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--border);
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg-surface);
  z-index: 1;
}
.modal-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--bg-elevated); }

.modal-body { padding: 20px; }
.modal-footer {
  display: flex; gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  position: sticky; bottom: 0;
  background: var(--bg-surface);
}
.modal-footer .btn-primary { flex: 2; }
.modal-footer .btn-secondary { flex: 1; }

/* ═══════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state-text { font-size: 0.9rem; }

/* ═══════════════════════════════════════════════
   UTILITY
═══════════════════════════════════════════════ */
.hidden { display: none !important; }
.text-critical { color: var(--status-critical); }
.text-warning  { color: var(--status-warning); }
.text-healthy  { color: var(--status-healthy); }
.mono { font-family: 'Space Mono', monospace; }

/* Safe area for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body { padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom); height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
}