/* ==============================================================
   Crispy Crust Restaurant ERP Design System (Dark Modern Aesthetic)
   Colors: Dark #121214, Crispy Red #E11D2A, Cheddar Gold #F59E0B
   Typography: Cairo (RTL Arabic)
   ============================================================== */

:root {
  color-scheme: dark;
  --bg-main: #0e0e11;
  --bg-sidebar: #141418;
  --bg-card: #19191f;
  --bg-card-hover: #22222a;
  --bg-glass: rgba(25, 25, 31, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);

  --crispy-red: #e11d2a;
  --crispy-red-glow: rgba(225, 29, 42, 0.35);
  --cheddar-gold: #f59e0b;
  --cheddar-gold-glow: rgba(245, 158, 11, 0.35);
  --emerald-green: #10b981;
  --emerald-green-glow: rgba(16, 185, 129, 0.35);
  --sapphire-blue: #3b82f6;
  --sapphire-blue-glow: rgba(59, 130, 246, 0.35);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

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

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px rgba(225, 29, 42, 0.25);
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

/* Explicit Form Dropdown Contrast Styling */
select, input, textarea {
  color-scheme: dark;
}

select {
  background-color: #18181c !important;
  color: #ffffff !important;
  color-scheme: dark;
}

select option, select optgroup {
  background-color: #18181c !important;
  color: #f4f4f5 !important;
  padding: 10px;
  font-family: 'Cairo', sans-serif;
}

select option:checked, select option:hover {
  background-color: #E11D2A !important;
  color: #ffffff !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #2a2a35;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--crispy-red);
}

/* App Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.5rem 1.25rem;
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: #1c1c24;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  padding: 4px;
  border: 1px solid var(--border-subtle);
}

.brand-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand-info h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.badge-erp {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--cheddar-gold);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.25);
  margin-top: 2px;
}

.cloud-status-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.75rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald-green);
}

.pulse {
  animation: pulse-ring 2s infinite ease-out;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-label {
  font-size: 0.75rem;
  color: var(--emerald-green);
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

.nav-link i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  color: var(--text-dim);
  transition: var(--transition);
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.nav-link:hover i {
  color: var(--cheddar-gold);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(225, 29, 42, 0.18), rgba(225, 29, 42, 0.05));
  color: #fff;
  border-right: 3px solid var(--crispy-red);
}

.nav-link.active i {
  color: var(--crispy-red);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.store-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--cheddar-gold);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.08);
  transition: var(--transition);
}

.store-link:hover {
  background: rgba(245, 158, 11, 0.16);
}

.branch-tag {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: calc(100vw - 280px);
  background: radial-gradient(circle at top left, #1a1622 0%, var(--bg-main) 45%);
}

/* Top Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.header-title h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.25rem;
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--crispy-red), #b91522);
  color: #fff;
  box-shadow: 0 4px 14px var(--crispy-red-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 29, 42, 0.5);
}

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: rotate(45deg);
  animation: shine 4s infinite linear;
}

@keyframes shine {
  0% { transform: translateX(-100%) rotate(45deg); }
  25%, 100% { transform: translateX(100%) rotate(45deg); }
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, var(--emerald-green), #059669);
  color: #fff;
  box-shadow: 0 4px 14px var(--emerald-green-glow);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-danger {
  background: var(--crispy-red);
  color: #fff;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 29, 42, 0.5);
}

.btn-warning {
  background: linear-gradient(135deg, var(--cheddar-gold), #d97706);
  color: #1a0e05;
  box-shadow: 0 4px 14px var(--cheddar-gold-glow);
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

.btn-hero {
  background: linear-gradient(135deg, var(--cheddar-gold), #d97706);
  color: #1a0e05;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0.9rem 2rem;
  box-shadow: 0 6px 20px var(--cheddar-gold-glow);
}

.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(245, 158, 11, 0.6);
}

.w-full {
  width: 100%;
  justify-content: center;
}

/* Banner */
.sync-banner {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(225, 29, 42, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 600;
  color: #fff;
}

.banner-icon {
  color: var(--cheddar-gold);
  font-size: 1.2rem;
}

.banner-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

/* Tab panes */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  background-color: var(--bg-card-hover);
}

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

.kpi-icon-wrap.gold {
  background: rgba(245, 158, 11, 0.12);
  color: var(--cheddar-gold);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.kpi-icon-wrap.blue {
  background: rgba(59, 130, 246, 0.12);
  color: var(--sapphire-blue);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.kpi-icon-wrap.red {
  background: rgba(225, 29, 42, 0.12);
  color: var(--crispy-red);
  border: 1px solid rgba(225, 29, 42, 0.25);
}

.kpi-icon-wrap.green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-green);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.kpi-content {
  display: flex;
  flex-direction: column;
}

.kpi-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-val-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0.2rem 0;
}

.kpi-number {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.kpi-currency {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Sync Hero Card */
.sync-hero-card {
  background: linear-gradient(135deg, #1c1822 0%, #201a18 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.sync-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 100%;
  background: radial-gradient(circle, rgba(225, 29, 42, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cheddar-gold);
  background: rgba(245, 158, 11, 0.12);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

.sync-hero-info h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.4rem;
}

.sync-hero-info p {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 680px;
  line-height: 1.6;
}

/* Split Grid */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .dashboard-split-grid {
    grid-template-columns: 1fr;
  }
}

/* Panels */
.panel-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.panel-title h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.badge-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(225, 29, 42, 0.15);
  color: var(--crispy-red);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.panel-body {
  padding: 1.5rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

.table-container-compact {
  max-height: 290px;
  overflow-y: auto;
}

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

.data-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Progress bar inside table */
.progress-wrap {
  width: 110px;
  background-color: rgba(255, 255, 255, 0.06);
  height: 7px;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.progress-bar.healthy { background: var(--emerald-green); }
.progress-bar.warning { background: var(--cheddar-gold); }
.progress-bar.critical { background: var(--crispy-red); }

/* Badges */
.status-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.status-pill.success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-green);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-pill.warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--cheddar-gold);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-pill.danger {
  background: rgba(225, 29, 42, 0.12);
  color: var(--crispy-red);
  border: 1px solid rgba(225, 29, 42, 0.25);
}

.status-pill.category {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* Toolbar Card */
.toolbar-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.pill.active {
  background: var(--crispy-red);
  color: #fff;
  border-color: var(--crispy-red);
  box-shadow: 0 2px 10px var(--crispy-red-glow);
}

.pill-warning.active {
  background: var(--cheddar-gold);
  border-color: var(--cheddar-gold);
  color: #1a0e05;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.search-box input {
  font-family: inherit;
  font-size: 0.88rem;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  border-radius: var(--radius-md);
  width: 250px;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--crispy-red);
  background-color: rgba(255, 255, 255, 0.07);
}

/* Recipes BOM Grid */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.recipe-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.recipe-card:hover {
  transform: translateY(-4px);
  border-color: var(--cheddar-gold);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.recipe-card-header {
  padding: 1.25rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-subtle);
}

.recipe-id-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--cheddar-gold);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.recipe-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0.35rem;
}

.recipe-card-body {
  padding: 1.25rem 1.4rem;
  flex: 1;
}

.costing-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.costing-metric {
  display: flex;
  flex-direction: column;
}

.costing-metric .label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.costing-metric .val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.profit-progress-wrap {
  margin-top: 0.75rem;
}

.profit-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.recipe-card-footer {
  padding: 0.85rem 1.4rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.section-notice {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #93c5fd;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Fryer Cards Grid */
.fryers-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.fryer-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition);
}

.fryer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.fryer-card-header h4 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.fryer-gauge-box {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.fryer-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

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

/* Suppliers Cards Grid */
.suppliers-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.supplier-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.supplier-card h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.35rem;
}

.supplier-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.supplier-balance-box {
  background: rgba(225, 29, 42, 0.08);
  border: 1px solid rgba(225, 29, 42, 0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.supplier-balance-box .val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--crispy-red);
}

/* Waste & Reconcile */
.waste-reconcile-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .waste-reconcile-grid {
    grid-template-columns: 1fr;
  }
}

.erp-form .form-group {
  margin-bottom: 1rem;
}

.erp-form label, .modal-body label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--crispy-red);
  background-color: rgba(255, 255, 255, 0.08);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 1.5rem 0;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-dialog {
  background-color: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.modal-dialog.modal-lg {
  max-width: 820px;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* BOM Drawer / Modal */
.bom-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

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

.bom-stat .label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.bom-stat .val {
  font-size: 1.15rem;
  font-weight: 800;
}

.bom-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.add-ingredient-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.form-row-compact {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
}

/* PO Items Dynamic List */
.po-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.po-item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-right: 4px solid var(--emerald-green); }
.toast.error { border-right: 4px solid var(--crispy-red); }
.toast.info { border-right: 4px solid var(--sapphire-blue); }

/* Utility classes */
.text-gold { color: var(--cheddar-gold); }
.text-danger { color: var(--crispy-red); }
.text-success { color: var(--emerald-green); }
.text-info { color: var(--sapphire-blue); }
.text-warning { color: var(--cheddar-gold); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.font-bold { font-weight: 800; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.hidden { display: none !important; }

.modal-alert-box {
  background: rgba(225, 29, 42, 0.1);
  border: 1px solid rgba(225, 29, 42, 0.25);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: #fca5a5;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
