/* ==========================================================================
   Mama Lydia's Bites - Smart Food Costing & Profit Calculator
   Design System & Responsive Stylesheet
   ========================================================================== */

:root {
  --brand-burgundy-dark: #50070e;
  --brand-burgundy: #6b1119;
  --brand-burgundy-light: #8b1e22;
  --brand-gold: #f7a81b;
  --brand-gold-hover: #e59500;
  --brand-gold-light: #fef5e7;
  --brand-cream: #fdf8f2;
  --brand-cream-dark: #f5ebe0;
  --brand-charcoal: #1f1a17;
  --brand-muted: #6b635b;
  --brand-border: #e8ded4;
  --brand-white: #ffffff;
  --brand-success: #15803d;
  --brand-success-light: #dcfce7;
  --brand-danger: #b91c1c;
  --brand-danger-light: #fee2e2;
  --brand-warning: #b45309;
  --brand-warning-light: #fef3c7;
  --brand-info: #0369a1;
  --brand-info-light: #e0f2fe;

  --shadow-sm: 0 1px 2px 0 rgba(31, 26, 23, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(31, 26, 23, 0.07), 0 2px 4px -2px rgba(31, 26, 23, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(31, 26, 23, 0.08), 0 4px 6px -4px rgba(31, 26, 23, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(31, 26, 23, 0.1), 0 8px 10px -6px rgba(31, 26, 23, 0.06);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--brand-cream);
  color: var(--brand-charcoal);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   NAVIGATION & HEADER
   ========================================================================== */
.navbar {
  background: var(--brand-burgundy);
  color: var(--brand-white);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border-bottom: 3px solid var(--brand-gold);
}

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

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo-img {
  width: 52px;
  height: auto;
  max-height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: transform 0.2s ease;
}

.brand-logo-img:hover {
  transform: scale(1.05);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--brand-white);
  line-height: 1.15;
}

.brand-text .tagline {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--brand-gold);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--brand-white);
}

.nav-link.highlight {
  background: var(--brand-gold);
  color: var(--brand-charcoal);
  font-weight: 700;
}

.nav-link.highlight:hover {
  background: var(--brand-gold-hover);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--brand-white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* ==========================================================================
   LAYOUT & CONTAINERS
   ========================================================================== */
.main-content {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Page Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, var(--brand-burgundy) 0%, var(--brand-burgundy-dark) 100%);
  color: var(--brand-white);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  border-left: 6px solid var(--brand-gold);
}

.hero-banner::after {
  content: '';
  position: absolute;
  right: -20px;
  bottom: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(247, 168, 27, 0.15) 0%, rgba(247, 168, 27, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-content h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.hero-content p {
  color: var(--brand-cream);
  font-size: 1rem;
  opacity: 0.95;
  margin-bottom: 1.25rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 44px;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand-gold);
  color: var(--brand-charcoal);
  border-color: var(--brand-gold-hover);
  box-shadow: 0 2px 4px rgba(247, 168, 27, 0.25);
}

.btn-primary:hover {
  background: var(--brand-gold-hover);
  box-shadow: 0 4px 8px rgba(247, 168, 27, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: var(--brand-white);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-burgundy {
  background: var(--brand-burgundy);
  color: var(--brand-white);
}

.btn-burgundy:hover {
  background: var(--brand-burgundy-light);
}

.btn-outline {
  background: var(--brand-white);
  color: var(--brand-charcoal);
  border-color: var(--brand-border);
}

.btn-outline:hover {
  background: var(--brand-cream-dark);
  border-color: var(--brand-muted);
}

.btn-danger {
  background: var(--brand-danger);
  color: var(--brand-white);
}

.btn-danger:hover {
  background: #991b1b;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  min-height: 36px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   STATISTICS CARDS
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--brand-white);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.burgundy {
  background: #fdf2f2;
  color: var(--brand-burgundy);
}

.stat-icon.gold {
  background: var(--brand-gold-light);
  color: var(--brand-gold-hover);
}

.stat-icon.green {
  background: var(--brand-success-light);
  color: var(--brand-success);
}

.stat-icon.blue {
  background: var(--brand-info-light);
  color: var(--brand-info);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

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

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-charcoal);
  line-height: 1.2;
}

.stat-subtext {
  font-size: 0.78rem;
  color: var(--brand-muted);
  margin-top: 0.2rem;
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card {
  background: var(--brand-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--brand-border);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-charcoal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   SMART COST ALERTS
   ========================================================================== */
.alerts-section {
  margin-bottom: 2rem;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  border-left: 5px solid;
  background: var(--brand-white);
  box-shadow: var(--shadow-sm);
}

.alert-item.danger {
  border-left-color: var(--brand-danger);
  background: #fff8f8;
}

.alert-item.warning {
  border-left-color: var(--brand-warning);
  background: #fffdf5;
}

.alert-item.info {
  border-left-color: var(--brand-info);
  background: #f8fbfe;
}

.alert-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-top: 0.15rem;
}

.alert-item.danger .alert-icon { color: var(--brand-danger); }
.alert-item.warning .alert-icon { color: var(--brand-warning); }
.alert-item.info .alert-icon { color: var(--brand-info); }

.alert-body {
  flex: 1;
}

.alert-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.alert-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.alert-item.danger .alert-badge { background: var(--brand-danger-light); color: var(--brand-danger); }
.alert-item.warning .alert-badge { background: var(--brand-warning-light); color: var(--brand-warning); }
.alert-item.info .alert-badge { background: var(--brand-info-light); color: var(--brand-info); }

.alert-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--brand-charcoal);
}

.alert-msg {
  font-size: 0.86rem;
  color: var(--brand-muted);
}

/* ==========================================================================
   CATEGORY PILLS & CATALOG STATS
   ========================================================================== */
.category-pills-wrapper {
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
}

.category-pills {
  display: flex;
  gap: 0.5rem;
  white-space: nowrap;
  min-width: max-content;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.05rem;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 9999px;
  border: 1px solid var(--brand-border);
  background: var(--brand-white);
  color: var(--brand-charcoal);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.category-pill:hover {
  border-color: var(--brand-gold);
  background: #FFF9EE;
  color: var(--brand-burgundy);
  transform: translateY(-1px);
}

.category-pill.active {
  background: var(--brand-burgundy);
  color: var(--brand-white);
  border-color: var(--brand-burgundy);
  box-shadow: 0 4px 10px rgba(114, 20, 34, 0.25);
}

.category-pill .pill-icon {
  color: var(--brand-gold);
}

.category-pill.active .pill-icon {
  color: var(--brand-gold);
}

.category-pill .pill-count {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  font-weight: 800;
}

.category-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.2);
  color: var(--brand-white);
}

/* Catalog Summary Stats Bar */
.catalog-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--brand-white);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}

.catalog-stats-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.catalog-stat-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--brand-muted);
}

.catalog-stat-item strong {
  color: var(--brand-charcoal);
  font-weight: 800;
}

/* Print Header & Logo (Never show on regular screen) */
.print-header {
  display: none !important;
}

.print-logo {
  max-width: 80px;
  height: auto;
}

.print-sheet-container {
  background: transparent;
}

.product-badge-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: #FFF8EC;
  border: 2px solid var(--brand-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--brand-burgundy);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

/* ==========================================================================
   PRODUCT CARDS GRID
   ========================================================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--brand-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--brand-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.product-card-img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: linear-gradient(135deg, #FFFBF5 0%, #FFF4E5 100%);
  padding: 10px;
  display: block;
  border-bottom: 1px solid var(--brand-border);
  transition: transform 0.2s ease;
}

.product-card-img.has-photo {
  object-fit: cover;
  padding: 0;
}

.product-card:hover .product-card-img {
  transform: scale(1.02);
}

.product-card-placeholder {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, #FAF2E6 0%, #F5EBE0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--brand-burgundy);
}

.product-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-burgundy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.product-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--brand-charcoal);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.product-costing-breakdown {
  background: var(--brand-cream);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  border: 1px solid var(--brand-border);
}

.cost-row {
  display: flex;
  flex-direction: column;
}

.cost-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand-muted);
  text-transform: uppercase;
}

.cost-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-charcoal);
}

.cost-val.profit {
  color: var(--brand-success);
}

.margin-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.margin-pill.high {
  background: var(--brand-success-light);
  color: var(--brand-success);
}

.margin-pill.medium {
  background: var(--brand-warning-light);
  color: var(--brand-warning);
}

.margin-pill.low {
  background: var(--brand-danger-light);
  color: var(--brand-danger);
}

.product-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--brand-border);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-charcoal);
  margin-bottom: 0.4rem;
}

.form-label .helper {
  font-weight: 400;
  color: var(--brand-muted);
  font-size: 0.8rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--brand-charcoal);
  background-color: var(--brand-white);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 44px;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-burgundy);
  box-shadow: 0 0 0 3px rgba(107, 17, 25, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.input-with-symbol {
  position: relative;
  display: flex;
  align-items: center;
}

.input-symbol-prefix {
  position: absolute;
  left: 0.9rem;
  font-weight: 700;
  color: var(--brand-muted);
  pointer-events: none;
}

.input-with-symbol .form-control {
  padding-left: 2rem;
}

/* ==========================================================================
   DYNAMIC INGREDIENT RECIPE BUILDER
   ========================================================================== */
.ingredient-rows-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.ingredient-row {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr 1.2fr 44px;
  gap: 0.5rem;
  align-items: center;
  background: var(--brand-cream);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-border);
  transition: background 0.15s ease;
}

.ingredient-row:hover {
  background: #f7ede2;
}

.line-cost-display {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand-charcoal);
  text-align: right;
  padding-right: 0.5rem;
}

.btn-remove-row {
  background: #fee2e2;
  color: var(--brand-danger);
  border: none;
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-remove-row:hover {
  background: var(--brand-danger);
  color: var(--brand-white);
}

/* ==========================================================================
   DYNAMIC DIRECT COSTS BUILDER (PACKAGING & OTHER OVERHEADS)
   ========================================================================== */
.direct-cost-rows-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.direct-cost-row {
  display: grid;
  grid-template-columns: 140px 1fr 130px 44px;
  gap: 0.5rem;
  align-items: center;
  background: var(--brand-cream);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-border);
  transition: background 0.15s ease;
}

.direct-cost-row:hover {
  background: #f7ede2;
}

.btn-remove-direct-cost {
  background: #fee2e2;
  color: var(--brand-danger);
  border: none;
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-remove-direct-cost:hover {
  background: var(--brand-danger);
  color: var(--brand-white);
}


/* ==========================================================================
   LIVE COSTING SIDEBAR / SUMMARY CARD
   ========================================================================== */
.costing-summary-card {
  background: var(--brand-white);
  border-radius: var(--radius-lg);
  border: 2px solid var(--brand-burgundy);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  position: sticky;
  top: 90px;
}

.costing-summary-header {
  border-bottom: 2px solid var(--brand-cream-dark);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.costing-summary-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--brand-burgundy);
}

.costing-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--brand-border);
}

.costing-metric-row.highlight-total {
  border-top: 2px solid var(--brand-charcoal);
  border-bottom: 2px solid var(--brand-charcoal);
  margin: 0.5rem 0;
  padding: 0.75rem 0;
  font-size: 1.15rem;
  font-weight: 800;
  background: #fffcf8;
}

.costing-metric-row.profit-highlight {
  background: var(--brand-success-light);
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
  border-bottom: none;
}

.profit-label {
  font-weight: 800;
  color: var(--brand-success);
}

.profit-val {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--brand-success);
}

/* ==========================================================================
   TABLES (Ingredients, Scenarios, Break-even)
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-border);
  background: var(--brand-white);
}

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

.data-table th {
  background: #faf3e8;
  color: var(--brand-charcoal);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--brand-border);
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--brand-border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--brand-cream);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
  width: 90%;
  pointer-events: none;
}

.toast {
  background: var(--brand-charcoal);
  color: var(--brand-white);
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  border-left: 4px solid var(--brand-gold);
}

.toast.success { border-left-color: var(--brand-success); }
.toast.danger { border-left-color: var(--brand-danger); }

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

/* ==========================================================================
   EMPTY STATES
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--brand-white);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--brand-border);
  margin: 1.5rem 0;
}

.empty-state-icon {
  font-size: 3.5rem;
  color: var(--brand-gold);
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand-charcoal);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 0.95rem;
  color: var(--brand-muted);
  max-width: 480px;
  margin: 0 auto 1.5rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background: var(--brand-burgundy-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  border-top: 3px solid var(--brand-gold);
  margin-top: auto;
}

.footer .tagline {
  color: var(--brand-gold);
  font-weight: 600;
  margin-top: 0.25rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE-FIRST BREAKPOINTS)
   ========================================================================== */
@media (max-width: 900px) {
  .product-form-layout {
    display: flex;
    flex-direction: column;
  }

  .costing-summary-card {
    position: static;
    margin-top: 1.5rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--brand-burgundy-dark);
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  .nav-links.open {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }

  .nav-link {
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .ingredient-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .ingredient-row .form-control:first-child {
    grid-column: span 2;
  }

  .ingredient-row .line-cost-display {
    grid-column: span 1;
    text-align: left;
  }

  .ingredient-row .btn-remove-row {
    justify-self: end;
  }

  .direct-cost-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .direct-cost-row .direct-cost-type {
    grid-column: span 1;
  }

  .direct-cost-row .input-with-symbol {
    grid-column: span 1;
  }

  .direct-cost-row .direct-cost-name {
    grid-column: span 2;
  }

  .direct-cost-row .btn-remove-direct-cost {
    grid-column: span 2;
    justify-self: end;
  }
}

@media (max-width: 480px) {
  .hero-banner {
    padding: 1.25rem 1rem;
  }

  .hero-content h2 {
    font-size: 1.35rem;
  }

  .btn {
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .product-costing-breakdown {
    grid-template-columns: 1fr;
  }
}
