/* =====================================================
   Daamdekhi Rising Stars — Design System
   ===================================================== */

:root {
  /* Brand palette */
  --brand-50:  #eef3fb;
  --brand-100: #d5e2f5;
  --brand-200: #aac4eb;
  --brand-300: #7fa6e0;
  --brand-400: #5488d6;
  --brand-500: #3a6ec4;   /* primary */
  --brand-600: #2e58a0;
  --brand-700: #22427c;
  --brand-800: #162c58;
  --brand-900: #0a1634;

  --accent-500: #e8563a;  /* warm accent */
  --accent-400: #ed7560;

  --success:  #1f9d55;
  --warning:  #d97706;
  --danger:   #dc2626;
  --info:     #0284c7;

  /* Neutrals */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --bg:         #f4f6fb;
  --surface:    #ffffff;
  --surface-2:  #f8fafc;
  --border:     var(--gray-200);
  --text:       var(--gray-800);
  --text-muted: var(--gray-500);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 12px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-md: 0 8px 24px rgba(0,0,0,.10), 0 4px 10px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 40px rgba(0,0,0,.12), 0 8px 16px rgba(0,0,0,.07);

  --header-h: 60px;
  --transition: 0.2s ease;
}

/* ── Dark mode ── */
body.dark-mode {
  --bg:         #0f1523;
  --surface:    #1a2234;
  --surface-2:  #1e2840;
  --border:     #2d3748;
  --text:       #e2e8f0;
  --text-muted: #718096;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

main { flex: 1; padding: 2rem 1.5rem; max-width: 1400px; margin: 0 auto; width: 100%; }

a { color: var(--brand-500); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header / Nav ── */
header {
  height: var(--header-h);
  background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-500) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

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

.brand img {
  height: 36px;
  width: auto;
  border-radius: 8px;
  background: #fff;
  padding: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

.brand-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.brand a { color: #fff; font-size: 1.1rem; font-weight: 700; text-decoration: none; }

nav { display: flex; align-items: center; gap: 4px; }

.nav-links { display: flex; align-items: center; gap: 4px; }

.nav-links a {
  color: rgba(255,255,255,0.88);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.nav-links a:hover { background: rgba(255,255,255,0.18); color: #fff; }

.user {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  padding: 4px 10px;
  background: rgba(255,255,255,0.12);
  border-radius: 20px;
  margin-right: 4px;
}

.menu-toggle {
  display: none;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}

#theme-toggle {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  margin-left: 4px;
}
#theme-toggle:hover { background: rgba(255,255,255,0.25); }

/* ── Flash messages ── */
.flash-messages {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
}

/* ── Cards / Surfaces ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.card-img-top {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.card-body { padding: 14px; }

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
  line-height: 1.3;
}

.card-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.card-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 8px 14px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  line-height: 1.4;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand-500);
  color: #fff;
  border: 1px solid var(--brand-500);
}
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); box-shadow: 0 2px 8px rgba(58,110,196,.3); }

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--gray-200); }

.btn-outline-primary {
  background: transparent;
  color: var(--brand-500);
  border: 1.5px solid var(--brand-500);
}
.btn-outline-primary:hover { background: var(--brand-50); }

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

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

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

.btn-link {
  background: transparent;
  color: var(--brand-500);
  border: none;
  padding: 0.3rem 0.6rem;
  font-weight: 500;
}
.btn-link:hover { text-decoration: underline; }

.btn-sm { font-size: 0.8rem; padding: 0.3rem 0.75rem; }
.btn-lg { font-size: 1rem; padding: 0.75rem 1.75rem; }
.btn-center { display: block; margin: 1rem auto; width: fit-content; }
.w-100 { width: 100%; display: flex; justify-content: center; }

body.dark-mode .btn-secondary { background: #2d3748; color: #e2e8f0; border-color: #4a5568; }
body.dark-mode .btn-secondary:hover { background: #3d4a5c; }

/* ── Forms ── */
.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  display: block;
  margin-bottom: 5px;
}

.form-control, .form-select {
  display: block;
  width: 100%;
  padding: 0.6rem 0.875rem;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.5;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(58,110,196,.15);
  outline: none;
}
.form-control::placeholder { color: var(--gray-400); }

body.dark-mode .form-control, body.dark-mode .form-select {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.form-text { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

.mb-2 { margin-bottom: 0.75rem; }
.mb-3 { margin-bottom: 1.25rem; }
.mb-4 { margin-bottom: 1.75rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.ms-2 { margin-left: 0.5rem; }
.text-center { text-align: center; }

/* ── Form container ── */
.form-container {
  max-width: 560px;
  margin: 2rem auto;
  background: var(--surface);
  padding: 2rem 2.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

body.dark-mode .form-container {
  background: var(--surface);
  border-color: var(--border);
}

/* Side-by-side layout */
.form-container.side-layout {
  max-width: 900px;
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 2.5rem 3rem;
}
.form-container.side-layout.reverse { flex-direction: row-reverse; }
.form-content { flex: 1; }
.side-image { flex: 1; text-align: center; }
.form-image {
  max-width: 100%;
  width: 320px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ── Validation messages ── */
.validation-message { font-size: 0.78rem; margin-top: 4px; display: block; }
.validation-message.error { color: var(--danger); }
.validation-message.success { color: var(--success); }

/* ── Alerts ── */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.88rem;
  border: 1px solid transparent;
}
.alert-warning {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}
.alert-info {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #075985;
}
body.dark-mode .alert-warning { background: #451a03; border-color: #78350f; color: #fcd34d; }
body.dark-mode .alert-info { background: #082f49; border-color: #075985; color: #7dd3fc; }

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}
.bg-success { background: var(--success); color: #fff; }
.bg-warning { background: var(--warning); color: #fff; }
.bg-info    { background: var(--info);    color: #fff; }

/* ── Dashboard ── */
.dashboard-container { max-width: 1200px; margin: 0 auto; }

.dashboard-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
body.dark-mode .dashboard-section { background: var(--surface); }

.dashboard-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--brand-100);
}
body.dark-mode .dashboard-section h3 { border-bottom-color: var(--border); }

/* ── Menu item cards ── */
.menu-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.menu-item h4 {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}
.delete-menu {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(220,38,38,.1);
  border: 1px solid rgba(220,38,38,.2);
  color: var(--danger);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background var(--transition);
}
.delete-menu:hover { background: var(--danger); color: #fff; }

.uploaded-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}
.uploaded-images img.uploaded-menu-img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
}
.uploaded-images .image-wrapper { position: relative; display: inline-block; }
.uploaded-images .remove-img-btn {
  position: absolute; top: -6px; right: -6px;
  background: var(--danger); border: none;
  color: #fff; border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 0.7rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Competitor product cards */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 1rem;
}
.cards-container .card { width: 100%; }

.tag {
  display: inline-block;
  background: var(--brand-50);
  color: var(--brand-600);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  margin: 2px;
  border: 1px solid var(--brand-100);
}
body.dark-mode .tag { background: var(--brand-800); color: var(--brand-200); border-color: var(--brand-700); }

/* ── Recipe display ── */
.recipe {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1.25rem;
}
body.dark-mode .recipe { background: var(--surface); }
.recipe h5 { text-align: center; font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.recipe h6 { font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.recipe ul, .recipe ol { margin-left: 1.25rem; }
.recipe li { margin-bottom: 4px; font-size: 0.88rem; }

.ingredient-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  position: relative;
}
body.dark-mode .ingredient-row { background: var(--surface); }
.remove-ingredient-btn { position: absolute; top: 6px; right: 6px; padding: 2px 8px; }

/* ── Price history ── */
.price-history-section { margin-top: 1rem; }
.price-history-section-dash {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.price-history {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 0.85rem;
}
body.dark-mode .price-history { background: var(--surface-2); }
.price-history-dash-ext { max-width: 460px; min-width: 300px; flex: 1; }
.price-history h6 { margin-bottom: 6px; text-align: center; font-size: 0.85rem; }

.price-history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
  width: 100%;
  box-shadow: var(--shadow-sm);
}
canvas { display: block; max-width: 100%; min-height: 200px; }

/* ── Pricing report ── */
.report-container { margin: 1rem 0; text-align: center; }
.report-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 10px;
  text-align: left;
  word-wrap: break-word;
}
body.dark-mode .report-box { background: var(--surface); }
.report-title { text-align: center; margin-bottom: 10px; font-size: 0.9rem; font-weight: 600; }
.report-content { font-size: 0.88rem; line-height: 1.7; }

/* Markdown rendered inside report-content */
.report-content h1, .report-content h2, .report-content h3,
.report-content h4, .report-content h5, .report-content h6 {
  font-weight: 700;
  margin: 1rem 0 0.4rem;
  color: var(--brand-700);
  line-height: 1.3;
}
body.dark-mode .report-content h1,
body.dark-mode .report-content h2,
body.dark-mode .report-content h3,
body.dark-mode .report-content h4 { color: var(--brand-300); }
.report-content h1 { font-size: 1.15rem; }
.report-content h2 { font-size: 1.05rem; }
.report-content h3 { font-size: 0.97rem; }
.report-content h4, .report-content h5, .report-content h6 { font-size: 0.9rem; }
.report-content p { margin: 0.5rem 0; }
.report-content ul, .report-content ol { margin: 0.5rem 0 0.5rem 1.5rem; }
.report-content li { margin-bottom: 3px; }
.report-content strong { color: var(--text); font-weight: 700; }
.report-content em { color: var(--text-muted); }
.report-content hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.report-content blockquote {
  border-left: 3px solid var(--brand-300);
  padding-left: 0.75rem;
  color: var(--text-muted);
  margin: 0.5rem 0;
}
.report-content table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin: 0.5rem 0; }
.report-content table th { background: var(--brand-500); color: #fff; padding: 6px 10px; text-align: left; }
.report-content table td { border: 1px solid var(--border); padding: 5px 10px; }
.report-content code { background: var(--gray-100); border-radius: 3px; padding: 1px 5px; font-size: 0.82rem; }
body.dark-mode .report-content code { background: var(--gray-800); }

/* ── Current price display ── */
.current-price { font-size: 0.95rem; color: var(--text); margin-bottom: 8px; }
body.dark-mode .current-price { color: var(--text); }
.update-price-form { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* ── Shop info ── */
.shop-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  text-align: left;
}
.shop-info-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
}
body.dark-mode .shop-info-item { background: var(--surface); }
.shop-info-item strong { display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.shop-info-item span { font-size: 0.9rem; color: var(--text); font-weight: 500; }

/* ── Orders page ── */
.orders-page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 900px) {
  .orders-page-grid { grid-template-columns: 3fr 2fr; }
}

.tables {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.table-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.table-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-600);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brand-100);
  display: flex;
  align-items: center;
  gap: 6px;
}
body.dark-mode .table-box h4 { color: var(--brand-300); border-bottom-color: var(--border); }
.table-box p { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 6px; }

/* Order items list */
.order-items-list { list-style: none; padding: 0; margin: 0 0 10px 0; }
.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  gap: 6px;
}
body.dark-mode .order-item { background: var(--surface); }
.order-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.order-item-img {
  width: 36px; height: 36px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.order-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.order-item-price {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.order-item-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.order-item-actions form { display: flex; align-items: center; }
.order-qty-input { width: 46px; text-align: center; font-size: 0.82rem; padding: 3px 5px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.order-item-remove-btn {
  background: rgba(220,38,38,.1); border: 1px solid rgba(220,38,38,.2);
  color: var(--danger); border-radius: var(--radius-sm);
  padding: 3px 7px; font-size: 0.75rem; cursor: pointer; font-weight: 600;
  transition: background var(--transition);
}
.order-item-remove-btn:hover { background: var(--danger); color: #fff; }
.inline-form { display: inline; }

/* Order totals bar */
.order-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand-700);
}
body.dark-mode .order-total-bar { background: var(--brand-900); border-color: var(--brand-800); color: var(--brand-200); }

/* Order action buttons row */
.order-action-row {
  display: flex;
  gap: 6px;
  margin: 8px 0;
  flex-wrap: wrap;
}

/* Add item form inside table box */
.order-add-form {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 12px;
}
body.dark-mode .order-add-form { background: var(--surface); }
.order-add-form h5 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* Previous orders table */
.previous-orders {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-top: 2rem;
}
.previous-orders h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-align: center;
  color: var(--text);
}

/* ── Tables (generic) ── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table th {
  background: var(--brand-500);
  color: #fff;
  padding: 10px 14px;
  font-weight: 600;
  text-align: left;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}
.table tbody tr:hover { background: var(--surface-2); }
.table-sm th, .table-sm td { padding: 7px 10px; }
body.dark-mode .table th { background: var(--brand-700); }
body.dark-mode .table td { border-bottom-color: var(--border); }
body.dark-mode .table tbody tr:hover { background: var(--surface); }
.previous-orders-table { margin-bottom: 1.5rem; }

/* ── Menu filter ── */
.menu-filter { width: 100%; margin-bottom: 6px; }

/* ── Discounts page ── */
.discounts-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}
@media (min-width: 700px) {
  .discounts-layout { grid-template-columns: 1fr 1.5fr; }
}
.discount-badge-amount {
  background: #dcfce7; color: #166534;
  border-radius: 20px; padding: 2px 10px; font-size: 0.8rem; font-weight: 600;
}
.discount-badge-pct {
  background: #dbeafe; color: #1e40af;
  border-radius: 20px; padding: 2px 10px; font-size: 0.8rem; font-weight: 600;
}
body.dark-mode .discount-badge-amount { background: #14532d; color: #86efac; }
body.dark-mode .discount-badge-pct { background: #1e3a5f; color: #93c5fd; }

/* ── Hero (landing) ── */
.hero {
  text-align: center;
  padding: 5rem 2rem;
  max-width: 640px;
  margin: 3rem auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.hero h2 { font-size: 2rem; font-weight: 800; margin-bottom: 1rem; color: var(--brand-700); }
body.dark-mode .hero h2 { color: var(--brand-300); }
.hero p { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 2rem; }
.cta-buttons { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.features { max-width: 640px; margin: 2rem auto; text-align: center; }
.features h3 { margin-bottom: 0.5rem; font-size: 1.1rem; font-weight: 700; }
.hero-logo { max-width: 180px; margin: 0 auto 1.5rem auto; display: block; border-radius: var(--radius); }

/* ── Auth links ── */
.auth-link { color: var(--brand-500); font-weight: 600; }
.auth-link:hover { color: var(--brand-600); }
.page-logo { max-width: 80px; margin: 0 auto 1rem; display: block; border-radius: var(--radius-sm); }

/* ── Tooltip ── */
.tooltip-icon { font-size: 0.85rem; color: var(--text-muted); cursor: help; margin-left: 4px; }

/* ── Utility ── */
.center-container { text-align: center; }
.center-input { display: block; margin: 0 auto; max-width: 360px; text-align: center; }
.d-inline-block { display: inline-block; }

/* ── Back to top ── */
#back-to-top {
  position: fixed; bottom: 28px; right: 28px;
  background: var(--brand-500); color: #fff;
  border: none; border-radius: 50%;
  width: 42px; height: 42px; display: none;
  cursor: pointer; font-size: 1.2rem;
  box-shadow: var(--shadow-md);
  transition: background var(--transition), transform var(--transition);
}
#back-to-top:hover { background: var(--brand-600); transform: translateY(-2px); }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  margin-top: auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  main { padding: 1rem; }
  .menu-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--brand-700);
    flex-direction: column;
    padding: 0.75rem;
    gap: 4px;
    box-shadow: var(--shadow-md);
    z-index: 999;
  }
  .nav-links.show { display: flex; }
  .nav-links a { padding: 10px 14px; border-radius: var(--radius-sm); }
  .form-container.side-layout { flex-direction: column; gap: 1.5rem; padding: 1.5rem; }
  .form-container.side-layout.reverse { flex-direction: column; }
  .form-image { width: 200px; }
  .cards-container { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .tables { grid-template-columns: 1fr; }
  .discounts-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  header { padding: 0 1rem; }
  .brand-text { display: none; }
  .cards-container { grid-template-columns: 1fr 1fr; }
}

/* ── Dark mode card footer ── */
body.dark-mode .card-footer { background: var(--surface); border-top-color: var(--border); }
body.dark-mode .tag { background: #1e3a5f; color: #93c5fd; }
