/* Modern Dark Glassmorphic Theme Design System */

:root {
  /* Colors */
  --bg-main: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 255, 255, 0.15);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-accent: #38bdf8;
  
  /* Category Colors */
  --color-protein: #06b6d4;      /* Teal/Cyan */
  --color-protein-rgb: 6, 182, 212;
  --color-starch: #f97316;       /* Sunset Orange/Amber */
  --color-starch-rgb: 249, 115, 22;
  --color-veggie: #10b981;       /* Emerald/Green */
  --color-veggie-rgb: 16, 185, 129;
  
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  
  /* Font Stacks */
  --font-family-body: 'Inter', sans-serif;
  --font-family-title: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(249, 115, 22, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Glassmorphism utility */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

/* Main Layout */
#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content-wrapper {
  flex-grow: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 100px 24px 100px 24px; /* Space for top and bottom bars */
}

/* Sticky Glass Header */
.glass-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 28px;
  color: var(--color-protein);
}

.logo-area h1 {
  font-family: var(--font-family-title);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.desktop-nav {
  display: flex;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  border-bottom: 2px solid var(--color-protein);
}

.user-status-badge {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid var(--color-protein);
  color: var(--color-protein);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
}

.user-status-badge.standard-dialysis {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid var(--color-starch);
  color: var(--color-starch);
}

/* Mobile Bottom Navigation Bar */
.mobile-nav {
  display: none; /* Desktop by default */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-glass);
  justify-content: space-around;
  padding: 8px 0;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10px;
  gap: 2px;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
  color: var(--color-protein);
}

/* Section Controls */
.view-section {
  display: none;
}

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

.section-header {
  margin-bottom: 24px;
}

.section-header h2 {
  font-family: var(--font-family-title);
  font-size: 28px;
  margin-bottom: 6px;
}

.section-header p {
  color: var(--text-muted);
}

/* DASHBOARD DESIGN */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.stat-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
}

.stat-card h3 {
  font-family: var(--font-family-title);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -12px;
  margin-bottom: 16px;
}

.icon-align {
  vertical-align: middle;
}

.clinic-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
}

.badge-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.clinic-stat-list {
  list-style: none;
}

.clinic-stat-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-glass);
  font-size: 14px;
}

.clinic-stat-list li:last-child {
  border-bottom: none;
}

.clinic-stat-list li .lbl {
  color: var(--text-muted);
}

.clinic-stat-list li .val {
  font-weight: 600;
}

/* Radial Gauge Styling */
.radial-gauge-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.radial-gauge {
  position: relative;
  width: 120px;
  height: 120px;
}

.radial-gauge svg {
  transform: rotate(-90deg);
}

.radial-gauge circle {
  fill: none;
  stroke-width: 8;
}

.radial-gauge circle.bg {
  stroke: rgba(255, 255, 255, 0.05);
}

.radial-gauge circle.meter {
  stroke: var(--color-protein);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.radial-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.radial-text .num {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-family-title);
}

.radial-text .lbl {
  font-size: 10px;
  color: var(--text-muted);
}

.protein-gap-details {
  display: flex;
  justify-content: space-around;
  font-size: 13px;
  margin-bottom: 16px;
}

.protein-adder {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.meals-available-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
}

.meals-count {
  font-family: var(--font-family-title);
  font-size: 64px;
  font-weight: 700;
  color: var(--color-veggie);
  line-height: 1;
}

.meals-lbl {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

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

.cat-pill {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.cat-protein {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--color-protein);
}

.cat-starch {
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: var(--color-starch);
}

.cat-veggie {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-veggie);
}

/* Quick Scan Bar */
.quick-scan-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.quick-scan-bar h4 {
  font-family: var(--font-family-title);
  font-size: 16px;
  margin-bottom: 4px;
}

.quick-scan-bar p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th, .data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-glass);
}

.data-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 500;
}

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

/* CUISINE GRID & PREP PLANS */
.cuisines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.cuisine-card {
  cursor: pointer;
}

.cuisine-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-protein);
}

.cuisine-card h3 {
  font-family: var(--font-family-title);
  font-size: 18px;
  margin-bottom: 8px;
}

.cuisine-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.cuisine-recipes-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12px;
  border-top: 1px dashed var(--border-glass);
  border-bottom: 1px dashed var(--border-glass);
  padding: 10px 0;
}

.preview-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preview-section strong {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preview-section span {
  color: var(--text-main);
  opacity: 0.9;
  line-height: 1.3;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cuisine-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
}

/* COOKING WIZARD */
.wizard-container {
  margin-top: 24px;
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 12px;
}

.wizard-header h3 {
  font-family: var(--font-family-title);
  font-size: 22px;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.stepper {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.step-indicator {
  flex-grow: 1;
  text-align: center;
  font-size: 11px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--text-muted);
}

.step-indicator.active {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--color-protein);
  color: var(--text-main);
  font-weight: 600;
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
}

.wizard-step h4 {
  font-family: var(--font-family-title);
  font-size: 18px;
  margin-bottom: 6px;
}

.step-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.scaling-control-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
}

.scaling-control-card label {
  font-size: 14px;
  font-weight: 500;
}

.yield-estimate-boxes {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.yield-box {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
}

.yield-box .title {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.yield-box .qty {
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

/* Checklist list */
.checklist-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border-glass);
  accent-color: var(--color-protein);
  margin-top: 2px;
  flex-shrink: 0;
}

.checklist-item.checked {
  opacity: 0.5;
  text-decoration: line-through;
  background: transparent;
}

.category-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-accent);
  letter-spacing: 0.5px;
  margin-top: 16px;
  margin-bottom: 8px;
}

/* Stepper Warnings */
.clinical-cooking-warning {
  display: flex;
  gap: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--color-warning);
  color: var(--text-main);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  align-items: center;
  margin-bottom: 16px;
}

.clinical-cooking-info {
  display: flex;
  gap: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--color-success);
  color: var(--text-main);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  align-items: center;
  margin-bottom: 16px;
}

/* Production forms */
.production-group-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.production-group-card h5 {
  font-size: 14px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 6px;
}

.production-row-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prod-input-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.prod-input-row label {
  font-size: 13px;
}

.form-select, .form-input, .production-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 13px;
  width: 100%;
}

.form-select:focus, .form-input:focus, .production-input:focus {
  outline: none;
  border-color: var(--color-protein);
}

.wizard-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  border-top: 1px solid var(--border-glass);
  padding-top: 16px;
}

/* FREEZER INVENTORY */
.inventory-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.search-filter-row {
  display: flex;
  gap: 6px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.bag-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.bag-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

.bag-card.protein::after { background: var(--color-protein); }
.bag-card.starch::after { background: var(--color-starch); }
.bag-card.veggie::after { background: var(--color-veggie); }

.bag-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.bag-card-header h4 {
  font-family: var(--font-family-title);
  font-size: 16px;
  font-weight: 600;
}

.cat-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.tag-protein {
  background: rgba(6, 182, 212, 0.15);
  color: var(--color-protein);
}

.tag-starch {
  background: rgba(249, 115, 22, 0.15);
  color: var(--color-starch);
}

.tag-veggie {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-veggie);
}

.bag-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.bag-status-qty {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}

.progress-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.protein .progress-bar-fill { background: var(--color-protein); }
.starch .progress-bar-fill { background: var(--color-starch); }
.veggie .progress-bar-fill { background: var(--color-veggie); }

.bag-actions-row {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  align-items: center;
  border-top: 1px solid var(--border-glass);
  padding-top: 12px;
}

.bag-cube-adjust {
  display: flex;
  align-items: center;
  gap: 10px;
}

.adjust-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.adjust-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-focus);
}

/* Spreadsheet Table styling */
.spreadsheet-container {
  padding: 0 !important; /* Reset glass-card padding to let table extend to edges */
  overflow-x: auto; /* Enable scroll on small screens */
  margin-bottom: 24px;
}

.spreadsheet-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  font-family: var(--font-family-body);
}

.spreadsheet-table th, .spreadsheet-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-glass);
  border-right: 1px solid var(--border-glass);
  vertical-align: middle;
}

.spreadsheet-table th:last-child, .spreadsheet-table td:last-child {
  border-right: none;
}

.spreadsheet-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  font-family: var(--font-family-title);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  user-select: none;
  border-bottom: 2px solid var(--border-glass);
}

.sortable-header {
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.sortable-header:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  vertical-align: middle;
  width: 12px;
}

.spreadsheet-row {
  transition: background 0.15s ease;
  position: relative;
}

.spreadsheet-row:hover {
  background: rgba(255, 255, 255, 0.02) !important;
}

/* Row-based Category Left Border Indicator */
.spreadsheet-row.protein td:first-child {
  border-left: 4px solid var(--color-protein);
}
.spreadsheet-row.starch td:first-child {
  border-left: 4px solid var(--color-starch);
}
.spreadsheet-row.veggie td:first-child {
  border-left: 4px solid var(--color-veggie);
}
.spreadsheet-table th:first-child {
  border-left: 4px solid transparent;
}

/* Category column pills inside spreadsheet */
.spreadsheet-row td .cat-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-align: center;
}

/* Quantity Adjuster inside Cell */
.qty-adjuster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-glass);
  width: fit-content;
  margin: 0 auto;
}

.qty-adjuster .qty-val {
  font-size: 13px;
  font-weight: 500;
  min-width: 45px;
  text-align: center;
}

.qty-adjuster .qty-val strong {
  font-size: 14px;
}

.qty-adjuster .adjust-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  width: 22px;
  height: 22px;
  border-radius: 4px; /* square-ish spreadsheet style */
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.qty-adjuster .adjust-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--border-focus);
}

/* Fill Level Cell */
.fill-level-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-container.mini {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.05);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  max-width: 120px;
}

.percent-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 35px;
}

.actions-cell {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.actions-cell .btn {
  padding: 4px 8px;
  font-size: 12px;
  height: 28px;
  width: 28px;
}

.actions-cell .btn span.material-symbols-outlined {
  font-size: 16px;
}

/* Text alignments */
.spreadsheet-table th.text-center, .spreadsheet-table td.text-center {
  text-align: center;
}

.spreadsheet-table th.text-right, .spreadsheet-table td.text-right {
  text-align: right;
}

/* Empty drawer */
.empty-bags-drawer-container {
  margin-top: 32px;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.arrow-icon {
  transition: transform 0.2s ease;
}

.drawer-header.open .arrow-icon {
  transform: rotate(180deg);
}

.drawer-content {
  margin-top: 16px;
  border-top: 1px solid var(--border-glass);
  padding-top: 16px;
}

/* MEAL ASSEMBLER */
.assembler-layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .assembler-layout {
    grid-template-columns: 1fr;
  }
}

.assembler-selection-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.assembler-slot {
  cursor: pointer;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.assembler-slot:hover {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.02);
}

.slot-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.slot-icon {
  font-size: 32px;
}

.slot-filled-state {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cube-counter-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-glass);
}

.btn-qty {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 600;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.qty-num {
  font-weight: 600;
  font-size: 14px;
  min-width: 16px;
  text-align: center;
}

.assembler-review-panel {
  display: flex;
  flex-direction: column;
}

.combo-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.combo-badge {
  background: var(--color-protein);
  color: var(--bg-main);
  font-family: var(--font-family-title);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
}

.progress-stats-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.stat-progress-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-progress-bar .lbl-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.bar {
  height: 100%;
  transition: width 0.3s ease, background 0.3s ease;
}

.bar-teal { background: var(--color-protein); }
.bar-red { background: var(--color-danger); }
.bar-amber { background: var(--color-warning); }
.bar-blue { background: #3b82f6; }
.bar-purple { background: #a855f7; }

.clinical-warnings-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.warning-item {
  display: flex;
  gap: 8px;
  font-size: 12px;
  padding: 10px;
  border-radius: 6px;
  align-items: center;
}

.warning-item.danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--color-danger);
  color: var(--text-main);
}

.warning-item.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--color-warning);
  color: var(--text-main);
}

.sevelamer-binder-alert {
  display: flex;
  gap: 10px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid var(--color-protein);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  align-items: center;
  margin-bottom: 20px;
}

/* SETTINGS & UTILITIES */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.settings-card h3 {
  font-family: var(--font-family-title);
  font-size: 18px;
  margin-bottom: 16px;
}

.settings-control-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.settings-info-text {
  font-size: 12px;
  line-height: 1.5;
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* QR SCANNER PAGE */
.scan-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 800px) {
  .scan-layout {
    grid-template-columns: 1fr;
  }
}

.camera-feed-box {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  min-height: 300px;
  margin: 16px 0;
  border: 1px solid var(--border-glass);
}

.camera-status-row {
  display: flex;
  justify-content: center;
}

.scan-bag-stats {
  display: flex;
  gap: 16px;
  margin: 16px 0;
}

.scan-bag-stats .val-box {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.scan-bag-stats .val-box .num {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-protein);
}

.scan-bag-stats .val-box .lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.scan-details-list {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.scan-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.scan-actions-grid #scan-mark-empty,
.scan-actions-grid #scan-print-label {
  grid-column: span 2;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-primary {
  background: var(--color-protein);
  color: var(--bg-main);
  border: 1px solid var(--color-protein);
}

.btn-primary:hover {
  background: #22d3ee;
}

.btn-success {
  background: var(--color-success);
  color: var(--bg-main);
  border: 1px solid var(--color-success);
}

.btn-success:hover {
  background: #34d399;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border: 1px solid var(--color-danger);
}

.btn-danger:hover {
  background: #f87171;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

.btn-outline:hover, .btn-outline.active-filter {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-focus);
}

.btn-outline.active-filter {
  border-color: var(--color-protein);
  color: var(--color-protein);
}

.btn-reset {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.w-full {
  width: 100%;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.modal-header h4 {
  font-family: var(--font-family-title);
  font-size: 18px;
}

.modal-body {
  flex-grow: 1;
  overflow-y: auto;
}

.scrollable {
  overflow-y: auto;
}

/* Modal Bags List */
.modal-bag-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}

.modal-bag-item:hover {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.02);
}

.modal-bag-item .title {
  font-size: 13px;
  font-weight: 600;
}

.modal-bag-item .date {
  font-size: 11px;
  color: var(--text-muted);
}

.modal-bag-item .qty {
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}

/* Helper Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-success { color: var(--color-success); }
.text-cyan { color: var(--color-protein); }
.text-orange { color: var(--color-starch); }
.text-green { color: var(--color-veggie); }

/* Responsive adjustments */
@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  .mobile-nav {
    display: flex;
  }
  .content-wrapper {
    padding-top: 80px;
    padding-bottom: 80px;
  }
}

/* ========================================== */
/* PRINT MEDIA SHEET RULES (2"x3" Labels)     */
/* ========================================== */

@media print {
  @page {
    size: 2in 1in;
    margin: 0;
  }

  body {
    background: #fff;
    color: #000;
    min-height: auto;
    margin: 0;
    padding: 0;
  }
  
  .no-print {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
  }
  
  /* Formatted for 1" x 2" thermal label rolls */
  .print-label {
    width: 2.0in;
    height: 1.0in;
    border: none;
    padding: 0.08in;
    margin: 0;
    box-sizing: border-box;
    page-break-inside: avoid;
    page-break-after: always;
    display: grid;
    grid-template-columns: 0.8in 1fr;
    gap: 0.08in;
    font-family: 'Inter', sans-serif;
    color: #000;
    background: #fff;
  }
  
  .print-label-qr {
    grid-column: 1;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .print-label-qr img {
    width: 0.8in !important;
    height: 0.8in !important;
  }
  
  .print-label-details {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 8pt;
    line-height: 1.1;
  }
  
  .print-label-title {
    font-size: 8pt;
    font-weight: 700;
    margin-bottom: 1pt;
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .print-label-type {
    font-size: 6.5pt;
    font-weight: 600;
    text-transform: uppercase;
    color: #333;
    margin-bottom: 2pt;
  }
  
  .print-label-qty {
    font-size: 8pt;
    font-weight: 700;
    margin-bottom: 1pt;
  }
  
  .print-label-date {
    font-size: 6.5pt;
    color: #444;
  }
}
