/* ==========================================================================
   Admin dashboard theme - built on Bootstrap 5.3 (RTL).
   Light/dark come from Bootstrap's [data-bs-theme] on <html>; everything
   here is expressed as CSS variables so both themes stay in sync.
   ========================================================================== */

:root,
[data-bs-theme="light"] {
  --brand: #0e7c95;
  --brand-rgb: 14, 124, 149;
  --brand-strong: #0a6175;
  --brand-soft: rgba(14, 124, 149, .10);
  /* Gradient stops for the welcome card / login panel (Settings > Branding can override). */
  --hero-1: #0a6175;
  --hero-2: #0e7c95;
  --hero-3: #19a3bf;
  --auth-1: #0a4c5c;
  --auth-2: #0e7c95;
  --auth-3: #1aa4bf;
  --accent: #b7832f;              /* warm coffee-gold, used sparingly */
  --accent-soft: rgba(183, 131, 47, .12);

  --app-bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --border: #e4e8ec;
  --text: #1d2a33;
  --text-muted: #6b7a86;
  --sidebar-bg: #ffffff;
  --sidebar-text: #44535e;
  --sidebar-hover: #f1f5f7;
  --shadow-sm: 0 1px 2px rgba(16, 38, 46, .06);
  --shadow: 0 1px 3px rgba(16, 38, 46, .06), 0 6px 24px -12px rgba(16, 38, 46, .18);
  --logo-filter: none;

  --bs-body-bg: var(--app-bg);
  --bs-body-color: var(--text);
  --bs-secondary-color: var(--text-muted);
  --bs-border-color: var(--border);
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: var(--brand-rgb);
  --bs-link-hover-color: var(--brand-strong);
  --bs-tertiary-bg: var(--surface-2);
}

[data-bs-theme="dark"] {
  --brand: #3bb3cc;
  --brand-rgb: 59, 179, 204;
  --brand-strong: #6fcbdd;
  --brand-soft: rgba(59, 179, 204, .14);
  --hero-1: #0b3d4a;
  --hero-2: #0e5a6c;
  --hero-3: #127a91;
  --accent: #d9a85a;
  --accent-soft: rgba(217, 168, 90, .14);

  --app-bg: #0e1418;
  --surface: #151d22;
  --surface-2: #1a242a;
  --border: #26333b;
  --text: #e3e9ed;
  --text-muted: #8d9ca6;
  --sidebar-bg: #11181d;
  --sidebar-text: #aab7bf;
  --sidebar-hover: #1a242a;
  --shadow-sm: none;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .02), 0 8px 28px -14px rgba(0, 0, 0, .7);
  --logo-filter: brightness(0) invert(.92);

  --bs-body-bg: var(--app-bg);
  --bs-body-color: var(--text);
  --bs-secondary-color: var(--text-muted);
  --bs-border-color: var(--border);
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: var(--brand-rgb);
  --bs-link-hover-color: var(--brand-strong);
  --bs-tertiary-bg: var(--surface-2);
}

:root {
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 64px;
  --radius: 14px;
  --radius-sm: 10px;
  --bs-body-font-family: 'IBM Plex Sans Arabic', system-ui, 'Segoe UI', Tahoma, sans-serif;
  --bs-body-font-size: .935rem;
  --bs-border-radius: var(--radius-sm);
}

html { scroll-behavior: smooth; }
body { background: var(--app-bg); color: var(--text); -webkit-font-smoothing: antialiased; }
::selection { background: var(--brand-soft); }
a { text-decoration: none; }
.text-muted { color: var(--text-muted) !important; }
.fw-semibold { font-weight: 600 !important; }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* Disable transitions while the theme flips, so nothing animates mid-swap. */
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }

/* ---- Buttons (Bootstrap compiles colors, so re-point them at the brand) - */
.btn { --bs-btn-font-weight: 500; border-radius: var(--radius-sm); }
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-strong); --bs-btn-hover-border-color: var(--brand-strong);
  --bs-btn-active-bg: var(--brand-strong); --bs-btn-active-border-color: var(--brand-strong);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
  --bs-btn-focus-shadow-rgb: var(--brand-rgb);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #071a20; --bs-btn-hover-color: #071a20; --bs-btn-active-color: #071a20; --bs-btn-disabled-color: #071a20; }
.btn-outline-primary {
  --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: var(--brand-rgb);
}
.btn-soft {
  --bs-btn-color: var(--text); --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--border);
  --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--sidebar-hover); --bs-btn-hover-border-color: var(--border);
  --bs-btn-active-bg: var(--sidebar-hover); --bs-btn-active-border-color: var(--border);
}
.btn-icon { width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; font-size: 1.05rem; }
.btn-icon.btn-sm { width: 32px; height: 32px; font-size: .95rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: rgba(var(--brand-rgb), .6);
  box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .18);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-control, .form-select { border-radius: var(--radius-sm); background-color: var(--surface); border-color: var(--border); }
.form-label { font-weight: 500; margin-bottom: .4rem; }
.form-text { color: var(--text-muted); }
.input-group-text { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); }

/* ==========================================================================
   App shell
   ========================================================================== */
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-inline-end: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 1040;
  transition: width .22s ease, transform .25s ease;
}
.sidebar-brand {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: .6rem;
  padding-inline: 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; overflow: hidden;
}
.sidebar-brand img.logo-full { height: 40px; width: auto; max-width: 100%; object-fit: contain; filter: var(--logo-filter); }
.sidebar-brand img.logo-mark { display: none; height: 40px; width: 40px; object-fit: contain; filter: var(--logo-filter); }
/* No dashboard logo uploaded: the restaurant's name and its first letter. */
.brand-wordmark { display: flex; align-items: center; gap: .6rem; min-width: 0; font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand-wordmark span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-initial { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff; font-weight: 700; font-size: 1.1rem; }
.brand-initial.logo-mark { display: none; }
.brand-initial.has-image { background: transparent; }
.brand-initial.has-image img { width: 100%; height: 100%; object-fit: contain; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 1rem .75rem; scrollbar-width: thin; }
.nav-group-label {
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  color: var(--text-muted); text-transform: uppercase;
  padding: .9rem .75rem .45rem; white-space: nowrap;
}
.nav-group-label:first-child { padding-top: 0; }
.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .62rem .8rem; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-weight: 500;
  white-space: nowrap; position: relative;
  transition: background .15s ease, color .15s ease;
}
.sidebar-link i { font-size: 1.15rem; width: 1.4rem; text-align: center; flex-shrink: 0; }
.sidebar-link:hover { background: var(--sidebar-hover); color: var(--text); }
.sidebar-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.sidebar-link.active::before {
  content: ""; position: absolute; inset-inline-start: -.75rem; top: 22%; bottom: 22%;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.sidebar-link .badge-count {
  margin-inline-start: auto;
  font-size: .72rem; font-weight: 600; line-height: 1;
  padding: .3rem .5rem; border-radius: 99px;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.sidebar-link.active .badge-count { background: var(--surface); color: var(--brand); border-color: rgba(var(--brand-rgb), .25); }

.sidebar-footer { padding: .75rem; border-top: 1px solid var(--border); flex-shrink: 0; }
.sidebar-cta {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .8rem; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent); font-weight: 600; white-space: nowrap;
}
.sidebar-cta:hover { color: var(--accent); filter: brightness(.97); }
.sidebar-cta i { font-size: 1.15rem; width: 1.4rem; text-align: center; flex-shrink: 0; }

.app-main {
  margin-inline-start: var(--sidebar-w);
  min-height: 100vh; display: flex; flex-direction: column;
  transition: margin .22s ease;
}

/* Collapsed (desktop) - icon rail */
@media (min-width: 992px) {
  .sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
  .sidebar-collapsed .app-main { margin-inline-start: var(--sidebar-w-collapsed); }
  .sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 0; }
  .sidebar-collapsed .sidebar-brand .logo-full { display: none; }
  .sidebar-collapsed .sidebar-brand .logo-mark { display: block; }
  .sidebar-collapsed .sidebar-brand .brand-initial.logo-mark { display: inline-grid; }
  .sidebar-collapsed .nav-group-label { font-size: 0; padding: .5rem 0; margin: .4rem .9rem; border-top: 1px solid var(--border); }
  .sidebar-collapsed .nav-group-label:first-child { border-top: 0; margin-top: 0; }
  .sidebar-collapsed .sidebar-link, .sidebar-collapsed .sidebar-cta { justify-content: center; padding-inline: 0; }
  .sidebar-collapsed .sidebar-link span, .sidebar-collapsed .sidebar-link .badge-count,
  .sidebar-collapsed .sidebar-cta span { display: none; }
}

/* Mobile - off-canvas */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(100%); box-shadow: none; }       /* RTL: hidden off the right edge */
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  .sidebar-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .app-main { margin-inline-start: 0; }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 1035;
    background: rgba(8, 14, 18, .45); opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  .sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .sidebar-open { overflow: hidden; }
}

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 1020;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: .75rem;
  padding-inline: 1.5rem;
  background: color-mix(in srgb, var(--app-bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 600; font-size: 1.02rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .btn-icon { color: var(--text-muted); border-radius: 10px; }
.topbar .btn-icon:hover, .topbar .btn-icon[aria-expanded="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.user-chip { display: flex; align-items: center; gap: .55rem; padding: .25rem .35rem .25rem .7rem; border-radius: 99px; color: var(--text); border: 1px solid transparent; }
.user-chip:hover, .user-chip[aria-expanded="true"] { background: var(--surface); border-color: var(--border); color: var(--text); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff; font-weight: 700; font-size: .95rem;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.6rem; }

.dropdown-menu {
  --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--border);
  --bs-dropdown-link-active-bg: var(--brand-soft); --bs-dropdown-link-active-color: var(--brand);
  --bs-dropdown-link-hover-bg: var(--surface-2);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .4rem;
}
.dropdown-item { border-radius: 8px; padding: .5rem .7rem; display: flex; align-items: center; gap: .6rem; }
.dropdown-item i { color: var(--text-muted); }
.dropdown-item.active i { color: var(--brand); }

.content { padding: 1.75rem 1.5rem 2.5rem; flex: 1; width: 100%; max-width: 1400px; margin-inline: auto; }
.app-footer { padding: 1rem 1.5rem; color: var(--text-muted); font-size: .82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; border-top: 1px solid var(--border); }
@media (max-width: 575.98px) {
  .content { padding: 1.25rem 1rem 2rem; }
  .topbar { padding-inline: 1rem; }
}

/* Page header */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.45rem; font-weight: 700; margin: 0; }
.page-header .subtitle { color: var(--text-muted); margin: .3rem 0 0; }
.breadcrumb { --bs-breadcrumb-divider: '‹'; --bs-breadcrumb-divider-color: var(--text-muted); font-size: .82rem; margin-bottom: .35rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb-item.active { color: var(--text); }

/* ==========================================================================
   Surfaces
   ========================================================================== */
.card {
  --bs-card-bg: var(--surface); --bs-card-border-color: var(--border);
  --bs-card-cap-bg: transparent; --bs-card-border-radius: var(--radius);
  --bs-card-inner-border-radius: calc(var(--radius) - 1px);
  box-shadow: var(--shadow-sm);
}
.card-header { padding: 1rem 1.25rem; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card-header .card-title { margin: 0; font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.25rem; }

/* Stat cards */
.stat-card { display: flex; flex-direction: row; align-items: center; gap: 1rem; padding: 1.15rem 1.25rem; height: 100%; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-icon.tone-brand  { background: var(--brand-soft); color: var(--brand); }
.stat-icon.tone-accent { background: var(--accent-soft); color: var(--accent); }
.stat-icon.tone-rose   { background: rgba(214, 69, 96, .12); color: #d64560; }
.stat-icon.tone-violet { background: rgba(111, 84, 196, .12); color: #7b61d1; }
[data-bs-theme="dark"] .stat-icon.tone-rose { color: #f07d93; }
[data-bs-theme="dark"] .stat-icon.tone-violet { color: #a996ec; }
.stat-label { color: var(--text-muted); font-size: .85rem; margin-bottom: .1rem; }
.stat-value { font-size: 1.65rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: .85rem; font-weight: 500; color: var(--text-muted); }

/* Welcome banner */
.welcome {
  position: relative; overflow: hidden;
  border-radius: var(--radius); padding: 1.5rem 1.6rem;
  background: linear-gradient(120deg, var(--hero-1), var(--hero-2) 60%, var(--hero-3));
  color: #fff; box-shadow: var(--shadow);
}
.welcome h2 { font-size: 1.35rem; font-weight: 700; margin: 0 0 .3rem; }
.welcome p { margin: 0; opacity: .88; }
.welcome .btn-light { --bs-btn-color: var(--hero-1); --bs-btn-hover-color: var(--hero-1); font-weight: 600; }
.welcome-mark { position: absolute; inset-inline-end: -10px; bottom: -40px; width: 170px; opacity: .13; pointer-events: none; }

/* Tables */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); --bs-table-hover-bg: var(--surface-2); margin-bottom: 0; }
.table > thead th { font-size: .78rem; font-weight: 600; color: var(--text-muted); background: var(--surface-2); border-bottom-width: 1px; white-space: nowrap; padding-block: .75rem; }
.table > :not(caption) > * > * { padding: .8rem 1rem; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-card { overflow: hidden; }
.table-card .table-responsive { border-radius: 0 0 var(--radius) var(--radius); }

.thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); flex-shrink: 0; }
.thumb-lg { width: 100%; height: auto; aspect-ratio: 4/3; border-radius: var(--radius); }
.thumb-placeholder { display: grid; place-items: center; color: var(--text-muted); font-size: 1.15rem; }
.cell-title { font-weight: 600; color: var(--text); }
a.cell-title:hover { color: var(--brand); }
.cell-sub { font-size: .8rem; color: var(--text-muted); }
.price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price small { font-weight: 500; color: var(--text-muted); font-size: .75em; }
.allergen-icons img { width: 22px; height: 22px; object-fit: contain; }
.allergen-icons img + img { margin-inline-start: 4px; }

.badge-soft { background: var(--brand-soft); color: var(--brand); font-weight: 600; border-radius: 99px; padding: .38em .7em; }
.badge-muted { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); font-weight: 500; border-radius: 99px; padding: .35em .65em; }
.badge-warn { background: var(--accent-soft); color: var(--accent); font-weight: 600; border-radius: 99px; padding: .38em .7em; }

.row-actions { display: inline-flex; gap: .25rem; }
.row-actions .btn { color: var(--text-muted); }
.row-actions .btn:hover { color: var(--brand); background: var(--brand-soft); }
.row-actions .btn.text-danger-hover:hover { color: #d64560; background: rgba(214, 69, 96, .1); }

/* Toolbar (search + filters above lists) */
.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.search-box { position: relative; flex: 1 1 260px; max-width: 420px; }
.search-box i { position: absolute; inset-inline-start: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-box .form-control { padding-inline-start: 2.4rem; padding-inline-end: 2.6rem; }
.search-box kbd { position: absolute; inset-inline-end: .55rem; top: 50%; transform: translateY(-50%); font-size: .7rem; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); padding: .1rem .4rem; }

/* Pagination */
.pagination { --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--border); --bs-pagination-color: var(--text); --bs-pagination-hover-bg: var(--surface-2); --bs-pagination-hover-color: var(--brand); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-disabled-bg: var(--surface); margin: 0; }
.card-footer { background: transparent; border-top: 1px solid var(--border); padding: .9rem 1.25rem; }
.card-footer nav > .d-sm-flex { gap: .75rem; }
.card-footer p.small { margin: 0; color: var(--text-muted); }

/* Empty state */
.empty-state { text-align: center; padding: 3.5rem 1.5rem; }
.empty-state .empty-icon { width: 72px; height: 72px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 1.9rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.08rem; font-weight: 600; margin-bottom: .35rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.25rem; }

/* Image picker */
.image-picker { position: relative; display: block; cursor: pointer; border: 1.5px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; aspect-ratio: 4/3; transition: border-color .15s ease, background .15s ease; }
.image-picker:hover, .image-picker.dragover { border-color: var(--brand); background: var(--brand-soft); }
.image-picker.is-invalid { border-color: var(--bs-form-invalid-border-color); }
.image-picker input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.image-picker .preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.image-picker .preview[src=""], .image-picker .preview:not([src]) { display: none; }
.image-picker .placeholder-ui { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; color: var(--text-muted); text-align: center; padding: 1rem; }
.image-picker .placeholder-ui i { font-size: 2rem; color: var(--brand); }
.image-picker.has-image .placeholder-ui { display: none; }
.image-picker .change-hint { position: absolute; inset-inline: .6rem; bottom: .6rem; display: none; justify-content: center; }
.image-picker.has-image .change-hint { display: flex; }
.image-picker .change-hint span { background: rgba(10, 20, 25, .7); color: #fff; font-size: .78rem; padding: .3rem .7rem; border-radius: 99px; backdrop-filter: blur(4px); }
.image-picker.square { aspect-ratio: 1; max-width: 160px; }
.image-picker.square .preview { object-fit: contain; padding: 1.25rem; }

/* Allergen choice chips */
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check label { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); cursor: pointer; user-select: none; font-size: .88rem; transition: all .15s ease; }
.chip-check label img { width: 20px; height: 20px; object-fit: contain; }
.chip-check label:hover { border-color: rgba(var(--brand-rgb), .5); }
.chip-check input:checked + label { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.chip-check input:focus-visible + label { box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .25); }

/* Section bars (dashboard) */
.bar-row + .bar-row { margin-top: .95rem; }
.bar-row .bar-meta { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: .35rem; }
.bar-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--hero-3)); }

/* Checklist (dashboard data quality) */
.check-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; }
.check-row + .check-row { border-top: 1px dashed var(--border); }
.check-row .check-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.check-row.ok .check-icon { background: rgba(46, 160, 98, .12); color: #2ea062; }
.check-row.warn .check-icon { background: var(--accent-soft); color: var(--accent); }

/* Quick actions */
.quick-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; padding: 1.1rem .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--surface); text-align: center; font-weight: 500; font-size: .88rem; height: 100%; transition: all .15s ease; }
.quick-action i { font-size: 1.4rem; color: var(--brand); }
.quick-action:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* Detail list */
.detail-list { margin: 0; }
.detail-list > div { display: flex; gap: 1rem; padding: .75rem 0; border-bottom: 1px dashed var(--border); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { width: 150px; flex-shrink: 0; font-weight: 500; color: var(--text-muted); }
.detail-list dd { margin: 0; flex: 1; }

/* Toasts */
.toast-container { z-index: 1090; }
.toast { overflow: hidden; --bs-toast-bg: var(--surface); --bs-toast-border-color: var(--border); --bs-toast-color: var(--text); box-shadow: var(--shadow); border-radius: var(--radius-sm); }
.toast .toast-body { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; }
.toast .toast-icon { font-size: 1.25rem; }
.toast.toast-success .toast-icon { color: #2ea062; }
.toast.toast-danger .toast-icon { color: #d64560; }
.toast .toast-progress { height: 3px; background: currentColor; opacity: .35; transform-origin: left; animation: toast-progress 5s linear forwards; }
.toast.toast-success .toast-progress { color: #2ea062; }
.toast.toast-danger .toast-progress { color: #d64560; }
@keyframes toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Modals */
.modal-content { background: var(--surface); border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.modal-header, .modal-footer { border-color: var(--border); }
.modal-danger-icon { width: 54px; height: 54px; border-radius: 50%; display: inline-grid; place-items: center; background: rgba(214, 69, 96, .12); color: #d64560; font-size: 1.5rem; margin-bottom: .9rem; }

/* Auth pages */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem; color: #fff; background: linear-gradient(150deg, var(--auth-1), var(--auth-2) 55%, var(--auth-3)); }
.auth-aside .auth-watermark { position: absolute; inset-inline-end: -70px; bottom: -70px; width: 400px; opacity: .1; pointer-events: none; }
.auth-aside h1 { font-size: 2rem; font-weight: 700; line-height: 1.35; max-width: 440px; }
.auth-aside p { opacity: .85; max-width: 420px; }
.auth-aside .logo-chip { display: inline-flex; align-items: center; background: rgba(255, 255, 255, .95); border-radius: 14px; padding: .6rem 1rem; align-self: flex-start; }
.auth-aside .logo-chip img { height: 42px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; position: relative; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: .35rem; }
.auth-card .lead-muted { color: var(--text-muted); margin-bottom: 1.75rem; }
.auth-card .form-control { padding: .7rem .9rem; }
.auth-theme { position: absolute; top: 1rem; inset-inline-end: 1rem; }
.auth-mobile-logo { display: none; height: 46px; margin-bottom: 1.5rem; filter: var(--logo-filter); }
@media (max-width: 991.98px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-mobile-logo { display: block; }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Small-screen fixes
   ========================================================================== */
/* Labels never break across lines (a two-line pill looks broken). */
.badge-soft, .badge-muted, .badge-warn { display: inline-block; white-space: nowrap; }
.price, .stat-value { white-space: nowrap; }

/* Square image pickers sit in flex columns: give them a real width,
   otherwise they collapse to 0px and there is nothing to tap. */
.image-picker.square { width: 160px; max-width: 100%; }

/* Secondary line shown under a name only where its column is hidden. */
.cell-meta { margin-top: .25rem; }

@media (max-width: 575.98px) {
  /* Stat cards: icon above the text, so labels and numbers get full width. */
  .stat-card { flex-direction: column; align-items: flex-start; gap: .7rem; padding: 1rem; }
  .stat-icon { width: 40px; height: 40px; font-size: 1.15rem; border-radius: 10px; }
  .stat-value { font-size: 1.45rem; }
  .table > :not(caption) > * > * { padding: .7rem .5rem; }
  .table > :not(caption) > * > *:first-child { padding-inline-start: .85rem; }
  .table > :not(caption) > * > *:last-child { padding-inline-end: .6rem; }
  .thumb { width: 40px; height: 40px; }
  .table .gap-3 { gap: .65rem !important; }
  .row-actions { gap: 0; }
  .page-header h1 { font-size: 1.3rem; }
  .welcome { padding: 1.25rem; }
  .welcome h2 { font-size: 1.15rem; }
}

/* Settings tabs */
.settings-tabs { --bs-nav-pills-link-active-bg: var(--brand-soft); --bs-nav-pills-link-active-color: var(--brand); gap: .35rem; }
.settings-tabs .nav-link { color: var(--text-muted); font-weight: 500; border-radius: 99px; padding: .45rem 1rem; display: inline-flex; align-items: center; gap: .4rem; }
.settings-tabs .nav-link:hover { color: var(--text); background: var(--surface); }
.settings-tabs .nav-link.active { font-weight: 600; }
/* Logo preview on the menu's own dark background, as customers see it. */
.image-picker.on-dark { background: #273a54; border-color: #273a54; }
.image-picker.on-dark .placeholder-ui { color: #c9d3dc; }

/* Settings tabs scroll sideways on phones instead of wrapping. */
.settings-tabs-wrap { overflow-x: auto; scrollbar-width: none; margin-inline: -.25rem; padding-inline: .25rem; }
.settings-tabs-wrap::-webkit-scrollbar { display: none; }
.settings-tabs .nav-link { white-space: nowrap; }

/* Avatar photo (falls back to the initial). */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-xl { width: 96px; height: 96px; font-size: 2.2rem; }
.image-picker.round { width: 132px; height: 132px; aspect-ratio: 1; border-radius: 50%; min-height: 0; }
.image-picker.round .preview { object-fit: cover; }
.image-picker.round .placeholder-ui small { display: none; }

/* ==========================================================================
   Settings > contact links
   ========================================================================== */
.social-list { border-top: 1px solid var(--border); }
.social-row {
  display: flex; align-items: center; gap: .85rem;
  padding: .8rem 1rem; border-bottom: 1px solid var(--border);
  transition: background-color .2s, opacity .2s;
}
.social-row:last-child { border-bottom: 0; }
.social-row:not(.is-enabled) .social-icon { filter: grayscale(1); opacity: .55; }
.social-row:not(.is-enabled) .form-label { color: var(--text-muted); }
.social-row.just-moved { background: var(--brand-soft); }
.social-move { display: flex; flex-direction: column; gap: 2px; }
.social-move .btn { width: 26px; height: 22px; padding: 0; line-height: 1; color: var(--text-muted); border-radius: 6px; }
.social-move .btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.social-move .btn:disabled { opacity: .25; }
.social-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.25rem;
  background: var(--accent-soft); color: var(--accent);
  transition: filter .2s, opacity .2s;
}
.social-field { flex: 1; min-width: 0; }
.social-field .form-label { font-weight: 600; font-size: .9rem; }
.social-toggle { margin: 0; padding-inline-start: 2.6em; }
.social-toggle .form-check-input { width: 2.6em; height: 1.4em; cursor: pointer; }
@media (max-width: 575.98px) {
  .social-row { gap: .6rem; padding: .75rem .7rem; }
  .social-icon { width: 36px; height: 36px; font-size: 1.05rem; border-radius: 10px; }
}

/* Phone-shaped preview of the public menu. */
.preview-card { position: sticky; top: 84px; }
.phone-preview {
  position: relative; width: 100%; max-width: 270px; margin-inline: auto;
  aspect-ratio: 9 / 17; border-radius: 28px; overflow: hidden;
  border: 7px solid #1d2a33; box-shadow: var(--shadow);
  background: #273a54 center / cover no-repeat; isolation: isolate;
}
.phone-preview .pp-bg {
  position: absolute; inset: 0; z-index: -1;
  background: center / cover no-repeat; transition: filter .25s, transform .25s, background-image .25s;
}
.phone-preview .pp-bg::after { content: ""; position: absolute; inset: 0; background: rgba(var(--bg-overlay-rgb, 0, 0, 0), var(--bg-overlay, 0)); transition: background-color .2s; }
.phone-preview .pp-bg.is-blurred { filter: blur(calc(var(--bg-blur, 0px) * .7)); transform: scale(1.12); }
.phone-preview-inner {
  height: 100%; overflow: auto; padding: 1.4rem 1rem; text-align: center; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45); scrollbar-width: none;
}
.pp-title { font-weight: 700; font-size: 1.15rem; }
.pp-sub { font-size: .8rem; opacity: .85; margin-bottom: .6rem; }
.pp-intro { font-size: .78rem; opacity: .9; margin-bottom: .8rem; }
.pp-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.pp-links li { display: flex; align-items: center; justify-content: center; gap: .45rem; font-weight: 700; font-size: .85rem; word-break: break-all; }
.pp-links i { color: #daa053; font-size: 1.05rem; }
.pp-empty { font-size: .8rem; opacity: .8; margin-top: 1rem; }
.pp-logo { max-width: 110px; max-height: 70px; margin: .5rem auto 1rem; display: block; }
.pp-btn { display: block; margin: .4rem auto; width: 75%; padding: .3rem; border-radius: 99px; background: #dcd3c4; color: #273a54; font-size: .72rem; font-weight: 600; text-shadow: none; }
.pp-hero { width: 82%; aspect-ratio: 300 / 170; margin: .2rem auto .8rem; border-radius: 12px; border: 1px solid #f29c1e; background: rgba(255, 255, 255, .15) center / cover no-repeat; }
.pp-row { display: flex; justify-content: space-between; font-size: .75rem; font-weight: 700; padding: .15rem .4rem; }

/* ==========================================================================
   Settings > appearance
   ========================================================================== */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; }
.choice-card { position: relative; display: block; margin: 0; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card .choice-body {
  height: 100%; display: flex; flex-direction: column; gap: .35rem;
  padding: .9rem 1rem; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.choice-card:hover .choice-body { border-color: rgba(var(--brand-rgb), .5); }
.choice-card input:checked + .choice-body { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12); }
.choice-card input:focus-visible + .choice-body { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice-title { font-weight: 600; display: flex; align-items: center; gap: .45rem; }
.choice-title i { color: var(--brand); font-size: 1.1rem; }
.choice-desc { font-size: .82rem; color: var(--text-muted); line-height: 1.6; }
.choice-card .choice-check { position: absolute; top: .65rem; inset-inline-end: .7rem; color: var(--brand); opacity: 0; transition: opacity .15s; }
.choice-card input:checked ~ .choice-check { opacity: 1; }
.choice-badge { font-size: .7rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: .05rem .5rem; align-self: flex-start; }

.bg-picker .image-picker { aspect-ratio: 3 / 4; max-width: 230px; margin-inline: auto; }
.bg-picker .image-picker .preview { object-position: center bottom; }
.form-range::-webkit-slider-thumb { background: var(--brand); }
.form-range::-moz-range-thumb { background: var(--brand); }
.form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 .25rem rgba(var(--brand-rgb), .25); }
.range-value { min-width: 3.2rem; text-align: center; font-weight: 600; }
.preview-tabs { display: flex; gap: .25rem; justify-content: center; margin-bottom: .75rem; flex-wrap: wrap; }
.preview-tabs .btn { font-size: .78rem; padding: .2rem .75rem; border-radius: 99px; background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.preview-tabs .btn:hover { color: var(--text); border-color: rgba(var(--brand-rgb), .5); }
.preview-tabs .btn.active, .preview-tabs .btn.active:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.bg-source { font-size: .8rem; color: var(--text-muted); text-align: center; margin-top: .6rem; }
.bg-source strong { color: var(--text); }
.image-picker.round { flex-shrink: 0; }
.image-picker.round .change-hint { bottom: 1rem; }
.image-picker.round .placeholder-ui { padding: .5rem; font-size: .8rem; }
.image-picker.round .placeholder-ui i { font-size: 1.6rem; }

/* ==========================================================================
   Settings > fonts
   ========================================================================== */
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .65rem; }
.font-choice .font-name { font-size: .8rem; font-weight: 600; line-height: 1.4; }
.font-choice .choice-body { gap: .45rem; padding: .8rem .9rem; }
.font-sample { font-size: 1.25rem; line-height: 1.6; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-inline-end: 1.2rem; }
.type-list { border-top: 1px solid var(--border); }
.type-row { padding: .9rem 1rem; border-bottom: 1px solid var(--border); transition: background-color .15s; }
.type-row:last-child { border-bottom: 0; }
.type-row:hover, .type-row:focus-within { background: var(--surface-2); }
.type-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .7rem; }
.type-head .min-w-0 { min-width: 0; flex: 1; }
.type-reset { color: var(--text-muted); text-decoration: none; white-space: nowrap; font-size: .8rem; }
.type-reset:hover { color: var(--brand); }
.type-controls { display: grid; grid-template-columns: 1.3fr 1.4fr .8fr; gap: .75rem; align-items: end; padding-inline-start: calc(42px + .75rem); }
.type-font select { font-size: .95rem; }
@media (max-width: 767.98px) {
  .type-controls { grid-template-columns: 1fr 1fr; padding-inline-start: 0; }
  .type-controls .type-size { grid-column: 1 / -1; grid-row: 2; }
}

/* The preview reads the same CSS variables as the public menu. */
.font-preview .phone-preview-inner { font-family: var(--t-base-font, defaultFont); }
.font-preview .t-title     { font-family: var(--t-title-font);     font-size: var(--t-title-size);     font-weight: var(--t-title-weight); }
.font-preview .t-subtitle  { font-family: var(--t-subtitle-font);  font-size: var(--t-subtitle-size);  font-weight: var(--t-subtitle-weight); }
.font-preview .t-buttons   { font-family: var(--t-buttons-font);   font-size: var(--t-buttons-size);   font-weight: var(--t-buttons-weight); }
.font-preview .t-body      { font-family: var(--t-body-font);      font-size: var(--t-body-size);      font-weight: var(--t-body-weight); }
.font-preview .t-item-name { font-family: var(--t-item-name-font); font-size: var(--t-item-name-size); font-weight: var(--t-item-name-weight); }
.font-preview .t-item-meta { font-family: var(--t-item-meta-font); font-size: var(--t-item-meta-size); font-weight: var(--t-item-meta-weight); }
.font-preview .t-price     { font-family: var(--t-price-font);     font-size: var(--t-price-size);     font-weight: var(--t-price-weight); line-height: 1; white-space: nowrap; }
.font-preview .t-price sup { font-size: .55em; font-weight: 400; }
.font-preview .t-contact   { font-family: var(--t-contact-font);   font-size: var(--t-contact-size);   font-weight: var(--t-contact-weight); }
.font-preview .t-contact.is-long { font-size: calc(var(--t-contact-size) * .85); }
.font-preview .t-allergens { font-family: var(--t-allergens-font); font-size: var(--t-allergens-size); font-weight: var(--t-allergens-weight); }
.font-preview .t-allergen-name { font-family: var(--t-allergens-font); font-size: calc(var(--t-allergens-size) * .7); }
.font-preview .t-notes     { font-family: var(--t-notes-font);     font-size: var(--t-notes-size);     font-weight: var(--t-notes-weight); }
/* The phone is ~70% of a real screen: scale the text the same way. */
.font-preview .phone-preview-inner { zoom: .72; height: calc(100% / .72); padding: 1.6rem 1.2rem; }
.font-preview .pp-btn { width: 85%; padding: .45rem; margin: .45rem auto; line-height: 1.4; }
.font-preview .pp-btn-accent { background: #f29c1e; color: #fff; }
.pp-link { color: #f29c1e; }
.pp-items { margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.pp-item { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.pp-highlight { outline: 2px dashed #ffd27a; outline-offset: 3px; border-radius: 4px; }

/* Logo tips (Settings > restaurant) */
.alert-transparent-tip { display: flex; gap: .55rem; align-items: flex-start; background: var(--accent-soft); color: var(--text); border: 1px solid rgba(183, 131, 47, .25); border-radius: 10px; padding: .65rem .8rem; }
.alert-transparent-tip i { color: var(--accent); font-size: 1.1rem; line-height: 1.3; }
.logo-check { display: flex; gap: .4rem; align-items: flex-start; text-align: start; border-radius: 8px; padding: .45rem .6rem; width: 100%; }
.logo-check.is-ok { background: rgba(46, 160, 98, .12); color: #2ea062; }
.logo-check.is-warn { background: rgba(214, 140, 30, .14); color: #b8720f; }
@media (max-width: 575.98px) {
  .font-grid { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .font-choice .choice-body { padding: .65rem .7rem; }
  .font-sample { font-size: 1.05rem; padding-inline-end: 1rem; }
  .font-choice .choice-desc { display: none; }
}

/* Overlay colour swatches (Settings > appearance) */
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.swatch { position: relative; width: 34px; height: 34px; border-radius: 50%; padding: 0; cursor: pointer; background: var(--swatch); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); transition: box-shadow .15s, transform .15s; }
.swatch:hover { transform: scale(1.08); }
.swatch.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand); }
.swatch-custom { display: grid; place-items: center; background: conic-gradient(#e44, #ec4, #4c6, #4ce, #46e, #c4e, #e44); color: #fff; overflow: hidden; }
.swatch-custom i { font-size: .85rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); pointer-events: none; }
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.base-sample { display: flex; flex-direction: column; gap: .15rem; padding: .7rem 1rem; border-radius: 10px; background: #273a54; color: #fff; min-height: 76px; justify-content: center; }
.base-sample-title { font-size: 1.35rem; font-weight: 700; color: #f29c1e; line-height: 1.5; }
.base-sample-text { font-size: .95rem; opacity: .9; }

/* Per-page tint/blur (Settings > appearance) */
.fx-link { padding: .75rem .9rem; border-radius: 10px; background: var(--brand-soft); margin-bottom: .85rem; }
.fx-link .form-check-input { width: 2.6em; height: 1.4em; cursor: pointer; }
.fx-link .form-check-label { cursor: pointer; padding-top: .1rem; }
.fx-pages { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .75rem; }
.fx-page { border: 1px solid var(--border); border-radius: 10px; padding: .75rem .9rem; transition: border-color .15s, background-color .15s; }
.fx-page.is-current { border-color: rgba(var(--brand-rgb), .55); background: var(--surface-2); }
.fx-page-title { display: flex; align-items: center; gap: .5rem; font-weight: 600; margin-bottom: .5rem; }
.fx-page-title > i { color: var(--brand); }
.fx-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1.25rem; }
.fx-name-all { display: none; }
.fx-pages.is-linked .fx-page:not([data-fx-page="home"]) { display: none; }
.fx-pages.is-linked .fx-name-single { display: none; }
.fx-pages.is-linked .fx-name-all { display: inline; }
@media (max-width: 575.98px) { .fx-sliders { grid-template-columns: 1fr; } }

/* Per-group text colour (Settings > fonts) */
.type-controls { grid-template-columns: 1.3fr 1.4fr .8fr 1fr; }
.color-field { display: flex; align-items: center; gap: .4rem; height: calc(1.5em + .5rem + 2px); padding: 0 .35rem; border: 1px solid var(--border); border-radius: var(--bs-border-radius-sm, .25rem); background: var(--surface); }
.color-dot { position: relative; width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; cursor: pointer; background: var(--dot); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); overflow: hidden; }
.color-dot input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.color-label { flex: 1; font-size: .8rem; color: var(--text-muted); direction: ltr; text-align: right; white-space: nowrap; }
.color-field.is-custom .color-label { color: var(--text); font-weight: 600; }
.color-clear { width: 22px; height: 22px; padding: 0; font-size: .7rem; color: var(--text-muted); display: none; }
.color-field.is-custom .color-clear { display: inline-grid; place-items: center; }
@media (max-width: 767.98px) {
  .type-controls { grid-template-columns: 1fr 1fr; }
  .type-controls .type-size { grid-column: 1 / -1; grid-row: 2; }
}

/* ==========================================================================
   Settings > colours
   ========================================================================== */
.color-controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; padding-inline-start: calc(42px + .75rem); }
@media (max-width: 767.98px) { .color-controls { padding-inline-start: 0; grid-template-columns: 1fr 1fr; } }
.logo-palette.is-suggested { border-color: rgba(var(--brand-rgb), .45); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .08); }
.logo-palette-logo { width: 110px; height: 110px; flex-shrink: 0; border-radius: 14px; background: #273a54; display: grid; place-items: center; padding: .6rem; }
.logo-palette-logo img { max-width: 100%; max-height: 100%; }
.palette-swatches { display: flex; flex-wrap: wrap; gap: .45rem; min-height: 34px; align-items: center; }
.palette-swatch { width: 34px; height: 34px; border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0, .1); }

/* Colour preview: same variables as the public menu. */
.color-preview .cp-btn { display: block; width: 78%; margin: .4rem auto; padding: .35rem; border-radius: 99px; font-size: .75rem; font-weight: 600; text-shadow: none; background: var(--c-btn-bg, #dcd3c4); color: var(--c-btn-text, #273a54); }
.color-preview .cp-btn.is-accent { background: var(--c-accent-bg, #f29c1e); color: var(--c-accent-text, #fff); }
.color-preview .cp-back { display: inline-grid; place-items: center; width: 42px; height: 24px; border-radius: 14px; background: var(--c-back-bg, #dcd3c4); color: var(--c-back-text, #273a54); font-size: .85rem; text-shadow: none; }
.color-preview .cp-frame { width: 86%; margin: .8rem auto .6rem; border-radius: 14px; padding: var(--c-frame-width, 1px); background: var(--c-frame, #f29c1e); }
.color-preview .cp-photo { aspect-ratio: 300 / 170; border-radius: 13px; background: #556 center / cover no-repeat; }
.color-preview .cp-icon { fill: var(--c-icons, #daa053); flex-shrink: 0; }
.pp-logo-text { font-weight: 700; font-size: 1.15rem; color: #f29c1e; margin: 1.2rem 0 1rem; }
.auth-aside .logo-chip .brand-wordmark { color: #1d2a33; }
.auth-mobile-logo.brand-wordmark { height: auto; }

/* Settings > branding */
.brand-image .image-picker:not(.square) { aspect-ratio: 16 / 7; }
.tab-preview { display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem; border-radius: 10px 10px 0 0; background: var(--surface-2); border: 1px solid var(--border); border-bottom: 0; max-width: 260px; font-size: .85rem; }
.tab-preview img { width: 18px; height: 18px; object-fit: contain; border-radius: 3px; }
.tab-preview span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-preview { display: flex; align-items: center; min-height: 64px; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--sidebar-bg); }
.sidebar-preview img { max-height: 40px; max-width: 100%; filter: var(--logo-filter); }
.sidebar-preview.is-mark { width: 72px; justify-content: center; }
.sidebar-preview.is-mark img { width: 40px; height: 40px; object-fit: contain; }

/* Section tree */
.section-tree .tree-elbow { color: var(--text-muted); opacity: .6; margin-inline-end: -.4rem; }
.move-items-box { border: 1px solid rgba(183, 131, 47, .35); background: var(--accent-soft); border-radius: 10px; padding: .6rem .8rem; }
.subsection-card { display: flex; align-items: center; gap: .75rem; padding: .8rem; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.subsection-card:hover { border-color: rgba(var(--brand-rgb), .5); box-shadow: var(--shadow-sm); color: var(--text); }
.subsection-card .thumb { width: 48px; height: 48px; }
