/* ============================================================
   app.css — SeeTheMenu design system (Bootstrap-free, 2026)
   ============================================================ */

/* ── 1. Design tokens ──────────────────────────────────────── */
:root {
  /* Brand nav */
  --nav-bg:           #1e2642;
  --nav-text:         #c8d3e8;
  --nav-hover:        #ffffff;
  --nav-active-bar:   #6366f1;
  --nav-h:            60px;

  /* Surfaces */
  --bg:               #f1f5f9;
  --surface:          #ffffff;
  --surface-2:        #f8fafc;
  --border:           #e2e8f0;
  --border-2:         #cbd5e1;

  /* Text */
  --t1:               #0f172a;
  --t2:               #475569;
  --t3:               #94a3b8;

  /* Brand / primary */
  --brand:            #4f46e5;
  --brand-hover:      #4338ca;
  --brand-light:      #eef2ff;

  /* Semantic colours */
  --success:          #059669;
  --success-bg:       #ecfdf5;
  --success-border:   #a7f3d0;
  --warning:          #d97706;
  --warning-bg:       #fffbeb;
  --warning-border:   #fde68a;
  --danger:           #dc2626;
  --danger-bg:        #fef2f2;
  --danger-border:    #fecaca;
  --info:             #0891b2;
  --info-bg:          #ecfeff;
  --info-border:      #a5f3fc;

  /* Menu-card state tokens — used for badge colours only, not structural borders */
  --state-paid:       #059669;
  --state-trial:      #6366f1;
  --state-free:       #94a3b8;
  --state-expiring:   #d97706;
  --state-overdue:    #dc2626;

  /* Shape & motion */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 4px rgba(15,23,42,.06);
  --shadow-md: 0 4px 16px rgba(15,23,42,.10), 0 1px 4px rgba(15,23,42,.05);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.12), 0 2px 8px rgba(15,23,42,.06);
  --transition: .15s ease;
}

/* ── 2. Reset / base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--t1);
  line-height: 1.55;
  padding-top: var(--nav-h);
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; height: auto; display: block; }
h1,h2,h3,h4,h5,h6 { margin: 0; font-weight: 600; line-height: 1.25; color: var(--t1); }
p { margin: 0 0 1rem; }
ul,ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── 3. Top navigation bar ─────────────────────────────────── */
.sm-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--nav-bg);
  z-index: 200;
  transition: top .3s ease;
}
.scrolling_down .sm-topbar { top: calc(-1 * var(--nav-h)); }

.sm-topbar__inner {
  display: flex; flex-direction: row;
  align-items: center;
  height: 100%;
  padding: 0 20px;
  gap: 0;
}
.sm-topbar__logo {
  flex-shrink: 0;
  margin-right: 24px;
  display: flex; flex-direction: row;
  align-items: center;
}
.sm-topbar__logo img {
  height: 36px;
  width: auto;
}
.sm-topbar__links {
  display: flex; flex-direction: row;
  align-items: center;
  flex: 1;
  gap: 2px;
}
.sm-topbar__link {
  display: flex; flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  color: var(--nav-text);
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.sm-topbar__link:hover { background: rgba(255,255,255,.08); color: var(--nav-hover); }
.sm-topbar__link .material-icons-outlined { font-size: 18px; }

.sm-topbar__user {
  display: flex; flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.sm-topbar__username {
  color: var(--nav-text);
  font-size: .875rem;
  font-weight: 600;
  padding: 6px 8px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sm-topbar__logout {
  display: flex; flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--nav-text);
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.sm-topbar__logout:hover { background: rgba(255,255,255,.15); color: var(--nav-hover); }
.sm-topbar__logout .material-icons-outlined { font-size: 18px; }

/* Lang switcher inside nav */
.sm-topbar__lang {
  display: flex; flex-direction: row;
  align-items: center;
}
.sm-topbar__lang select {
  background: transparent;
  color: var(--nav-text);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  font-size: .8rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.sm-topbar__lang select option { background: #1e2642; color: #fff; }
.sm-topbar__lang select:focus { outline: none; border-color: rgba(255,255,255,.5); }

/* Hamburger toggle — hidden on desktop */
.sm-topbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  padding: 6px;
  border-radius: var(--r-sm);
  cursor: pointer;
  margin-left: auto;
}
.sm-topbar__toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--nav-text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.sm-topbar__toggle--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sm-topbar__toggle--open span:nth-child(2) { opacity: 0; }
.sm-topbar__toggle--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Header notice (admin banner) */
.header_notice {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 190;
  background: #fef9c3;
  border-bottom: 1px solid #fde047;
  color: #713f12;
  text-align: center;
  padding: 4px 12px;
  font-size: .8rem;
}

/* ── 4. Page layout ────────────────────────────────────────── */
.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}
.page-header {
  display: flex; flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--t1);
}
.page-subtitle {
  font-size: .875rem;
  color: var(--t2);
  margin-top: 2px;
}

/* ── 5. Alerts / flash messages ────────────────────────────── */
.alert {
  display: flex; flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: .9rem;
  margin-bottom: 20px;
  line-height: 1.45;
}
.alert .material-icons-outlined { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.alert-success  { background: var(--success-bg);  border-color: var(--success-border);  color: #065f46; }
.alert-danger   { background: var(--danger-bg);   border-color: var(--danger-border);   color: #7f1d1d; }
.alert-warning  { background: var(--warning-bg);  border-color: var(--warning-border);  color: #78350f; }
.alert-info     { background: var(--info-bg);     border-color: var(--info-border);     color: #164e63; }
.alert-link { font-weight: 700; color: inherit; text-decoration: underline; }
.alert-dismissible { position: relative; padding-right: 40px; }
.alert-dismissible .close {
  position: absolute; top: 8px; right: 8px;
  background: none; border: none; cursor: pointer;
  color: inherit; opacity: .6; padding: 4px; border-radius: 4px;
  font-size: 1.2rem; line-height: 1; font-family: sans-serif;
}
.alert-dismissible .close:hover { opacity: 1; background: rgba(0,0,0,.06); }

/* ── 6. Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.btn .material-icons-outlined { font-size: 18px; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn:disabled, .btn[disabled] { opacity: .5; pointer-events: none; }

.btn-primary   { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-secondary { background: #f1f5f9; color: var(--t2); border-color: var(--border-2); }
.btn-secondary:hover { background: #e2e8f0; color: var(--t1); }
.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #047857; border-color: #047857; color: #fff; }
.btn-outline-secondary { background: transparent; color: var(--t2); border-color: var(--border-2); }
.btn-outline-secondary:hover { background: #f1f5f9; color: var(--t1); }
.btn-block { display: flex; flex-direction: row; width: 100%; }

/* ── 7. Action buttons (menu card row) ─────────────────────── */
.action-btn {
  display: inline-flex; flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: .8rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  background: var(--surface-2);
  color: var(--t2);
  border-color: var(--border);
  -webkit-appearance: none;
  appearance: none;
}
.action-btn .material-icons-outlined { font-size: 17px; }
.action-btn:hover { background: var(--border); color: var(--t1); }
.action-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.action-btn--edit    { background: #eef2ff; color: var(--brand);   border-color: #c7d2fe; }
.action-btn--edit:hover { background: #e0e7ff; color: var(--brand-hover); }
.action-btn--view    { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.action-btn--view:hover { background: #d1fae5; }

/* Pay — primary outcome action, filled brand indigo (trustworthy, prominent) */
.action-btn--pay     { background: var(--brand); color: #fff; border-color: var(--brand); }
.action-btn--pay:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
/* Extend — same trust hierarchy as pay but quieter (already-paying renewal) */
.action-btn--extend  { background: var(--brand-light); color: var(--brand); border-color: #c7d2fe; }
.action-btn--extend:hover { background: #e0e7ff; color: var(--brand-hover); }

/* Delete — neutral chrome, red icon only. Reads as "destructive" without screaming. */
.action-btn--danger  { background: var(--surface); color: var(--t2); border-color: var(--border); padding: 8px 10px; }
.action-btn--danger .material-icons-outlined { color: var(--danger); }
.action-btn--danger:hover { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.action-btn--danger:hover .material-icons-outlined { color: var(--danger); }
/* Confirm — escalates to filled red since user clicked once and we want unambiguous confirmation */
.action-btn--danger-confirm { background: var(--danger); color: #fff; border-color: var(--danger); animation: pulse-red .6s infinite alternate; }
.action-btn--danger-confirm .material-icons-outlined { color: #fff; }

@keyframes pulse-red {
  from { box-shadow: 0 0 0 0 rgba(220,38,38,.4); }
  to   { box-shadow: 0 0 0 6px rgba(220,38,38,.0); }
}

/* ── 8. Menu cards grid ────────────────────────────────────── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
  gap: 16px;
}
.menu-grid--empty {
  grid-template-columns: 1fr;
}

.menu-card {
  --tint:       var(--surface-2);
  --tint-hover: #f1f5f9;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease;
}
/* Status tint — applied to the upper informational zone (.menu-card__main).
   Action row sibling stays neutral white. */
.menu-card--paid     { --tint: var(--success-bg);  --tint-hover: #d1fae5; }
.menu-card--new      { --tint: var(--brand-light); --tint-hover: #e0e7ff; }
.menu-card--free     { --tint: var(--surface-2);   --tint-hover: #f1f5f9; }
.menu-card--expiring { --tint: var(--warning-bg);  --tint-hover: #fef3c7; }
.menu-card--overdue  { --tint: var(--danger-bg);   --tint-hover: #fee2e2; }

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

.menu-card__main {
  display: block;
  padding: 20px 20px 16px;
  text-decoration: none;
  flex: 1;
  color: inherit;
  background: var(--tint);
  transition: background .15s ease;
}
.menu-card__main:hover { background: var(--tint-hover); color: inherit; }

.menu-card__top {
  display: flex; flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.menu-card__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.3;
  word-break: break-word;
}
.menu-card__badges {
  display: flex; flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.menu-card__meta {
  font-size: .8rem;
  color: var(--t3);
  display: flex; flex-direction: row;
  align-items: center;
  gap: 6px;
}
.menu-card__meta .material-icons-outlined { font-size: 15px; }

.menu-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.menu-card__actions-row {
  display: flex; flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.menu-card__actions-spacer { flex: 1 1 auto; min-width: 0; }

/* ── 9. Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}
.badge .material-icons-outlined { font-size: 13px; }
.badge--plan        { background: #f1f5f9; color: var(--t2); border: 1px solid var(--border-2); font-weight: 600; }
.badge--active      { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge--inactive    { background: #f8fafc; color: var(--t3); border: 1px solid var(--border); }
.badge--trial       { background: var(--brand-light); color: var(--brand); border: 1px solid #c7d2fe; font-weight: 700; }
.badge--free        { background: #f1f5f9; color: var(--t3); border: 1px solid var(--border); }
.badge--expiring    { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); font-weight: 700; }
.badge--overdue     { background: var(--danger-bg);  color: var(--danger); border: 1px solid var(--danger-border); font-weight: 700; }

/* ── 10. Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 6px;
}
.form-hint {
  display: block;
  font-size: .8rem;
  color: var(--t3);
  margin-top: 4px;
}
.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: .9rem;
  color: var(--t1);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.form-control::placeholder { color: var(--t3); }
select.form-control {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath stroke='%2394a3b8' stroke-width='1.5' fill='none' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  background-size: 12px;
}
.form-text { font-size: .8rem; color: var(--t3); margin-top: 4px; }

/* Settings card (profile page) */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}
.settings-card__header {
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: row;
  align-items: center;
  gap: 10px;
}
.settings-card__header .material-icons-outlined {
  font-size: 22px;
  color: var(--brand);
}
.settings-card__title { font-size: 1rem; font-weight: 700; color: var(--t1); }
.settings-card__body  { padding: 24px; }
.settings-card__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; flex-direction: row;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── 11. Modal ─────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow-y: auto;
}
.modal.show {
  display: flex; flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
}
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 290;
}
.modal-backdrop.show { display: block; }
.modal-dialog { position: relative; width: 100%; max-width: 480px; margin: auto; }
.modal-content {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex; flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--t3);
  padding: 6px;
  border-radius: var(--r-sm);
  display: flex; flex-direction: row;
  align-items: center;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--surface-2); color: var(--t1); }
.modal-close .material-icons-outlined { font-size: 22px; }
.modal-body   { padding: 20px 24px; font-size: .9rem; color: var(--t2); line-height: 1.6; }
.modal-footer {
  display: flex; flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
/* Legacy: keep .close working for qrModal close button */
.close {
  background: none; border: none; cursor: pointer;
  color: var(--t3); padding: 6px; border-radius: var(--r-sm);
  display: flex; flex-direction: row; align-items: center;
  font-size: 1.4rem; line-height: 1; font-family: sans-serif;
  transition: background var(--transition), color var(--transition);
}
.close:hover { background: var(--surface-2); color: var(--t1); }

/* ── 12. Empty state ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--t3);
}
.empty-state .material-icons-outlined {
  font-size: 56px;
  color: var(--border-2);
  display: block;
  margin: 0 auto 16px;
}
.empty-state__title { font-size: 1.1rem; font-weight: 600; color: var(--t2); margin-bottom: 6px; }
.empty-state__hint  { font-size: .875rem; }

/* ── 13. Utility (only what's structurally necessary) ──────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-danger  { color: var(--danger)  !important; }
.text-success { color: var(--success) !important; }
.text-muted   { color: var(--t3)      !important; }
.d-none       { display: none         !important; }

/* ── 14. Site footer ───────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--t3);
  font-size: .8rem;
  margin-top: auto;
}

/* ── 15. Nav / tabs (auth page & admin) ────────────────────── */
.nav { display: flex; flex-direction: row; flex-wrap: wrap; gap: 2px; list-style: none; }
.nav-link { display: block; padding: 8px 16px; color: var(--brand); border-radius: var(--r-sm); }
.nav-link:hover { background: var(--brand-light); }
.nav-tabs { border-bottom: 2px solid var(--border); gap: 0; }
.nav-tabs .nav-link {
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  color: var(--t2);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.nav-tabs .nav-link:hover { color: var(--t1); background: var(--surface-2); }
.nav-tabs .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: transparent; font-weight: 600; }
.tab-content > .tab-pane { display: none; }
.tab-content > .active   { display: block; }

/* Auth tabs (login page) */
.auth-tabs .nav-link { font-weight: 600; padding: 12px 24px; background: transparent; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px; color: var(--t3); }
.auth-tabs .nav-link:hover { color: var(--t1); }
.auth-tabs .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); }
.auth-tabs { border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-content > .tab-pane { padding-top: 4px; }
body.modal-open { overflow: hidden; }
.auth-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }

/* ── 16. Spinner ───────────────────────────────────────────── */
.spinner-border {
  display: inline-block; width: 1.4rem; height: 1.4rem;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: _spin .65s linear infinite; vertical-align: middle;
}
@keyframes _spin { to { transform: rotate(360deg); } }

/* ── 17. Tables (admin / orders pages) ─────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table thead th { font-weight: 600; color: var(--t2); background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:hover { background: var(--surface-2); }
.table-sm th, .table-sm td { padding: 6px 10px; }

/* Badge compat used by admin pages */
.badge-primary   { background: var(--brand-light); color: var(--brand); }
.badge-secondary { background: #f1f5f9; color: var(--t2); }
.badge-success   { background: var(--success-bg); color: var(--success); }
.badge-danger    { background: var(--danger-bg); color: var(--danger); }
.badge-warning   { background: var(--warning-bg); color: var(--warning); }
.badge-info      { background: var(--info-bg); color: var(--info); }
.badge-plan      { background: #f1f5f9; color: var(--t2); }
.badge-cycle     { background: var(--surface-2); color: var(--t3); }

/* Old compat classes for pages not yet redesigned */
.container       { width: 100%; max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.container-fluid { width: 100%; padding: 0; }
.form-check { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.form-check-input { margin-top: 2px; flex-shrink: 0; }
.col-form-label { padding-top: 10px; font-weight: 600; }
.input-group { display: flex; flex-direction: row; align-items: stretch; }
.input-group .form-control { flex: 1 1 auto; border-radius: 0; }
.input-group .form-control:first-child { border-top-left-radius: var(--r-md); border-bottom-left-radius: var(--r-md); }
.input-group-prepend { display: flex; flex-direction: row; }
.input-group-text { display: flex; flex-direction: row; align-items: center; padding: 10px 14px; font-size: .9rem; border: 1px solid var(--border-2); background: var(--surface-2); border-right: 0; border-radius: var(--r-md) 0 0 var(--r-md); }

/* Pricing / order page components */
.pricing_table .card {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-lg);
  cursor: pointer; transition: border-color var(--transition), box-shadow var(--transition);
  padding: 20px;
}
.pricing_table .card:hover, .pricing_table .card.selected { border-color: var(--brand); box-shadow: var(--shadow-md); }
.pricing_table .card.discarded { opacity: .55; filter: grayscale(.5); }
.pricing_table i { font-style: normal; font-weight: 700; color: #fff; width: 28px; height: 28px; padding: 4px; display: inline-flex; flex-direction: row; align-items: center; justify-content: center; border-radius: 50%; font-size: .85rem; }
.pricing_table i.y { background: var(--success); }
.pricing_table i.n { background: var(--danger); }
.pricing_table table { width: 100%; }
.pricing_table table tr span { background: var(--brand); color: #fff; border-radius: var(--r-sm); padding: 4px 10px; font-size: 1.1rem; display: inline-block; margin-top: 8px; }

/* Stats */
.stats_container { position: relative; }
.stats_container button { cursor: pointer; padding: 0; border: none; background: var(--danger); color: #fff; font-size: 14px; position: absolute; top: -5px; right: -5px; border-radius: 50%; width: 26px; height: 26px; }

/* Order page cancel icon */
.order-cancel-icon { font-size: 56px; color: var(--danger); display: block; text-align: center; margin-bottom: 12px; }

/* Review page */
.review-btn { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; }
.review-btn .material-icons-outlined { font-size: 20px; }

/* ── 18. Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  /* Nav collapses to hamburger */
  .sm-topbar__links { display: none; }
  .sm-topbar__user  { display: none; }
  .sm-topbar__toggle { display: flex; flex-direction: column; }

  /* Mobile nav drawer */
  .sm-topbar__links--open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--nav-bg);
    padding: 16px 20px 24px;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    z-index: 190;
  }
  .sm-topbar__links--open .sm-topbar__link { padding: 12px 16px; font-size: 1rem; border-radius: var(--r-md); }
  .sm-topbar__links--open .sm-topbar__user { display: flex; flex-direction: row; }
  .sm-topbar__links--open .sm-topbar__username { display: block; }
  .sm-topbar__links--open .sm-topbar__logout   { display: flex; flex-direction: row; }
  .sm-topbar__links--open .sm-topbar__lang     { display: flex; flex-direction: row; }

  .page-wrap { padding: 20px 16px 40px; }
  .menu-grid { grid-template-columns: 1fr; }
  .action-btn { padding: 8px 10px; font-size: .75rem; }
  .page-title { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .menu-card__actions { gap: 5px; }
  .action-btn .action-label { display: none; }
}

@supports not (gap: 1px) {
  .menu-card__actions > * + * { margin-left: 6px; }
  .btn > * + * { margin-left: 6px; }
}

/* ── 19. Bootstrap-compat utilities (pages not yet redesigned) ─ */
/* Spacing — Bootstrap 4 scale (base 1rem = 16px) */
.mt-0{margin-top:0!important} .mt-1{margin-top:.25rem!important} .mt-2{margin-top:.5rem!important} .mt-3{margin-top:1rem!important} .mt-4{margin-top:1.5rem!important} .mt-5{margin-top:3rem!important}
.mb-0{margin-bottom:0!important} .mb-1{margin-bottom:.25rem!important} .mb-2{margin-bottom:.5rem!important} .mb-3{margin-bottom:1rem!important} .mb-4{margin-bottom:1.5rem!important} .mb-5{margin-bottom:3rem!important}
.ml-0{margin-left:0!important} .ml-1{margin-left:.25rem!important} .ml-2{margin-left:.5rem!important} .ml-3{margin-left:1rem!important} .ml-auto{margin-left:auto!important}
.mr-0{margin-right:0!important} .mr-1{margin-right:.25rem!important} .mr-2{margin-right:.5rem!important} .mr-3{margin-right:1rem!important} .mr-auto{margin-right:auto!important}
.pt-0{padding-top:0!important} .pt-1{padding-top:.25rem!important} .pt-2{padding-top:.5rem!important} .pt-3{padding-top:1rem!important} .pt-4{padding-top:1.5rem!important}
.pb-0{padding-bottom:0!important} .pb-1{padding-bottom:.25rem!important} .pb-2{padding-bottom:.5rem!important} .pb-3{padding-bottom:1rem!important} .pb-4{padding-bottom:1.5rem!important}
.px-0{padding-left:0!important;padding-right:0!important} .px-1{padding-left:.25rem!important;padding-right:.25rem!important} .px-2{padding-left:.5rem!important;padding-right:.5rem!important} .px-3{padding-left:1rem!important;padding-right:1rem!important} .px-4{padding-left:1.5rem!important;padding-right:1.5rem!important}
.py-0{padding-top:0!important;padding-bottom:0!important} .py-1{padding-top:.25rem!important;padding-bottom:.25rem!important} .py-2{padding-top:.5rem!important;padding-bottom:.5rem!important} .py-3{padding-top:1rem!important;padding-bottom:1rem!important} .py-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}
.p-0{padding:0!important} .p-1{padding:.25rem!important} .p-2{padding:.5rem!important} .p-3{padding:1rem!important} .p-4{padding:1.5rem!important}

/* Display */
.d-block{display:block!important} .d-inline{display:inline!important} .d-inline-block{display:inline-block!important} .d-inline-flex{display:inline-flex!important;flex-direction:row} .d-flex{display:flex!important;flex-direction:row} .d-none{display:none!important}

/* Flexbox */
.flex-wrap{flex-wrap:wrap!important} .flex-column{flex-direction:column!important} .flex-row{flex-direction:row!important} .flex-grow-1{flex-grow:1!important}
.align-items-start{align-items:flex-start!important} .align-items-center{align-items:center!important} .align-items-end{align-items:flex-end!important}
.justify-content-start{justify-content:flex-start!important} .justify-content-center{justify-content:center!important} .justify-content-end{justify-content:flex-end!important} .justify-content-between{justify-content:space-between!important}
.gap-1{gap:.25rem!important} .gap-2{gap:.5rem!important} .gap-3{gap:1rem!important}

/* Float */
.float-left{float:left!important} .float-right{float:right!important} .clearfix::after{display:block;clear:both;content:""}

/* Width */
.w-100{width:100%!important} .w-auto{width:auto!important} .mw-100{max-width:100%!important}

/* Text */
.text-left{text-align:left!important} .text-center{text-align:center!important} .text-right{text-align:right!important}
.font-weight-bold{font-weight:700!important} .font-weight-normal{font-weight:400!important}
.text-white{color:#fff!important} .text-dark{color:var(--t1)!important}
.small{font-size:.875rem!important}

/* Button sizes */
.btn-sm{padding:5px 12px!important;font-size:.8rem!important}
.btn-lg{padding:12px 24px!important;font-size:1rem!important}

/* Bootstrap grid shim (12-col, no breakpoints — stacks gracefully) */
.row{display:flex; flex-direction: row;flex-wrap:wrap;margin-left:-.75rem;margin-right:-.75rem}
.row > [class^="col"]{padding-left:.75rem;padding-right:.75rem;flex-shrink:0}
.col{flex:1 0 0%} .col-auto{flex:0 0 auto;width:auto}
.col-1{flex:0 0 auto;width:8.333%} .col-2{flex:0 0 auto;width:16.667%} .col-3{flex:0 0 auto;width:25%}
.col-4{flex:0 0 auto;width:33.333%} .col-5{flex:0 0 auto;width:41.667%} .col-6{flex:0 0 auto;width:50%}
.col-7{flex:0 0 auto;width:58.333%} .col-8{flex:0 0 auto;width:66.667%} .col-9{flex:0 0 auto;width:75%}
.col-10{flex:0 0 auto;width:83.333%} .col-11{flex:0 0 auto;width:91.667%} .col-12{flex:0 0 auto;width:100%}
/* Responsive col breakpoints — sm≥576, md≥768, lg≥992, xl≥1200 */
@media(min-width:576px){.col-sm-1{flex:0 0 auto;width:8.333%}.col-sm-2{flex:0 0 auto;width:16.667%}.col-sm-3{flex:0 0 auto;width:25%}.col-sm-4{flex:0 0 auto;width:33.333%}.col-sm-6{flex:0 0 auto;width:50%}.col-sm-8{flex:0 0 auto;width:66.667%}.col-sm-12{flex:0 0 auto;width:100%}}
@media(min-width:768px){.col-md-1{flex:0 0 auto;width:8.333%}.col-md-2{flex:0 0 auto;width:16.667%}.col-md-3{flex:0 0 auto;width:25%}.col-md-4{flex:0 0 auto;width:33.333%}.col-md-5{flex:0 0 auto;width:41.667%}.col-md-6{flex:0 0 auto;width:50%}.col-md-7{flex:0 0 auto;width:58.333%}.col-md-8{flex:0 0 auto;width:66.667%}.col-md-9{flex:0 0 auto;width:75%}.col-md-10{flex:0 0 auto;width:83.333%}.col-md-12{flex:0 0 auto;width:100%}}
@media(min-width:992px){.col-lg-1{flex:0 0 auto;width:8.333%}.col-lg-2{flex:0 0 auto;width:16.667%}.col-lg-3{flex:0 0 auto;width:25%}.col-lg-4{flex:0 0 auto;width:33.333%}.col-lg-5{flex:0 0 auto;width:41.667%}.col-lg-6{flex:0 0 auto;width:50%}.col-lg-7{flex:0 0 auto;width:58.333%}.col-lg-8{flex:0 0 auto;width:66.667%}.col-lg-9{flex:0 0 auto;width:75%}.col-lg-10{flex:0 0 auto;width:83.333%}.col-lg-12{flex:0 0 auto;width:100%}}
@media(min-width:1200px){.col-xl-3{flex:0 0 auto;width:25%}.col-xl-4{flex:0 0 auto;width:33.333%}.col-xl-6{flex:0 0 auto;width:50%}.col-xl-8{flex:0 0 auto;width:66.667%}.col-xl-12{flex:0 0 auto;width:100%}}

/* Table variants */
.table-bordered th,.table-bordered td{border:1px solid var(--border)!important}
.table-striped tbody tr:nth-of-type(odd){background:var(--surface-2)}
.thead-light th{background:var(--surface-2);color:var(--t2)}
.thead-dark  th{background:var(--t1);color:#fff}

/* Misc compat */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:20px}
.card-body{padding:20px}
.card-title{font-size:1.1rem;font-weight:700;margin-bottom:12px}
.list-group{list-style:none;border:1px solid var(--border);border-radius:var(--r-md);overflow:hidden}
.list-group-item{padding:12px 16px;border-bottom:1px solid var(--border);background:var(--surface)}
.list-group-item:last-child{border-bottom:none}
.rounded{border-radius:var(--r-md)!important}
.shadow{box-shadow:var(--shadow-md)!important}
.border-0{border:none!important}
.overflow-auto{overflow:auto!important}
.position-relative{position:relative!important}
.position-absolute{position:absolute!important}
.top-0{top:0!important} .right-0{right:0!important} .bottom-0{bottom:0!important} .left-0{left:0!important}
.text-primary{color:var(--brand)!important} .text-info{color:var(--info)!important} .text-warning{color:var(--warning)!important}
.bg-light{background:var(--surface-2)!important} .bg-white{background:#fff!important}
.table-borderless th,.table-borderless td{border:none!important}
.table-sm th,.table-sm td{padding:6px 10px!important}
/* Bootstrap custom file input — minimal functional style */
.custom-file{position:relative;display:inline-block;width:100%;height:calc(1.5em + 20px + 2px)}
.custom-file-input{position:relative;z-index:2;width:100%;height:calc(1.5em + 20px + 2px);margin:0;opacity:0;cursor:pointer}
.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(1.5em + 20px + 2px);padding:10px 14px;font-size:.9rem;background:var(--surface);border:1px solid var(--border-2);border-radius:var(--r-md);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:pointer}
.custom-file-label::after{content:'Browse';position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:calc(1.5em + 20px);padding:10px 14px;background:var(--surface-2);border-left:1px solid var(--border-2)}
.form-text{font-size:.8rem;color:var(--t3);margin-top:4px}
.invalid-feedback{display:none;font-size:.8rem;color:var(--danger);margin-top:4px}
.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip{display:block}
.is-invalid .form-control,.form-control.is-invalid{border-color:var(--danger)}

/* Google OAuth button + divider (auth pages) */
.auth-google-btn{display:flex; flex-direction: row;align-items:center;justify-content:center;gap:8px;font-weight:500}
.auth-google-btn .material-icons-outlined{font-size:20px;line-height:1}
.auth-google-disclaimer{font-size:11px;color:var(--t3);text-align:center;margin:6px 0 14px}
.auth-divider{display:flex; flex-direction: row;align-items:center;text-align:center;color:var(--t3);font-size:12px;text-transform:uppercase;letter-spacing:.08em;margin:14px 0}
.auth-divider::before,.auth-divider::after{content:"";flex:1;border-bottom:1px solid var(--border)}
.auth-divider span{padding:0 12px}
