/* ============================================================
   Dessert ERP – Custom Component Styles
   (Tailwind CDN handles layout/utilities; this file handles
    custom components, DataTables RTL, SweetAlert2 RTL, etc.)
   ============================================================ */

/* ===== CSS Variables (kept for PHP inline styles & JS) ===== */
:root {
  --sidebar-w: 260px;
  --header-h: 64px;
  --sidebar-bg: #ffffff;
  --sidebar-text: #475569;
  --sidebar-hover: #f1f5f9;
  --sidebar-active: #6366f1;
  --sidebar-border: #e2e8f0;
  --body-bg: #f1f5f9;
  --card-bg: #ffffff;
  --header-bg: #ffffff;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --info: #3b82f6;
  --info-light: #eff6ff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .07);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, .07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, .1);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* ===== Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  direction: rtl;
  font-size: 14px;
  line-height: 1.6;
}

a {
  text-decoration: none;
}

button {
  cursor: pointer;
}

/* ===== Forms (minimal – RTL & font only; Tailwind @apply handles the rest) ===== */
.form-control {
  direction: rtl;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* ===== Alert / Flash ===== */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Stat Icon color variants (Tailwind handles base stat-card/stat-icon/stat-value/stat-label) ===== */
.stat-icon.indigo {
  background: #eef2ff;
  color: #6366f1;
}

.stat-icon.green {
  background: #ecfdf5;
  color: #10b981;
}

.stat-icon.red {
  background: #fef2f2;
  color: #ef4444;
}

.stat-icon.yellow {
  background: #fffbeb;
  color: #f59e0b;
}

.stat-icon.blue {
  background: #eff6ff;
  color: #3b82f6;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: #f8fafc;
  padding: 11px 14px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 14px;
}

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

tbody tr:hover {
  background: #f8faff;
}

/* ===== Ingredient / Item Rows ===== */
.ingredient-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ingredient-row {
  display: grid;
  grid-template-columns: 1fr 100px 130px 34px;
  gap: 8px;
  align-items: end;
}

/* ===== Cost Result Card ===== */
.cost-result {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 18px;
  margin-top: 16px;
}

.cost-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
}

.cost-item .cost-label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.cost-item .cost-value {
  font-size: 19px;
  font-weight: 800;
  color: #4f46e5;
}

.cost-item .cost-sub {
  font-size: 11px;
  color: #64748b;
}

.profit-positive {
  color: #10b981 !important;
}

.profit-negative {
  color: #ef4444 !important;
}

.margin-low {
  color: #f59e0b !important;
}

/* ===== Items Section (Products) ===== */
.items-section {
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
}

.items-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.items-section-title {
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-row {
  display: grid;
  grid-template-columns: 1fr 110px 32px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.item-row-label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 2px;
}

.item-row-remove {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #ef4444;
  padding: 4px 6px;
  line-height: 1;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.item-row-remove:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

/* ===== Low Stock Row ===== */
.low-stock-row td {
  background: #fff8f8 !important;
}

.low-stock-row:hover td {
  background: #fff0f0 !important;
}

/* ===== Pricing / Calculator ===== */
.pricing-section {
  border-top: 2px dashed #cbd5e1;
  padding-top: 16px;
}

.pricing-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-row input[type=range] {
  flex: 1;
  accent-color: #6366f1;
  cursor: pointer;
}

.slider-num {
  width: 80px !important;
  text-align: center;
}

.slider-unit {
  color: #64748b;
  font-weight: 600;
  min-width: 16px;
}

.comp-margin-input {
  width: 80px;
  text-align: center;
}

/* ===== Type Box Card Selector ===== */
.type-box-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.type-box-card {
  flex: 1;
  min-width: 100px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #fff;
  transition: all .2s ease;
  text-align: center;
}

.type-box-card:hover {
  border-color: #a5b4fc;
  background: #f8f7ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, .1);
}

.type-box-card.active {
  border-color: #6366f1;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

.type-box-card input[type="radio"] {
  display: none;
}

.type-box-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: #f1f5f9;
  color: #64748b;
  transition: all .2s;
}

.type-box-card.active .type-box-icon {
  background: #6366f1;
  color: #fff;
}

.type-box-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.type-box-card.active .type-box-label {
  color: #4f46e5;
}

/* ===== Mini Stat Tabs (Dashboard) ===== */
.mini-stat-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.mini-stat-tab {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
  transition: box-shadow .2s, transform .2s;
}

.mini-stat-tab:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, .08);
  transform: translateY(-1px);
}

.mini-stat-tab-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.mini-stat-tab-icon.green {
  background: #ecfdf5;
  color: #10b981;
}

.mini-stat-tab-icon.indigo {
  background: #eef2ff;
  color: #6366f1;
}

.mini-stat-tab-icon.emerald {
  background: #ecfdf5;
  color: #059669;
}

.mini-stat-tab-icon.red {
  background: #fef2f2;
  color: #ef4444;
}

.mini-stat-tab-label {
  font-size: 11px;
  color: #64748b;
}

.mini-stat-tab-value {
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
}

/* ===== Quick Action Buttons (Dashboard) ===== */
.quick-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #475569;
  transition: all .2s ease;
  cursor: pointer;
}

.quick-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.quick-action-btn .qa-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.quick-action-btn .qa-icon.green {
  background: #ecfdf5;
  color: #10b981;
}

.quick-action-btn .qa-icon.indigo {
  background: #eef2ff;
  color: #6366f1;
}

.quick-action-btn .qa-icon.blue {
  background: #eff6ff;
  color: #3b82f6;
}

.quick-action-btn .qa-icon.red {
  background: #fef2f2;
  color: #ef4444;
}

.quick-action-btn .qa-icon.amber {
  background: #fffbeb;
  color: #f59e0b;
}

.quick-action-btn .qa-icon.purple {
  background: #faf5ff;
  color: #8b5cf6;
}

.quick-action-btn:hover .qa-icon.green {
  background: #10b981;
  color: #fff;
}

.quick-action-btn:hover .qa-icon.indigo {
  background: #6366f1;
  color: #fff;
}

.quick-action-btn:hover .qa-icon.blue {
  background: #3b82f6;
  color: #fff;
}

.quick-action-btn:hover .qa-icon.red {
  background: #ef4444;
  color: #fff;
}

.quick-action-btn:hover .qa-icon.amber {
  background: #f59e0b;
  color: #fff;
}

.quick-action-btn:hover .qa-icon.purple {
  background: #8b5cf6;
  color: #fff;
}

/* ===== Two-Column Sale Modal ===== */
.sale-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.sale-col-calc {
  background: #f8fafc;
  border-radius: 12px;
  padding: 18px;
  border: 1px solid #e2e8f0;
}

.recipe-entry {
  display: grid;
  grid-template-columns: 1fr 90px 32px;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.recipe-entry-remove {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #ef4444;
  padding: 4px 6px;
  line-height: 1;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.recipe-entry-remove:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}

.calc-row:last-child {
  border-bottom: none;
}

.calc-label {
  color: #64748b;
  font-weight: 500;
}

.calc-value {
  font-weight: 700;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}

.calc-divider {
  border: none;
  border-top: 2px dashed #e2e8f0;
  margin: 8px 0;
}

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, .25);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.login-header {
  background: #6366f1;
  padding: 34px 30px;
  text-align: center;
}

.login-header .logo {
  font-size: 44px;
  margin-bottom: 8px;
  color: #fff;
}

.login-header h1 {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.login-header p {
  color: rgba(255, 255, 255, .8);
  font-size: 13px;
  margin-top: 4px;
}

.login-body {
  padding: 30px;
}

.login-footer {
  text-align: center;
  padding-bottom: 18px;
  font-size: 12px;
  color: #94a3b8;
}

/* ===== DataTables – Full Light-Mode Override ===== */
/* Wrapper + layout */
.dataTables_wrapper {
  direction: rtl;
  color: #1e293b;
}

.dataTables_wrapper .row,
.dataTables_wrapper>div {
  background: transparent !important;
}

/* Search input */
.dataTables_filter {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dataTables_filter label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
}

.dataTables_filter input {
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  background: #fff !important;
  color: #1e293b !important;
  transition: border-color .15s, box-shadow .15s;
  direction: rtl;
  box-shadow: none !important;
}

.dataTables_filter input:focus {
  outline: none !important;
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1) !important;
}

/* Length selector */
.dataTables_length {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dataTables_length label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
}

.dataTables_length select {
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 5px 10px !important;
  font-size: 13px !important;
  background: #fff !important;
  color: #1e293b !important;
  cursor: pointer;
  box-shadow: none !important;
}

/* Info text */
.dataTables_info {
  font-size: 13px;
  color: #64748b;
  padding-top: 4px;
}

/* Pagination */
.dataTables_paginate {
  display: flex !important;
  gap: 3px !important;
  flex-wrap: wrap;
}

.dataTables_paginate .paginate_button,
.dt-paging-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 5px 11px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  cursor: pointer !important;
  transition: background .15s, color .15s !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  color: #374151 !important;
  min-width: 32px !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
}

.dataTables_paginate .paginate_button.current,
.dt-paging-button.current {
  background: #6366f1 !important;
  color: #fff !important;
  border-color: #6366f1 !important;
  font-weight: 600 !important;
}

.dataTables_paginate .paginate_button:hover:not(.current):not(.disabled),
.dt-paging-button:hover:not(.current):not(.disabled) {
  background: #eef2ff !important;
  color: #4f46e5 !important;
  border-color: #c7d2fe !important;
}

.dataTables_paginate .paginate_button.disabled,
.dt-paging-button.disabled {
  opacity: .4 !important;
  cursor: default !important;
  pointer-events: none !important;
}

/* Table header sort icons */
table.dataTable thead th {
  cursor: pointer;
  user-select: none;
}

table.dataTable thead th.sorting_asc::after {
  content: ' ↑';
  font-size: 11px;
  color: #6366f1;
}

table.dataTable thead th.sorting_desc::after {
  content: ' ↓';
  font-size: 11px;
  color: #6366f1;
}

table.dataTable thead th.sorting::after {
  content: ' ↕';
  font-size: 11px;
  color: #cbd5e1;
}

/* Remove any dark background DataTables CDN may inject */
table.dataTable tbody tr {
  background-color: #fff !important;
}

table.dataTable tbody tr.odd {
  background-color: #fafbfc !important;
}

table.dataTable tbody tr.even {
  background-color: #fff !important;
}

table.dataTable tbody tr:hover,
table.dataTable tbody tr.odd:hover,
table.dataTable tbody tr.even:hover {
  background-color: #f8faff !important;
}

/* ===== SweetAlert2 RTL ===== */
.swal2-container {
  direction: rtl;
}

.swal2-popup {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif !important;
  border-radius: 16px !important;
}

.swal2-title {
  font-size: 18px !important;
  font-weight: 700 !important;
}

.swal2-content {
  font-size: 14px !important;
}

.swal2-confirm {
  border-radius: 8px !important;
  font-weight: 600 !important;
}

.swal2-cancel {
  border-radius: 8px !important;
  font-weight: 600 !important;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */

/* ── Tablet (≤1023px) ── */
@media (max-width: 1023px) {
  .ingredient-row {
    grid-template-columns: 1fr 90px 34px;
  }

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

  .sale-modal-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Small Tablet / Large Phone (≤768px) ── */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header .btn {
    width: 100%;
    justify-content: center;
  }

  .cost-result-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* New components */
  .mini-stat-row {
    gap: 8px;
  }

  .mini-stat-tab {
    min-width: 120px;
    padding: 10px 12px;
  }

  .mini-stat-tab-value {
    font-size: 14px;
  }

  .quick-actions-row {
    gap: 8px;
  }

  .quick-action-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .sale-modal-grid {
    grid-template-columns: 1fr;
  }

  .type-box-card {
    padding: 12px 8px;
    min-width: 80px;
  }

  .type-box-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  /* Modal — bottom-sheet style on mobile */
  .modal-overlay {
    padding: 8px;
    align-items: flex-end;
  }

  .modal {
    margin: 0;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .modal-footer .btn {
    flex: 1;
    min-width: 0;
    justify-content: center;
  }

  /* Tables — force horizontal scroll */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    min-width: 640px;
  }

  /* DataTables controls — stack vertically */
  .dataTables_wrapper .dt-layout-row {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .dataTables_wrapper .dt-layout-cell {
    width: 100% !important;
  }

  .dataTables_filter {
    justify-content: stretch;
  }

  .dataTables_filter input {
    width: 100% !important;
  }

  /* Cards */
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
  }

  .card-body {
    padding: 16px;
  }

  /* Stat cards — full width text */
  .stat-card {
    gap: 10px;
    padding: 14px;
  }

  .stat-value {
    font-size: 18px;
  }

  .stat-label {
    font-size: 11px;
  }

  .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 17px;
  }

  /* Items section (product form) */
  .item-row {
    grid-template-columns: 1fr 80px 32px;
  }

  /* Cost result */
  .cost-result {
    padding: 14px;
  }

  .cost-item .cost-value {
    font-size: 16px;
  }

  /* Slider row */
  .slider-row {
    flex-wrap: wrap;
  }

  /* Product drawer — full-width on mobile */
  .product-drawer {
    width: 100vw !important;
  }

  .variant-row-inner {
    flex-direction: column;
  }

  .variant-img-col {
    width: 100%;
    flex-direction: row;
    gap: 10px;
  }

  .variant-img-preview {
    width: 64px;
    height: 64px;
  }
}

/* ── Phone (≤480px) ── */
@media (max-width: 480px) {

  /* Page chrome */
  .content-inner {
    padding: 12px;
  }

  .page-header h2 {
    font-size: 17px;
  }

  .page-header p {
    font-size: 12px;
  }

  /* Forms */
  .form-control {
    padding: 8px 10px;
    font-size: 13px;
  }

  .form-label {
    font-size: 12px;
  }

  .form-row {
    grid-template-columns: 1fr !important;
  }

  /* Buttons — slightly smaller */
  .btn {
    padding: 7px 12px;
    font-size: 12px;
  }

  .btn-sm {
    padding: 4px 10px;
    font-size: 11px;
  }

  /* Actions in tables — wrap if needed */
  .td-actions {
    flex-wrap: wrap;
  }

  /* Stats grid — single column */
  .stat-card {
    padding: 12px;
  }

  /* Ingredient rows */
  .ingredient-row {
    grid-template-columns: 1fr 34px;
    gap: 6px;
  }

  /* Cost result */
  .cost-result-grid {
    grid-template-columns: 1fr;
  }

  /* Login page tweaks */
  .login-card {
    border-radius: 14px;
  }

  .login-header {
    padding: 24px 20px;
  }

  .login-header h1 {
    font-size: 17px;
  }

  .login-body {
    padding: 20px;
  }

  /* Notification panel — full width */
  .notif-panel {
    min-width: 260px;
    max-width: calc(100vw - 20px);
  }

  /* Drawer modal */
  .drawer-header {
    padding: 12px 14px;
  }

  .drawer-body {
    padding: 14px;
  }

  .drawer-title {
    font-size: 14px;
  }

  /* Account page */
  .account-avatar,
  .account-avatar-placeholder {
    width: 60px;
    height: 60px;
    font-size: 22px;
  }

  /* Empty state — less padding */
  .empty-state {
    padding: 40px 16px;
  }

  .empty-state .empty-icon {
    font-size: 32px;
  }

  .empty-state h3 {
    font-size: 14px;
  }
}

/* ============================================================
   DARK MODE — Variable Overrides
   ============================================================ */
[data-theme="dark"] {
  --body-bg: #0f172a;
  --card-bg: #1e293b;
  --header-bg: #1e293b;
  --border: #334155;
  --border-dark: #475569;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, .3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, .35);
  --primary-light: #312e81;
}

/* Dark transitions */
body,
.card,
.modal,
.stat-card,
.form-control,
.top-navbar,
.nav-dropdown-menu,
.notif-panel {
  transition: background-color .3s, color .3s, border-color .3s;
}

/* Dark body */
[data-theme="dark"] body {
  background: var(--body-bg);
  color: var(--text-main);
}

/* Dark forms – only special CSS props not covered by Tailwind @apply */
[data-theme="dark"] .form-control {
  background: #0f172a;
  border-color: var(--border);
  color: var(--text-main);
}

[data-theme="dark"] .form-control:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, .15);
}

/* Dark tables */
[data-theme="dark"] thead th {
  background: #253045 !important;
  color: var(--text-muted);
  border-bottom-color: var(--border);
}

[data-theme="dark"] tbody td {
  border-bottom-color: #253045;
}

[data-theme="dark"] tbody tr:hover {
  background: #253045 !important;
}

[data-theme="dark"] table.dataTable tbody tr {
  background-color: var(--card-bg) !important;
}

[data-theme="dark"] table.dataTable tbody tr.odd {
  background-color: #182235 !important;
}

[data-theme="dark"] table.dataTable tbody tr.even {
  background-color: var(--card-bg) !important;
}

[data-theme="dark"] table.dataTable tbody tr:hover,
[data-theme="dark"] table.dataTable tbody tr.odd:hover,
[data-theme="dark"] table.dataTable tbody tr.even:hover {
  background-color: #253045 !important;
}

/* Dark DataTables controls */
[data-theme="dark"] .dataTables_wrapper {
  color: var(--text-main);
}

[data-theme="dark"] .dataTables_filter label,
[data-theme="dark"] .dataTables_length label,
[data-theme="dark"] .dataTables_info {
  color: var(--text-muted);
}

[data-theme="dark"] .dataTables_filter input,
[data-theme="dark"] .dataTables_length select {
  background: #0f172a !important;
  border-color: var(--border) !important;
  color: var(--text-main) !important;
}

[data-theme="dark"] .dataTables_paginate .paginate_button,
[data-theme="dark"] .dt-paging-button {
  background: #253045 !important;
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .dataTables_paginate .paginate_button.current,
[data-theme="dark"] .dt-paging-button.current {
  background: #6366f1 !important;
  color: #fff !important;
  border-color: #6366f1 !important;
}

[data-theme="dark"] .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled),
[data-theme="dark"] .dt-paging-button:hover:not(.current):not(.disabled) {
  background: #312e81 !important;
  color: #a5b4fc !important;
  border-color: #4338ca !important;
}

/* Dark cost result */
[data-theme="dark"] .cost-result {
  background: #1e1b4b;
  border-color: #3730a3;
}

[data-theme="dark"] .cost-item .cost-value {
  color: #a5b4fc;
}

/* Dark low stock */
[data-theme="dark"] .low-stock-row td {
  background: #2d0a0a !important;
}

[data-theme="dark"] .low-stock-row:hover td {
  background: #3d0e0e !important;
}

/* Dark items section */
[data-theme="dark"] .items-section {
  border-color: var(--border);
}

/* Dark text — elements with hardcoded light colors */
[data-theme="dark"] .pricing-title {
  color: var(--text-main);
}

[data-theme="dark"] .items-section-title {
  color: var(--text-main);
}

[data-theme="dark"] .cost-label {
  color: var(--text-muted);
}

[data-theme="dark"] .cost-sub {
  color: var(--text-muted);
}

[data-theme="dark"] .form-group {
  color: var(--text-main);
}

/* Dark type-box-card */
[data-theme="dark"] .type-box-card {
  background: var(--card-bg);
  border-color: var(--border);
}

[data-theme="dark"] .type-box-card:hover {
  border-color: #818cf8;
  background: #1e1b4b;
}

[data-theme="dark"] .type-box-card.active {
  border-color: #818cf8;
  background: #312e81;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, .15);
}

[data-theme="dark"] .type-box-icon {
  background: #334155;
  color: var(--text-muted);
}

[data-theme="dark"] .type-box-card.active .type-box-icon {
  background: #6366f1;
  color: #fff;
}

[data-theme="dark"] .type-box-label {
  color: var(--text-muted);
}

[data-theme="dark"] .type-box-card.active .type-box-label {
  color: #a5b4fc;
}

/* Dark mini-stat-tab */
[data-theme="dark"] .mini-stat-tab {
  background: var(--card-bg);
  border-color: var(--border);
}

[data-theme="dark"] .mini-stat-tab-value {
  color: var(--text-main);
}

[data-theme="dark"] .mini-stat-tab-label {
  color: var(--text-muted);
}

[data-theme="dark"] .mini-stat-tab-icon.green {
  background: #052e16;
  color: #6ee7b7;
}

[data-theme="dark"] .mini-stat-tab-icon.indigo {
  background: #312e81;
  color: #a5b4fc;
}

[data-theme="dark"] .mini-stat-tab-icon.emerald {
  background: #052e16;
  color: #34d399;
}

[data-theme="dark"] .mini-stat-tab-icon.red {
  background: #450a0a;
  color: #fca5a5;
}

/* Dark quick-action-btn */
[data-theme="dark"] .quick-action-btn {
  background: var(--card-bg);
  border-color: var(--border);
  color: var(--text-muted);
}

[data-theme="dark"] .quick-action-btn:hover {
  background: #253045;
  color: var(--text-main);
}

[data-theme="dark"] .quick-action-btn .qa-icon.green {
  background: #052e16;
  color: #6ee7b7;
}

[data-theme="dark"] .quick-action-btn .qa-icon.indigo {
  background: #312e81;
  color: #a5b4fc;
}

[data-theme="dark"] .quick-action-btn .qa-icon.blue {
  background: #172554;
  color: #93c5fd;
}

[data-theme="dark"] .quick-action-btn .qa-icon.red {
  background: #450a0a;
  color: #fca5a5;
}

[data-theme="dark"] .quick-action-btn .qa-icon.amber {
  background: #451a03;
  color: #fcd34d;
}

[data-theme="dark"] .quick-action-btn .qa-icon.purple {
  background: #2e1065;
  color: #c4b5fd;
}

/* Dark sale modal calc column */
[data-theme="dark"] .sale-col-calc {
  background: #0f172a;
  border-color: var(--border);
}

[data-theme="dark"] .recipe-entry {
  background: #0f172a;
  border-color: var(--border);
}

[data-theme="dark"] .calc-label {
  color: var(--text-muted);
}

[data-theme="dark"] .calc-value {
  color: var(--text-main);
}

[data-theme="dark"] .calc-divider {
  border-top-color: var(--border);
}

[data-theme="dark"] .calc-row {
  border-bottom-color: var(--border);
}

/* Dark scrollbar */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #475569;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
  height: 62px;
}

[data-theme="dark"] .top-navbar {
  background: var(--card-bg);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}

.navbar-container {
  display: flex;
  align-items: center;
  max-width: 100%;
  height: 100%;
  padding: 0 20px;
  gap: 4px;
}

/* Brand */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 12px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #6366f1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}

[data-theme="dark"] .brand-name {
  color: var(--text-main);
}

/* Mobile toggle button (hidden on desktop) */
.navbar-toggler {
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  color: #64748b;
  padding: 6px;
  border-radius: 6px;
  transition: background .15s;
}

.navbar-toggler:hover {
  background: #f1f5f9;
}

[data-theme="dark"] .navbar-toggler:hover {
  background: #334155;
}

/* Nav Items Row */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 1;
  overflow: visible;
}

/* Individual link */
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
  position: relative;
}

.nav-link:hover {
  background: #f1f5f9;
  color: #1e293b;
}

[data-theme="dark"] .nav-link {
  color: var(--text-muted);
}

[data-theme="dark"] .nav-link:hover {
  background: #334155;
  color: var(--text-main);
}

.nav-link-active {
  background: #eef2ff !important;
  color: #4f46e5 !important;
}

[data-theme="dark"] .nav-link-active {
  background: #312e81 !important;
  color: #a5b4fc !important;
}

/* Caret icon */
.nav-caret {
  font-size: 10px;
  transition: transform .2s;
  margin-right: 2px;
}

/* ===== Dropdown Wrap ===== */
.nav-dropdown-wrap {
  position: relative;
}

/* Show dropdown on group-active (current page is in group) */
.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-group-active .nav-link,
.nav-group-active .nav-dropdown-btn {
  background: #eef2ff;
  color: #4f46e5;
}

[data-theme="dark"] .nav-group-active .nav-link,
[data-theme="dark"] .nav-group-active .nav-dropdown-btn {
  background: #312e81;
  color: #a5b4fc;
}

/* Rotate caret when open */
.nav-dropdown-wrap.open .nav-caret {
  transform: rotate(180deg);
}

/* Dropdown menu */
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  /* flush against the trigger — no gap */
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  padding: 6px;
  padding-top: 12px;
  /* visual breathing room replaces top offset */
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s, transform .18s;
}

/* Invisible hover bridge — lets the cursor travel from trigger to menu without losing hover */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

[data-theme="dark"] .nav-dropdown-menu {
  background: #1e293b;
  border-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}

/* Desktop: show on hover — also add a small hide-delay so it doesn't vanish instantly */
@media (min-width: 1025px) {
  .nav-dropdown-wrap:hover>.nav-dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity .15s, transform .15s;
  }

  .nav-dropdown-wrap:not(:hover)>.nav-dropdown-menu {
    transition: opacity .18s .1s, transform .18s .1s;
    /* 100ms delay before hiding */
  }

  .nav-dropdown-wrap:hover>.nav-dropdown-btn .nav-caret,
  .nav-dropdown-wrap:hover>button .nav-caret {
    transform: rotate(180deg);
  }
}

/* Mobile or JS-toggled (click) */
.nav-dropdown-wrap.open .nav-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown-wrap.open .nav-caret {
  transform: rotate(180deg);
}

/* Dropdown positioned to left (user menu on far left in RTL) */
.nav-dropdown-left {
  right: auto;
  left: 0;
}

/* Notification panel — in RTL layout, bell is on left; panel must extend rightward */
.notif-panel {
  right: auto !important;
  left: 0;
}

/* Dropdown item */
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, color .12s;
  white-space: nowrap;
}

.nav-dropdown-item:hover,
.nav-dropdown-item.active {
  background: #f1f5f9;
  color: #1e293b;
}

[data-theme="dark"] .nav-dropdown-item {
  color: var(--text-muted);
}

[data-theme="dark"] .nav-dropdown-item:hover,
[data-theme="dark"] .nav-dropdown-item.active {
  background: #334155;
  color: var(--text-main);
}

.nav-dropdown-item i {
  width: 16px;
  text-align: center;
}

/* Danger dropdown item */
.nav-dropdown-danger {
  color: #ef4444 !important;
}

.nav-dropdown-danger:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

[data-theme="dark"] .nav-dropdown-danger:hover {
  background: #450a0a !important;
}

/* Dropdown header (user name/email block) */
.nav-dropdown-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 4px;
}

[data-theme="dark"] .nav-dropdown-header {
  border-color: var(--border);
}

/* Dropdown divider */
.nav-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

[data-theme="dark"] .nav-dropdown-divider {
  background: var(--border);
}

/* ===== Nav Badge ===== */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
  margin-right: auto;
}

.nav-badge-sm {
  min-width: 16px;
  height: 16px;
  font-size: 9px;
}

/* ===== Navbar End (right section) ===== */
.navbar-end {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-right: auto;
}

/* Icon button (theme toggle, bell) */
.nav-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #64748b;
  transition: background .15s, color .15s;
}

.nav-icon-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

[data-theme="dark"] .nav-icon-btn {
  color: var(--text-muted);
}

[data-theme="dark"] .nav-icon-btn:hover {
  background: #334155;
  color: var(--text-main);
}

/* ===== Notification Bell ===== */
.notif-bell-btn {
  position: relative;
}

.notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  line-height: 1;
}

[data-theme="dark"] .notif-dot {
  border-color: var(--card-bg);
}

/* Notification panel (larger dropdown) */
.notif-panel {
  min-width: 320px;
  max-width: 360px;
  padding: 0;
}

@media (max-width: 480px) {
  .notif-panel {
    min-width: 280px;
  }
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="dark"] .notif-panel-header {
  border-color: var(--border);
}

.notif-panel-footer {
  padding: 8px 14px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

[data-theme="dark"] .notif-panel-footer {
  border-color: var(--border);
}

.notif-list {
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .12s;
  text-decoration: none;
}

.notif-item:hover {
  background: #f8faff;
}

.notif-item.unread {
  background: #f0f4ff;
}

[data-theme="dark"] .notif-item {
  border-color: #253045;
  color: var(--text-main);
}

[data-theme="dark"] .notif-item:hover {
  background: #253045;
}

[data-theme="dark"] .notif-item.unread {
  background: #1e234a;
}

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.notif-icon.info {
  background: #eff6ff;
  color: #3b82f6;
}

.notif-icon.success {
  background: #ecfdf5;
  color: #10b981;
}

.notif-icon.warning {
  background: #fffbeb;
  color: #f59e0b;
}

.notif-icon.danger {
  background: #fef2f2;
  color: #ef4444;
}

[data-theme="dark"] .notif-icon.info {
  background: #172554;
}

[data-theme="dark"] .notif-icon.success {
  background: #052e16;
}

[data-theme="dark"] .notif-icon.warning {
  background: #451a03;
}

[data-theme="dark"] .notif-icon.danger {
  background: #450a0a;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-msg {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

[data-theme="dark"] .notif-title {
  color: var(--text-main);
}

[data-theme="dark"] .notif-msg {
  color: var(--text-muted);
}

.notif-empty {
  text-align: center;
  padding: 28px 16px;
  color: #94a3b8;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* btn-link-sm — used in notif panel header */
.btn-link-sm {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #6366f1;
  padding: 3px 6px;
  border-radius: 5px;
  transition: background .12s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-link-sm:hover {
  background: #eef2ff;
}

[data-theme="dark"] .btn-link-sm {
  color: #818cf8;
}

[data-theme="dark"] .btn-link-sm:hover {
  background: #312e81;
}

/* ===== User Button ===== */
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  transition: background .15s;
}

.nav-user-btn:hover {
  background: #f1f5f9;
}

[data-theme="dark"] .nav-user-btn {
  color: var(--text-muted);
}

[data-theme="dark"] .nav-user-btn:hover {
  background: #334155;
}

.nav-avatar-img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-avatar-initials {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-username {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Page Layout ===== */
.page-wrapper {
  min-height: calc(100vh - 62px);
  background: var(--body-bg, #f1f5f9);
}

[data-theme="dark"] .page-wrapper {
  background: var(--body-bg);
}

.main-content {
  padding: 0;
}

.content-inner {
  padding: 24px 24px;
}

/* ===== Mobile Nav ===== */
@media (max-width: 1024px) {
  .navbar-toggler {
    display: flex;
  }

  .brand-name {
    font-size: 13px;
  }

  .navbar-nav {
    display: none;
    /* hidden by default on mobile */
    position: absolute;
    top: 62px;
    right: 0;
    left: 0;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
    z-index: 199;
  }

  [data-theme="dark"] .navbar-nav {
    background: var(--card-bg);
    border-color: var(--border);
  }

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

  /* On mobile make dropdowns static (expand inline) */
  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0;
    padding-top: 0;
    margin-top: 0;
    display: none;
    border-radius: 0;
    background: transparent;
  }

  .nav-dropdown-menu::before {
    display: none;
  }

  /* remove hover bridge */
  .nav-dropdown-wrap.open .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown-item {
    padding-right: 24px;
  }

  .navbar-container {
    position: relative;
    flex-wrap: nowrap;
  }

  /* Make nav-end items accessible on mobile */
  .navbar-end {
    gap: 0;
  }
}

@media (max-width: 640px) {
  .content-inner {
    padding: 14px;
  }

  .nav-username {
    display: none;
  }

  /* Notif panel — anchor to viewport edge on small screens */
  .notif-panel {
    position: fixed !important;
    top: 62px !important;
    left: 8px !important;
    right: 8px !important;
    min-width: auto !important;
    max-width: none !important;
    border-radius: 10px;
  }

  /* Brand — shorter name on very small screens */
  .brand-name {
    font-size: 12px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ===== Account Page ===== */
.account-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #e2e8f0;
  flex-shrink: 0;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  flex-shrink: 0;
  border: 3px solid #e2e8f0;
}

[data-theme="dark"] .account-avatar,
[data-theme="dark"] .account-avatar-placeholder {
  border-color: var(--border);
}

/* ===== New Components: Quick Actions, Mini Tabs, Type Boxes ===== */

.mini-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.mini-stat-tab {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all .2s;
}

.mini-stat-tab:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .08);
}

.mini-stat-tab-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.mini-stat-tab-icon.green {
  background: #ecfdf5;
  color: #10b981;
}

.mini-stat-tab-icon.indigo {
  background: #eef2ff;
  color: #6366f1;
}

.mini-stat-tab-icon.emerald {
  background: #ecfdf5;
  color: #059669;
}

.mini-stat-tab-icon.red {
  background: #fef2f2;
  color: #ef4444;
}

.mini-stat-tab-label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 2px;
  font-weight: 600;
}

.mini-stat-tab-value {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

/* Quick Actions Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .quick-actions-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.quick-action-btn {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: #1e293b;
  font-weight: 600;
  font-size: 13px;
  transition: all .2s;
  text-align: center;
}

.quick-action-btn:hover {
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .05);
}

.quick-action-btn .qa-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: transform .2s;
}

.quick-action-btn:hover .qa-icon {
  transform: scale(1.1);
}

.qa-icon.green {
  background: #ecfdf5;
  color: #10b981;
}

.qa-icon.indigo {
  background: #eef2ff;
  color: #6366f1;
}

.qa-icon.blue {
  background: #eff6ff;
  color: #3b82f6;
}

.qa-icon.red {
  background: #fef2f2;
  color: #ef4444;
}

.qa-icon.amber {
  background: #fffbeb;
  color: #f59e0b;
}

.qa-icon.purple {
  background: #faf5ff;
  color: #a855f7;
}

.qa-icon.gray {
  background: #f8fafc;
  color: #64748b;
}

/* Type Box Cards (Waste/Modal) */
.type-box-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.type-box-card {
  position: relative;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 12px;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  background: #fff;
}

.type-box-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.type-box-card.active {
  border-color: #6366f1;
  background: #eef2ff;
}

.type-box-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.type-box-icon {
  font-size: 24px;
  margin-bottom: 8px;
  color: #64748b;
  transition: color .2s;
}

.type-box-card.active .type-box-icon {
  color: #6366f1;
}

.type-box-label {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  display: block;
}

/* Sale Modal Two-Column Grid */
.sale-modal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .mini-stat-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-actions-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .sale-modal-grid {
    grid-template-columns: 1.4fr 1fr;
  }
}

@media (min-width: 1024px) {
  .mini-stat-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Sale Summary Row (for multi-recipe preview) */
.sale-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.sale-summary-row:last-child {
  border-bottom: none;
}

.sale-summary-label {
  color: #64748b;
  font-size: 13px;
}

.sale-summary-value {
  font-weight: 700;
  color: #1e293b;
  font-size: 14px;
}

/* Dark Mode Overrides */
[data-theme="dark"] .mini-stat-tab,
[data-theme="dark"] .quick-action-btn,
[data-theme="dark"] .type-box-card {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .mini-stat-tab-value,
[data-theme="dark"] .type-box-label,
[data-theme="dark"] .sale-summary-value {
  color: #f1f5f9;
}

[data-theme="dark"] .type-box-card:hover {
  background: #334155;
}

[data-theme="dark"] .type-box-card.active {
  background: rgba(99, 102, 241, .15);
  border-color: #6366f1;
}

[data-theme="dark"] .mini-stat-tab-icon.green {
  background: rgba(16, 185, 129, .15);
}

[data-theme="dark"] .mini-stat-tab-icon.indigo {
  background: rgba(99, 102, 241, .15);
}

[data-theme="dark"] .mini-stat-tab-icon.emerald {
  background: rgba(5, 150, 105, .15);
}

[data-theme="dark"] .mini-stat-tab-icon.red {
  background: rgba(239, 68, 68, .15);
}

[data-theme="dark"] .qa-icon.green {
  background: rgba(16, 185, 129, .15);
}

[data-theme="dark"] .qa-icon.indigo {
  background: rgba(99, 102, 241, .15);
}

[data-theme="dark"] .qa-icon.blue {
  background: rgba(59, 130, 246, .15);
}

[data-theme="dark"] .qa-icon.red {
  background: rgba(239, 68, 68, .15);
}

[data-theme="dark"] .qa-icon.amber {
  background: rgba(245, 158, 11, .15);
}

[data-theme="dark"] .qa-icon.purple {
  background: rgba(168, 85, 247, .15);
}

[data-theme="dark"] .qa-icon.gray {
  background: rgba(148, 163, 184, .15);
}

[data-theme="dark"] .sale-summary-row {
  border-color: #334155;
}

[data-theme="dark"] .sale-summary-label {
  color: #94a3b8;
}