/* ============================================================
   Restaurant Dashboard — Full stylesheet
   ============================================================ */

/* ── Base ─────────────────────────────────────────────────── */
body {
  font-family: var(--font-family);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  margin: 0;
  padding: 0;
}

/* ── Layout shell ─────────────────────────────────────────── */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.dashboard__sidebar {
  width: 260px;
  background: var(--color-bg-secondary);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-base);
}

.dashboard__sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.dashboard__brand-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.dashboard__brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

/* Current restaurant badge in the sidebar */
.dashboard__venue {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: linear-gradient(135deg, rgba(4, 120, 87, 0.08), rgba(4, 120, 87, 0.03));
  border: 1px solid rgba(4, 120, 87, 0.15);
  border-radius: var(--radius-md);
}

.dashboard__venue-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-accent-emerald);
  border-radius: 50%;
}

.dashboard__venue-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dashboard__venue-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
}

.dashboard__venue-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard__nav {
  flex: 1;
  padding: 0.75rem 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.dashboard__nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition-base);
}

.dashboard__nav-item:hover {
  background: rgba(4, 120, 87, 0.07);
  color: var(--color-accent-emerald);
}

.dashboard__nav-item--active {
  background: rgba(4, 120, 87, 0.12);
  color: var(--color-accent-emerald);
  font-weight: 600;
}

.dashboard__nav-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.8;
}

.dashboard__nav-item--active .dashboard__nav-icon,
.dashboard__nav-item:hover .dashboard__nav-icon {
  opacity: 1;
}

.dashboard__nav-text {
  font-size: 0.9375rem;
}

/* Sidebar footer */
.dashboard__sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

/* "Designed & developed by AILDCO" — under the logout button */
.sidebar-credit {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 0.75rem 0.25rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--color-text-tertiary, #94a3b8);
  text-decoration: none;
  transition: color 0.2s ease;
}
.sidebar-credit:hover { color: var(--color-accent-emerald, #047857); }
.sidebar-credit__text {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.sidebar-credit__logo {
  height: 14px;
  width: auto;
  display: block;
  color: currentColor;
}

.dashboard__logout {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition-base);
}

.dashboard__logout:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

/* Mobile overlay */
.dashboard__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 99;
}

/* Apply the blur only while open — a display:none element that still declares
   backdrop-filter can leave a blurred GPU layer stuck over the page in Chrome
   (notably after a same-tab redirect; opening the URL in a fresh tab clears it). */
.dashboard__overlay.is-open {
  display: block;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ── Main area ────────────────────────────────────────────── */
.dashboard__main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ───────────────────────────────────────────────── */
.dashboard__topbar {
  background: var(--color-bg-secondary);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.dashboard__menu-btn {
  display: none;
  flex-direction: column;
  gap: 0.3125rem;
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-base);
}

.dashboard__menu-btn:hover {
  background: rgba(15, 23, 42, 0.06);
}

.dashboard__menu-line {
  width: 22px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
}

.dashboard__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text-primary);
  flex: 1;
  letter-spacing: -0.01em;
}

.dashboard__topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Profile dropdown */
.dashboard__profile {
  position: relative;
}

.dashboard__profile-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 0.5rem 0 0.5rem;
  background: transparent;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.dashboard__profile-btn:hover {
  background: var(--color-bg-secondary, #f8fafc);
  border-color: var(--color-border-strong, #cbd5e1);
}

.dashboard__profile-btn:hover {
  background: rgba(15, 23, 42, 0.04);
}

.dashboard__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-accent-emerald);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.dashboard__avatar--lg {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.dashboard__profile-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.dashboard__profile-chevron {
  color: var(--color-text-secondary);
  transition: transform var(--transition-base);
}

.dashboard__profile-btn[aria-expanded="true"] .dashboard__profile-chevron {
  transform: rotate(180deg);
}

.dashboard__profile-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 220px;
  background: var(--color-bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  z-index: 200;
}

/* hidden attribute — keep display:none unless explicitly shown */
.dashboard__profile-dropdown[hidden] {
  display: none !important;
}

.dashboard__profile-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem 0.875rem;
}

.dashboard__profile-fullname {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.dashboard__profile-email {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 0.125rem;
}

.dashboard__profile-divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 0.25rem 0;
}

.dashboard__profile-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5625rem 0.75rem;
  color: var(--color-text-primary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  transition: all var(--transition-base);
}

.dashboard__profile-link:hover {
  background: rgba(4, 120, 87, 0.07);
  color: var(--color-accent-emerald);
}

.dashboard__profile-link--danger {
  color: #ef4444;
}

.dashboard__profile-link--danger:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

/* ── Content area ─────────────────────────────────────────── */
.dashboard__content {
  flex: 1;
  padding: 1.75rem 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-family);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  color: #fff;
  background: var(--color-accent-emerald);
  box-shadow: 0 1px 3px rgba(4, 120, 87, 0.3);
}

.btn--primary:hover {
  background: #059669;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.35);
  transform: translateY(-1px);
}

.btn--secondary {
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  border: 1px solid rgba(15, 23, 42, 0.14);
}

.btn--secondary:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.22);
}

.btn--sm {
  padding: 0.4375rem 0.875rem;
  font-size: 0.875rem;
}

/* ── Page toolbar ─────────────────────────────────────────── */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-toolbar__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Give every toolbar control the same 40px height for a clean aligned row */
.page-toolbar .search-box,
.page-toolbar .filter-select,
.page-toolbar .btn {
  height: 40px;
  box-sizing: border-box;
}

.page-toolbar .search-box {
  padding-top: 0;
  padding-bottom: 0;
}

.page-toolbar .filter-select {
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.875rem;
}

.page-toolbar .btn {
  padding-top: 0;
  padding-bottom: 0;
}

.page-toolbar__hint {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0;
}

/* ── Search box ───────────────────────────────────────────── */
.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--color-bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base);
}

.search-box:focus-within {
  border-color: var(--color-accent-emerald);
}

.search-box__icon {
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.search-box__input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  width: 200px;
}

.search-box__input::placeholder {
  color: var(--color-text-secondary);
}

.filter-select {
  padding: 0.5rem 0.875rem;
  font-family: var(--font-family);
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-base);
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-accent-emerald);
}

/* ── Product modal: sectioned form ────────────────────────────── */
.product-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-section {
  padding: 1rem 1.125rem;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary, #f8fafc);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.form-section__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
  margin: 0;
}

/* Inputs sit on white inside the tinted section */
.form-section .form-input,
.form-section .form-textarea {
  background: #fff;
}

.form-section .form-group {
  gap: 0.375rem;
}

/* The file-drop preview image */
.file-drop__preview {
  max-height: 90px;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

/* ── Allergen picker (product modal) ──────────────────────────── */
.form-hint {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  margin: 0;
}

/* In a sectioned form the title already provides spacing above the picker */
.form-section .form-hint {
  margin-top: -0.25rem;
}

.allergen-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.allergen-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  background: #fff;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-full);
  cursor: pointer;
  user-select: none;
  transition: border-color var(--transition-base), background var(--transition-base), color var(--transition-base);
}

.allergen-chip:hover {
  border-color: rgba(220, 38, 38, 0.5);
}

.allergen-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.allergen-chip:has(input:checked) {
  background: rgba(220, 38, 38, 0.08);
  border-color: #dc2626;
  color: #b91c1c;
  font-weight: 600;
}

/* Allergen labels inside the menu table */
.allergen-cells {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.allergen-cell {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.table-muted {
  color: var(--color-text-tertiary);
}

/* ── Availability toggle (product modal) ──────────────────────── */
.available-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary, #f8fafc);
  cursor: pointer;
  user-select: none;
  transition: border-color var(--transition-base), background var(--transition-base);
}

.available-toggle:has(input:checked) {
  border-color: rgba(4, 120, 87, 0.35);
  background: rgba(4, 120, 87, 0.05);
}

.available-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.available-toggle__switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background var(--transition-base);
}

.available-toggle__switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-base);
}

.available-toggle input:checked~.available-toggle__switch {
  background: var(--color-accent-emerald);
}

.available-toggle input:checked~.available-toggle__switch::after {
  transform: translateX(18px);
}

.available-toggle__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.available-toggle__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.available-toggle__hint {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

/* ── Custom dropdown chevron for every <select> ───────────────
   Replace the cramped native arrow with a roomy custom one. */
select.filter-select,
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 16px;
  padding-right: 2.5rem;
}

/* Hide the IE/Edge legacy arrow */
select.filter-select::-ms-expand,
select.form-input::-ms-expand {
  display: none;
}

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

.stats-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-card {
  background: var(--color-bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.stat-card__icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card--blue .stat-card__icon-wrap {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.stat-card--green .stat-card__icon-wrap {
  background: rgba(4, 120, 87, 0.12);
  color: var(--color-accent-emerald);
}

.stat-card--amber .stat-card__icon-wrap {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.stat-card--purple .stat-card__icon-wrap {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.stat-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
  min-width: 0;
}

.stat-card__label {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.stat-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-card__trend {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: 0.125rem;
}

.stat-card__trend--up {
  color: #10b981;
}

.stat-card__trend--down {
  color: #ef4444;
}

/* ── Panels ───────────────────────────────────────────────── */
.dashboard__panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.panel {
  background: var(--color-bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.panel--full {
  grid-column: 1 / -1;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.panel__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.panel__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent-emerald);
  text-decoration: none;
  transition: opacity var(--transition-base);
}

.panel__link:hover {
  opacity: 0.75;
}

.panel__badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.06);
  color: var(--color-text-secondary);
}

.panel__body {
  padding: 1.25rem;
  flex: 1;
}

/* ── Top list (index page) ────────────────────────────────── */
.top-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.top-list__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.top-list__rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.top-list__name {
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-list__bar-wrap {
  width: 80px;
  height: 6px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 99px;
  overflow: hidden;
  flex-shrink: 0;
}

.top-list__bar {
  height: 100%;
  background: var(--color-accent-emerald);
  border-radius: 99px;
}

.top-list__img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.top-list__count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  min-width: 40px;
  text-align: right;
}

/* ── License block (index page) ──────────────────────────── */
.license-block {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.license-block__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.license-block__status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #047857;
}

.license-block__plan {
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(4, 120, 87, 0.1);
  color: #047857;
  border: 1px solid rgba(4, 120, 87, 0.2);
}

.license-block__rows {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.license-block__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.license-block__note {
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-tertiary, #94a3b8);
}

.license-block__label {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
}

.license-block__value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.license-block__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.license-block__badge--active {
  color: #047857;
  background: rgba(4, 120, 87, 0.1);
  border: 1px solid rgba(4, 120, 87, 0.2);
}

/* ── Settings layout ──────────────────────────────────────── */
.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

/* Settings card */
.settings-card {
  background: var(--color-bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.settings-card__header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.settings-card__action {
  margin-left: auto;
  flex-shrink: 0;
  text-decoration: none;
}

.settings-card__icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(4, 120, 87, 0.1);
  color: var(--color-accent-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 0.125rem;
}

.settings-card__subtitle {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.settings-card__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Logo upload */
.logo-upload {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.logo-upload__preview {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.logo-upload__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Zoom cursor only when a logo image is actually present */
.logo-upload__preview.has-logo {
  cursor: zoom-in;
}

/* Empty state when no logo is set */
.logo-upload__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.25rem;
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--color-text-tertiary);
  background: var(--color-bg-secondary, #f8fafc);
}

/* display:flex would otherwise override the hidden attribute */
.logo-upload__empty[hidden] {
  display: none;
}

/* Subtle zoom hint on hover over the logo thumbnail */
.logo-upload__preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='11' cy='11' r='7' stroke='white' stroke-width='2'/%3E%3Cpath d='M21 21l-4.3-4.3M11 8v6M8 11h6' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 22px no-repeat;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

/* Show zoom hint only when an actual logo image is present */
.logo-upload__preview.has-logo:hover::after {
  opacity: 1;
}

/* Logo zoom lightbox */
.logo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.82);
  padding: 2rem;
}

.logo-lightbox[hidden] {
  display: none;
}

.logo-lightbox__img {
  max-width: min(94vw, 900px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.logo-lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  font-size: 1.75rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition-base);
}

.logo-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.logo-upload__change {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent-emerald);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--transition-base);
}

.logo-upload__change:hover {
  background: #059669;
}

.logo-upload__info {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.logo-upload__name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.logo-upload__hint {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.logo-upload__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.125rem;
}

/* Ghost button — low-emphasis (e.g. logo remove) */
.btn--ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.btn--ghost:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* Compact icon-only button (e.g. remove a social row) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: border-color var(--transition-base), color var(--transition-base), background var(--transition-base);
}

.icon-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

/* A social link row: platform input + url input + remove icon */
.social-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.social-row .social-platform {
  flex: 0 0 32%;
}

.social-row .social-url {
  flex: 1;
}

/* Form elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-family);
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent-emerald);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.1);
}

/* Faint placeholders so they read clearly as hints, not entered data. */
.form-input::placeholder,
.form-textarea::placeholder {
  color: #cbd5e1;
  opacity: 1;
  /* Firefox lowers placeholder opacity by default */
}

.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-family);
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  box-sizing: border-box;
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent-emerald);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.1);
}

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

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

/* Tags editor */
/* Hero background editor */
.hero-type {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.hero-type__opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color var(--transition-base), background var(--transition-base);
}

.hero-type__opt:has(input:checked) {
  border-color: var(--color-accent-emerald);
  background: rgba(4, 120, 87, 0.05);
}

.hero-preview {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.hero-preview--lg {
  height: 140px;
  margin-bottom: 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.hero-gradient-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  align-items: flex-start;
}

/* Colour field: round swatch (clickable) + hex label */
.color-field .form-label,
.direction-field .form-label {
  display: block;
  margin-bottom: 0.5rem;
}

.color-field__control {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.color-field__swatch {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--color-border), 0 1px 3px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.color-field__input {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}

.color-field__hex {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Direction: 8 compass preset buttons */
.direction-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.375rem;
  max-width: 168px;
}

.direction-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--color-text-secondary);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-base), background var(--transition-base), color var(--transition-base);
}

.direction-btn:hover {
  border-color: var(--color-accent-emerald);
  color: var(--color-accent-emerald);
}

.direction-btn.is-active {
  background: var(--color-accent-emerald);
  border-color: var(--color-accent-emerald);
  color: #fff;
}

.logo-upload__preview--wide {
  width: 160px;
  height: 90px;
}

/* Save status pill (shown next to the Save button) */
.settings-save-status {
  display: none;
  margin-left: 0.75rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 999px;
  white-space: nowrap;
}

.settings-save-status.is-visible {
  display: inline-flex;
  align-items: center;
}

.settings-save-status.is-success {
  color: #15803d;
  background: #dcfce7;
}

.settings-save-status.is-error {
  color: #b91c1c;
  background: #fee2e2;
}

.settings-save-status.is-warning {
  color: #b45309;
  background: #fef3c7;
}

/* Multilingual field language tabs */
.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.lang-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: #eef2f7;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-md);
}

.lang-tab {
  min-width: 30px;
  padding: 0.3rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.lang-tab:hover:not(.is-active) {
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.6);
}

.lang-tab.is-active {
  color: var(--color-accent-emerald);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

/* Bordered group for a multilingual field */
.ml-group {
  padding: 0.875rem 1rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary, #f8fafc);
}

.ml-group .form-label-row {
  margin-bottom: 0.5rem;
}

.ml-group .form-input,
.ml-group .form-textarea {
  background: #fff;
}

.ml-group__hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.6875rem;
  color: var(--color-text-tertiary);
}

/* Weekly hours editor */
.hours-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hours-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  background: var(--color-bg-primary);
}

.hours-row.is-closed {
  background: var(--color-bg-secondary, #f8fafc);
}

.hours-row__day {
  flex: 0 0 130px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.hours-row__times {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.hours-row__times .form-input {
  width: auto;
  flex: 0 0 auto;
  padding: 0.4rem 0.6rem;
}

.hours-row.is-closed .hours-row__times {
  opacity: 0.45;
}

.hours-row__dash {
  color: var(--color-text-tertiary);
}

/* Closed toggle switch */
.hours-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  cursor: pointer;
  user-select: none;
}

.hours-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.hours-toggle__switch {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background var(--transition-base);
  flex-shrink: 0;
}

.hours-toggle__switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-base);
}

.hours-toggle input:checked~.hours-toggle__switch {
  background: #ef4444;
}

.hours-toggle input:checked~.hours-toggle__switch::after {
  transform: translateX(16px);
}

.hours-toggle__label {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  min-width: 46px;
}

.hours-row.is-closed .hours-toggle__label {
  color: #ef4444;
  font-weight: 500;
}

@media (max-width: 600px) {
  .hours-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .hours-row__day {
    flex-basis: 100%;
  }
}

.tags-group {
  margin-bottom: 1.25rem;
}

.tags-group:last-child {
  margin-bottom: 0;
}

.tags-group__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  margin: 0 0 0.75rem;
}

/* Trailing rule after the group title */
.tags-group__title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
}

.tags-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
  padding: 0.3rem 0.65rem 0.3rem 0.5rem;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  background: #fff;
  transition: border-color var(--transition-base), background var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
}

.tag-checkbox:hover {
  border-color: rgba(4, 120, 87, 0.5);
  color: var(--color-text-primary);
}

.tag-checkbox:active {
  transform: scale(0.97);
}

.tag-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* The check circle: empty ring by default, filled green when checked */
.tag-checkbox__box {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid rgba(15, 23, 42, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.tag-checkbox__box svg {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

/* Selected chip: soft green fill, green border, bold label */
.tag-checkbox input[type="checkbox"]:checked~.tag-checkbox__box {
  background: var(--color-accent-emerald);
  border-color: var(--color-accent-emerald);
}

.tag-checkbox input[type="checkbox"]:checked~.tag-checkbox__box svg {
  opacity: 1;
  transform: scale(1);
  color: #fff;
}

.tag-checkbox:has(input:checked) {
  background: rgba(4, 120, 87, 0.08);
  border-color: var(--color-accent-emerald);
  color: var(--color-accent-emerald);
  font-weight: 600;
}

/* ── Data table ───────────────────────────────────────────── */
.data-table-wrap {
  background: var(--color-bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.data-table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(15, 23, 42, 0.02);
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  vertical-align: middle;
}

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

.data-table tbody tr:hover td {
  background: rgba(15, 23, 42, 0.015);
}

/* Product cell */
.product-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.product-cell__img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

/* Clickable thumbnail → opens the zoom lightbox */
.product-cell__img--zoom {
  cursor: zoom-in;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.product-cell__img--zoom:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.product-cell__name {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 0.9375rem;
}

.product-cell__desc {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 0.125rem;
}

/* Badges */
.category-tag {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.06);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.price-cell {
  font-weight: 700;
  color: var(--color-text-primary);
  white-space: nowrap;
}

/* Per-item view count in the menu table */
.views-cell {
  white-space: nowrap;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}
.views-cell__icon {
  display: inline-flex;
  vertical-align: -2px;
  margin-right: 0.3rem;
  color: var(--color-text-tertiary);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.status-badge--active {
  color: #047857;
  background: rgba(4, 120, 87, 0.1);
  border: 1px solid rgba(4, 120, 87, 0.2);
}

.status-badge--inactive {
  color: var(--color-text-secondary);
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.label-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.label-tag--veg {
  color: #059669;
  background: rgba(5, 150, 105, 0.1);
}

.label-tag--halal {
  color: #d97706;
  background: rgba(217, 119, 6, 0.1);
}

/* Row actions */
.row-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.row-action-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-base);
}

.row-action-btn:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--color-text-primary);
  border-color: rgba(15, 23, 42, 0.18);
}

.row-action-btn--danger:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

/* ── Category grid ────────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.category-card {
  background: var(--color-bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 0.875rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow var(--transition-base), border-color var(--transition-base), opacity var(--transition-base);
  cursor: default;
}

/* Top row: drag handle · icon · actions (pushed to the right) */
.category-card__top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Drag handle + SortableJS drag states */
.category-card__drag {
  display: inline-flex;
  align-items: center;
  color: var(--color-text-tertiary);
  cursor: grab;
  flex-shrink: 0;
  padding: 0.25rem 0.1rem;
  border-radius: var(--radius-sm);
  touch-action: none;
}

.category-card__drag:active {
  cursor: grabbing;
}

.category-card__drag:hover {
  color: var(--color-text-secondary);
}

/* Smooth transform while siblings shuffle around the dragged item.
   Disable text selection so dragging never highlights the labels. */
.category-card {
  transition: box-shadow var(--transition-base), border-color var(--transition-base), transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  -webkit-user-select: none;
}

/* The faint gap left where the item will drop */
.category-card--ghost {
  opacity: 0.35;
  background: rgba(4, 120, 87, 0.06);
  border: 1.5px dashed var(--color-accent-emerald);
  box-shadow: none;
}

/* The element the user is actively holding (fallback clone) */
.category-card--drag {
  opacity: 1 !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
  transform: scale(1.02);
  cursor: grabbing;
}

/* The original card while a clone is being dragged */
.category-card--chosen {
  cursor: grabbing;
}

.category-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(15, 23, 42, 0.12);
}

.category-card[draggable="true"] {
  cursor: grab;
}

.category-card__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(4, 120, 87, 0.08);
  color: var(--color-accent-emerald, #047857);
}
/* Actions sit at the far right of the top row. */
.category-card__actions {
  flex-shrink: 0;
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}
/* Name spans the FULL card width on its own row — plenty of room, so words
   wrap normally (never split mid-word) and clamp to 2 lines if very long. */
.category-card__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.category-card__name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text-primary, #0f172a);
  line-height: 1.35;
  overflow-wrap: break-word;    /* only breaks a word if it truly can't fit */
  word-break: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.category-card__count {
  font-size: 0.82rem;
  color: var(--color-text-secondary, #64748b);
}

.category-card[draggable="true"]:active {
  cursor: grabbing;
}

.category-card__drag {
  color: rgba(15, 23, 42, 0.25);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: color var(--transition-base);
}

.category-card:hover .category-card__drag {
  color: rgba(15, 23, 42, 0.45);
}

.category-card__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(4, 120, 87, 0.1);
  color: var(--color-accent-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-card__body {
  flex: 1;
  min-width: 0;
}

.category-card__name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.category-card__count {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 0.125rem;
}

.category-card__actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* ── Period tabs (stats page) ─────────────────────────────── */
.period-tabs {
  position: relative;
  display: flex;
  gap: 0.25rem;
  background: rgba(15, 23, 42, 0.05);
  padding: 0.25rem;
  border-radius: var(--radius-md);
}

/* Linear/Vercel-style sliding highlight that follows the active tab */
.period-tabs__highlight {
  position: absolute;
  top: 0.25rem;
  left: 0;
  height: calc(100% - 0.5rem);
  background: var(--color-bg-secondary, #fff);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.06);
  /* Smooth spring with a tiny, refined overshoot (Linear/Vercel feel) */
  transition: transform 0.42s cubic-bezier(0.4, 0.85, 0.25, 1), width 0.42s cubic-bezier(0.4, 0.85, 0.25, 1);
  will-change: transform, width;
  pointer-events: none;
  z-index: 0;
}

.period-tab {
  position: relative;
  z-index: 1;
  padding: 0.4375rem 0.875rem;
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: color var(--transition-base);
  white-space: nowrap;
}

.period-tab:hover {
  color: var(--color-text-primary);
}

.period-tab--active {
  color: var(--color-text-primary);
  font-weight: 600;
}

/* ── Bar chart (stats page) ───────────────────────────────── */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 180px;
}

.bar-chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  height: 100%;
  justify-content: flex-end;
}

.bar-chart__val {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.bar-chart__bar {
  width: 100%;
  max-width: 48px;
  background: linear-gradient(180deg, var(--color-accent-emerald) 0%, #059669 100%);
  border-radius: 4px 4px 0 0;
  transition: opacity var(--transition-base);
  min-height: 4px;
}

.bar-chart__bar:hover {
  opacity: 0.8;
}

.bar-chart__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* ── Progress items (stats page) ─────────────────────────── */
/* Cap the height of the top-products / category-views lists and scroll when
   there are many rows, so the panels stay tidy. */
#statTopProducts,
#statCategoryViews {
  max-height: 320px;
  overflow-y: auto;
}
#statTopProducts::-webkit-scrollbar,
#statCategoryViews::-webkit-scrollbar { width: 6px; }
#statTopProducts::-webkit-scrollbar-thumb,
#statCategoryViews::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.15);
  border-radius: 3px;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}
.progress-item:last-child { border-bottom: none; }

.progress-item:last-child {
  border-bottom: none;
}

.progress-item__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.progress-item__name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.progress-item__value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.progress-item__bar-wrap {
  height: 6px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.progress-item__bar {
  height: 100%;
  background: var(--color-accent-emerald);
  border-radius: 99px;
  transition: width 0.6s ease;
}

.progress-item__bar--amber {
  background: #f59e0b;
}

/* ── QR layout ────────────────────────────────────────────── */
/* QR mode switch (single / per-table) */
.qr-mode-tabs {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  background: rgba(15, 23, 42, 0.05);
  padding: 0.25rem;
  border-radius: var(--radius-md);
}
.qr-mode-tab {
  padding: 0.4375rem 0.875rem;
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: color var(--transition-base), background var(--transition-base);
  white-space: nowrap;
}
.qr-mode-tab:hover { color: var(--color-text-primary); }
.qr-mode-tab--active {
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.qr-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
  align-items: start;
}
/* Tables card spans the full width (it holds a grid of QRs). */
.qr-card--tables { grid-column: 1 / -1; }

.qr-tables-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.qr-tables-toolbar__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}
.qr-tables-toolbar__field .form-input { width: 140px; }

.qr-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
}
.qr-table-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.qr-table-cell:hover {
  border-color: rgba(4, 120, 87, 0.25);
  box-shadow: var(--shadow-sm);
}
.qr-table-cell__qr canvas,
.qr-table-cell__qr img { display: block; width: 130px; height: 130px; }
.qr-table-cell__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
/* Per-table download buttons (PNG / SVG) */
.qr-table-cell__actions {
  display: flex;
  gap: 0.375rem;
  width: 100%;
}
.qr-table-cell__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.375rem 0.5rem;
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.qr-table-cell__btn:hover {
  color: var(--color-accent-emerald);
  background: rgba(4, 120, 87, 0.08);
  border-color: rgba(4, 120, 87, 0.25);
}

.qr-card {
  background: var(--color-bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.qr-card__header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.qr-card__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.qr-preview-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}

.qr-preview-frame__label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.qr-card__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem 1.25rem;
}

.qr-card__actions .btn {
  width: 100%;
  justify-content: center;
}

/* QR info sidebar */
.qr-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Link box */
.link-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: var(--color-bg-primary);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-md);
}

.link-box__url {
  flex: 1;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-family: ui-monospace, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-box__copy {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.link-box__copy:hover {
  background: rgba(4, 120, 87, 0.08);
  color: var(--color-accent-emerald);
  border-color: rgba(4, 120, 87, 0.2);
}

/* Tips list */
.tips-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.tips-list__item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.tips-list__icon {
  color: var(--color-accent-emerald);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none !important;
}
/* Kill the blur layer when hidden so Chrome can't leave it stuck over the page. */
.modal[hidden] .modal__overlay {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal__box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal__box--sm {
  max-width: 420px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.modal__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.modal__close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
}

.modal__close:hover {
  background: rgba(15, 23, 42, 0.08);
  color: var(--color-text-primary);
}

.modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

/* Delete / danger button */
.btn--danger {
  color: #fff;
  background: #ef4444;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}

.btn--danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

/* Confirm text in delete modal */
.modal__confirm-text {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.modal__confirm-text strong {
  color: var(--color-text-primary);
}

/* QR canvas wrapper — center the generated canvas/img */
#qrCanvas {
  display: flex;
  align-items: center;
  justify-content: center;
}

#qrCanvas canvas,
#qrCanvas img {
  display: block;
  border-radius: var(--radius-sm);
}

/* File drop zone */
.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 1.5rem;
  border: 2px dashed rgba(15, 23, 42, 0.15);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.file-drop:hover {
  border-color: var(--color-accent-emerald);
  background: rgba(4, 120, 87, 0.03);
  color: var(--color-accent-emerald);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1199px) {
  .qr-layout {
    grid-template-columns: 300px 1fr;
  }
}

@media (max-width: 1023px) {
  .dashboard__sidebar {
    transform: translateX(-100%);
  }

  .dashboard__sidebar.is-open {
    transform: translateX(0);
  }

  .dashboard__main {
    margin-left: 0;
  }

  .dashboard__menu-btn {
    display: flex;
  }

  .dashboard__profile-name {
    display: none;
  }

  .qr-layout {
    grid-template-columns: 1fr;
  }

  .qr-card__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .qr-card__actions .btn {
    width: auto;
    flex: 1;
  }
}

@media (max-width: 767px) {
  .dashboard__content {
    padding: 1.25rem 1rem;
  }

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

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

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

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

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

  .data-table thead th:nth-child(n+4),
  .data-table tbody td:nth-child(n+4) {
    display: none;
  }

  .logo-upload {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .page-toolbar__left {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box__input {
    width: 100%;
  }

  .period-tabs {
    overflow-x: auto;
  }
}

@media (max-width: 480px) {

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

  .bar-chart {
    height: 140px;
  }

  .bar-chart__val {
    display: none;
  }
}
/* ── Waiter-call bell (topbar) ──────────────────────────────────── */
.call-bell { position: relative; }
.call-bell__trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.call-bell__trigger:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--color-text-primary);
}
.call-bell.has-calls .call-bell__trigger {
  color: var(--color-accent-emerald, #047857);
  border-color: rgba(4, 120, 87, 0.35);
}
.call-bell__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  border-radius: 9px;
}
/* Ring animation when a new call arrives */
@keyframes call-ring {
  0%, 100% { transform: rotate(0); }
  20%      { transform: rotate(14deg); }
  40%      { transform: rotate(-12deg); }
  60%      { transform: rotate(8deg); }
  80%      { transform: rotate(-5deg); }
}
.call-bell.is-ringing .call-bell__trigger svg { animation: call-ring 0.7s ease; transform-origin: 50% 10%; }

.call-bell__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 280px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--color-bg-secondary, #fff);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  z-index: 200;
}
.call-bell__head {
  padding: 0.875rem 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-primary);
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}
.call-bell__empty {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-tertiary, #94a3b8);
}
.call-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}
.call-row:last-child { border-bottom: none; }
.call-row__info { display: flex; flex-direction: column; gap: 0.15rem; }
.call-row__table { font-size: 0.9375rem; font-weight: 700; color: var(--color-text-primary); }
.call-row__type { font-size: 0.75rem; color: var(--color-text-secondary); }
.call-row--bill .call-row__type { color: #b45309; font-weight: 600; }
.call-row__done {
  flex-shrink: 0;
  padding: 0.375rem 0.75rem;
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent-emerald, #047857);
  background: rgba(4, 120, 87, 0.08);
  border: 1px solid rgba(4, 120, 87, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.16s ease;
}
.call-row__done:hover { background: rgba(4, 120, 87, 0.16); }

/* ── License warning banner ────────────────────────────────────── */
.license-banner {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.125rem;
  margin-bottom: 1.25rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md, 10px);
  color: #92400e;
}
/* display:flex would otherwise defeat the `hidden` attribute — keep it hidden
   when there's nothing to warn about (no empty banner). */
.license-banner[hidden] { display: none; }
.license-banner__icon { flex-shrink: 0; color: #d97706; }
.license-banner__text { font-size: 0.9375rem; font-weight: 500; line-height: 1.4; }
/* Expired = stronger red */
.license-banner--expired {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.license-banner--expired .license-banner__icon { color: #dc2626; }
