[hidden] { display: none !important; }
/* Aviyaan One / One Sales base layout and components (docs/UI_UX.md §2–§3, §7). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}
a { color: var(--brand-gold-strong); }
a:hover { color: var(--brand-gold-hover); }
:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
img { max-width: 100%; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--sp-3); top: -48px; z-index: 100;
  background: var(--ink); color: #fff; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--sp-3); color: #fff; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
}
.sidebar__brand {
  display: flex; align-items: center; gap: var(--sp-2);
  height: var(--topbar-h); padding: 0 var(--sp-4); border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.sidebar__brand img { height: 34px; width: auto; }
.sidebar__brand span { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; }
.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar__brand-name { font-family: var(--font-display); font-size: var(--text-base) !important; font-weight: 600; color: var(--ink); }
.sidebar__brand-tagline { font-family: var(--font-ui) !important; font-size: 10px !important; font-weight: 500; color: var(--ink-muted); letter-spacing: 0.02em; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: var(--sp-3) var(--sp-2); }
.nav-link {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 40px; padding: var(--sp-2) var(--sp-3); margin-bottom: 2px;
  border-radius: var(--radius-sm); color: var(--ink-muted); text-decoration: none; font-weight: 500;
}
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-link:hover { background: var(--canvas); color: var(--ink); }
.nav-link.is-active { background: var(--brand-gold-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--brand-gold); }
.sidebar__section { margin: var(--sp-4) var(--sp-3) var(--sp-2); font-size: var(--text-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); }
.sidebar__footer { border-top: 1px solid var(--line); padding: var(--sp-2); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--sp-3);
  height: var(--topbar-h); padding: 0 var(--sp-5);
  background: rgba(255, 255, 255, 0.95); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.topbar__spacer { flex: 1; }
.topbar__date { color: var(--ink-muted); font-size: var(--text-sm); }
.menu-toggle { display: none; }

.profile { position: relative; }
.profile summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2); border-radius: var(--radius); min-height: 40px;
}
.profile summary::-webkit-details-marker { display: none; }
.profile summary:hover { background: var(--canvas); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--brand-gold-soft); color: var(--brand-gold-strong); font-weight: 700; font-size: var(--text-sm);
}
.profile__name { font-weight: 600; line-height: 1.2; }
.profile__role { font-size: var(--text-xs); color: var(--ink-muted); line-height: 1.2; }
.profile__menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: var(--sp-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.profile__menu a, .profile__menu button {
  display: block; width: 100%; text-align: left; padding: var(--sp-2) var(--sp-3); min-height: 40px;
  border: 0; background: none; font: inherit; color: var(--ink); text-decoration: none; border-radius: var(--radius-sm); cursor: pointer;
}
.profile__menu a:hover, .profile__menu button:hover { background: var(--canvas); }

.content { padding: var(--sp-5); max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.page-title { margin: 0; font-size: var(--text-xl); font-weight: 700; }
.page-subtitle { margin: var(--sp-1) 0 0; color: var(--ink-muted); }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: var(--sp-5); }
.card + .card { margin-top: var(--sp-4); }
.card__title { margin: 0 0 var(--sp-3); font-size: var(--text-md); font-weight: 600; }

.grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 40px; padding: var(--sp-2) var(--sp-4); border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--canvas); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand-gold-strong); border-color: var(--brand-gold-strong); color: #fff; }
.btn--primary:hover { background: var(--brand-gold-hover); border-color: var(--brand-gold-hover); color: #fff; }
.btn--danger { background: var(--status-danger); border-color: var(--status-danger); color: #fff; }
.btn--danger:hover { background: var(--status-danger); color: #fff; filter: brightness(.9); }
.btn--success { background: var(--status-success, #276B43); border-color: var(--status-success, #276B43); color: #fff; }
.btn--success:hover { background: #1e5535; border-color: #1e5535; color: #fff; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn--small svg { width: 14px; height: 14px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn.is-loading { opacity: .6; cursor: progress; }

.chip { display: inline-flex; align-items: center; gap: var(--sp-1); padding: 2px var(--sp-2); border-radius: 999px; font-size: var(--text-xs); font-weight: 600; background: var(--status-neutral-bg); color: var(--status-neutral); }
.chip--gold { background: var(--brand-gold-soft); color: var(--brand-gold-hover); }

/* Forms */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; margin-bottom: var(--sp-1); font-weight: 600; }
.field .required { color: var(--status-danger); }
.input,
.field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.field select,
.field textarea {
  width: 100%; min-height: 42px; padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  font: inherit; color: var(--ink);
}
.input:focus-visible, .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: var(--focus-outline); outline-offset: 1px; border-color: var(--brand-gold-strong); }
.input[aria-invalid="true"], .field [aria-invalid="true"] { border-color: var(--status-danger); }
.input[aria-invalid="true"] { border-color: var(--status-danger); }
.field__help { margin-top: var(--sp-1); font-size: var(--text-sm); color: var(--ink-muted); }
.field__error { margin-top: var(--sp-1); font-size: var(--text-sm); color: var(--status-danger); }
.form-errors { margin-bottom: var(--sp-4); padding: var(--sp-3); border-radius: var(--radius); background: var(--status-danger-bg); color: var(--status-danger); }
.form-errors p { margin: 0; }

/* Empty state */
.empty { text-align: center; padding: var(--sp-7) var(--sp-5); color: var(--ink-muted); }
.empty svg { width: 40px; height: 40px; color: var(--brand-gold); margin-bottom: var(--sp-3); }
.empty h2 { margin: 0 0 var(--sp-2); font-size: var(--text-md); color: var(--ink); }
.empty p { margin: 0 auto; max-width: 460px; }

/* Toasts (Django messages) */
.toasts { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 60; display: grid; gap: var(--sp-2); max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.toast--error { background: var(--status-danger); }
.toast--success { background: var(--status-success); }
.toast button { margin-left: auto; border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; min-width: 40px; min-height: 40px; }

/* HTMX request indicator */
.htmx-indicator { opacity: 0; transition: opacity .15s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-5) var(--sp-4); background: radial-gradient(circle at top, var(--brand-gold-soft), var(--canvas) 55%); }
.auth__card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: var(--sp-6) var(--sp-5); }
.auth__logo { display: block; width: 180px; height: auto; margin: 0 auto var(--sp-3); }
.auth__title { margin: 0; text-align: center; font-family: var(--font-display); font-size: 28px; font-weight: 600; }
.auth__tagline { margin: var(--sp-1) 0 0; text-align: center; font-size: var(--text-xs); font-weight: 500; color: var(--ink-muted); }
.auth__subtitle { margin: var(--sp-1) 0 var(--sp-5); text-align: center; color: var(--ink-muted); }
.auth__links { margin-top: var(--sp-4); text-align: center; font-size: var(--text-sm); }
.link-button { border: 0; background: none; padding: var(--sp-2); min-height: 40px; font: inherit; color: var(--brand-gold-strong); text-decoration: underline; cursor: pointer; }
.lock-user { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.avatar--lg { width: 48px; height: 48px; font-size: var(--text-lg); }
.input--pin, .field input.input--pin { text-align: center; font-size: 24px; letter-spacing: .6em; padding-left: .6em; }

/* ---------- Responsive (desktop first, UI_UX §2) ---------- */
@media (max-width: 1279px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1023px) {
  .sidebar { width: var(--sidebar-w-collapsed); }
  .sidebar__brand span, .nav-link span, .sidebar__section { display: none; }
  .nav-link { justify-content: center; }
  .main { margin-left: var(--sidebar-w-collapsed); }
  .grid, .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .sidebar { width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar__brand span, .nav-link span, .sidebar__section { display: initial; }
  .nav-link { justify-content: flex-start; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; }
  .backdrop { display: none; position: fixed; inset: 0; z-index: 35; background: rgba(31, 26, 18, .35); }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 var(--sp-3); }
  .topbar__date, .profile__text { display: none; }
  .content { padding: var(--sp-4) var(--sp-3); }
  .grid, .grid--2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .sidebar, .topbar, .toasts { display: none !important; } .main { margin: 0; } }

/* ---------- Utilities ---------- */
.muted { color: var(--ink-muted); }
.small { font-size: var(--text-sm); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mb-3 { margin-bottom: var(--sp-3); }

/* ---------- Buttons & chips (extra variants) ---------- */
.btn--small { min-height: 32px; padding: 3px var(--sp-3); font-size: var(--text-sm); }

/* ---------- Quiet (Ghost) Buttons (UI_UX §3) ---------- */
.btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-muted);
  font-weight: 500;
  box-shadow: none;
}
.btn--quiet:hover {
  background: var(--canvas);
  color: var(--ink);
  border-color: transparent;
}
.btn--quiet:active {
  background: var(--line);
  color: var(--ink);
  transform: translateY(1px);
}
.btn--quiet:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 1px;
}

/* Destructive / Danger Quiet Buttons (e.g. "Remove", "Cancel") */
.btn--quiet.danger,
.btn--quiet.btn--danger,
.btn--quiet[data-destructive] {
  color: var(--status-danger);
  border-color: transparent;
  background: transparent;
}
.btn--quiet.danger:hover,
.btn--quiet.btn--danger:hover,
.btn--quiet[data-destructive]:hover {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border-color: rgba(180, 35, 24, 0.2);
}
.btn--quiet.danger:active,
.btn--quiet.btn--danger:active {
  background: #f7d5d2;
}

/* ---------- Back & Next Navigation Buttons (UI_UX §3 Breadcrumb-Style) ---------- */
.btn--back,
.btn--next {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 32px;
  padding: 4px var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn--back:hover,
.btn--next:hover {
  color: var(--ink);
  background: var(--canvas);
  border-color: var(--line);
  text-decoration: none;
}
.btn--back:active,
.btn--next:active {
  background: var(--line);
}
.btn--back .btn__arrow,
.btn--back svg,
.btn--back .arrow {
  display: inline-block;
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1);
  font-size: 1.15em;
  line-height: 1;
}
.btn--back:hover .btn__arrow,
.btn--back:hover svg,
.btn--back:hover .arrow {
  transform: translateX(-3px);
  color: var(--brand-gold-strong);
}
.btn--next .btn__arrow,
.btn--next svg,
.btn--next .arrow {
  display: inline-block;
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1);
  font-size: 1.15em;
  line-height: 1;
}
.btn--next:hover .btn__arrow,
.btn--next:hover svg,
.btn--next:hover .arrow {
  transform: translateX(3px);
  color: var(--brand-gold-strong);
}

.chip--success { background: var(--status-success-bg); color: var(--status-success); }
.chip--warning { background: var(--status-warning-bg); color: var(--status-warning); }
.chip--danger { background: var(--status-danger-bg); color: var(--status-danger); }
.chip--info { background: var(--status-info-bg); color: var(--status-info); }

/* ---------- Page bits ---------- */
.breadcrumb { margin-bottom: var(--sp-2); font-size: var(--text-sm); color: var(--ink-muted); }
.breadcrumb a { color: var(--ink-muted); }
.card--flush { padding: 0; overflow: visible; }
.card--form { max-width: 760px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.card__head .card__title { margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-4); }

.filter-bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.filter-bar .input:first-of-type { flex: 1 1 260px; }
.input--auto { width: auto; }

/* ---------- Table (cards on phones; UI_UX §2–§3) ---------- */
.table-wrap { overflow-x: auto; }
.table-wrap--menus { overflow: visible; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.table th { position: sticky; top: 0; background: var(--canvas); text-align: left; font-size: var(--text-sm); color: var(--ink-muted); font-weight: 600; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: #FCFBF8; }
.table tbody tr:last-child td { border-bottom: 0; }
/* ---------- Table Action Buttons (UI_UX §3 Modern Subtle/Ghost) ---------- */
.table__actions {
  white-space: nowrap;
  text-align: right;
}
.table__actions > * {
  margin-left: var(--sp-1);
}
.table__actions .btn,
.btn--action {
  min-height: 30px;
  padding: 2px var(--sp-3);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-muted);
  box-shadow: 0 1px 2px rgba(31, 26, 18, 0.04);
}
.table__actions .btn:hover,
.btn--action:hover {
  background: var(--canvas);
  color: var(--ink);
  border-color: #d8d2c6;
  box-shadow: 0 1px 3px rgba(31, 26, 18, 0.08);
}
.table__actions .btn:active,
.btn--action:active {
  background: var(--line);
  transform: translateY(1px);
}

/* Primary action inside table: explicitly marked, or the last non-quiet/non-danger link */
.table__actions .btn--action-primary,
.table__actions .btn--primary,
.table__actions > a.btn:last-child:not(.btn--quiet):not(.btn--danger):not(.danger) {
  background: var(--brand-gold-soft);
  border-color: rgba(193, 154, 47, 0.35);
  color: var(--brand-gold-strong);
  font-weight: 600;
}
.table__actions .btn--action-primary:hover,
.table__actions .btn--primary:hover,
.table__actions > a.btn:last-child:not(.btn--quiet):not(.btn--danger):not(.danger):hover {
  background: #f1e4c9;
  border-color: var(--brand-gold);
  color: var(--brand-gold-hover);
}

/* Quiet buttons in table actions */
.table__actions .btn--quiet {
  box-shadow: none;
  border-color: transparent;
  background: transparent;
}
.table__actions .btn--quiet:hover {
  background: var(--canvas);
  border-color: transparent;
}

.pagination { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); }
.pagination__info { margin-right: auto; color: var(--ink-muted); font-size: var(--text-sm); }

/* ---------- Row action menu ---------- */
.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu__list { position: absolute; right: 0; max-height: 70vh; overflow-y: auto; top: calc(100% + 4px); z-index: 20; min-width: 210px; padding: var(--sp-1); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-align: left; }
.menu__list button { display: block; width: 100%; min-height: 40px; padding: var(--sp-2) var(--sp-3); border: 0; background: none; font: inherit; color: var(--ink); text-align: left; border-radius: var(--radius-sm); cursor: pointer; }
.menu__list button:hover { background: var(--canvas); }
.menu__list button.danger { color: var(--status-danger); }

/* ---------- Setup checklist & link lists ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist__item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--line); }
.checklist__item:first-child { border-top: 0; }
.checklist__mark { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--status-warning-bg); color: var(--status-warning); }
.checklist__item.is-done .checklist__mark { background: var(--status-success-bg); color: var(--status-success); }
.checklist__text { flex: 1; display: flex; flex-direction: column; }
.checklist__detail { color: var(--ink-muted); font-size: var(--text-sm); }
.link-list { display: flex; flex-direction: column; }
.link-list a { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3) var(--sp-2); border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; border-radius: var(--radius-sm); }
.link-list a:first-child { border-top: 0; }
.link-list a span { color: var(--ink-muted); font-size: var(--text-sm); }
.link-list a:hover { background: var(--canvas); }

/* ---------- Drawer (create/edit; UI_UX §3) ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(31, 26, 18, .35); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 55; width: min(480px, 100vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: -8px 0 24px rgba(31, 26, 18, .12); }
.drawer[hidden], .drawer-backdrop[hidden] { display: none; }
#drawer-body { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line); }
.drawer__title { margin: 0; font-size: var(--text-lg); }
.drawer__close { border: 0; background: none; font-size: 26px; line-height: 1; min-width: 40px; min-height: 40px; cursor: pointer; color: var(--ink-muted); border-radius: var(--radius-sm); }
.drawer__close:hover { background: var(--canvas); color: var(--ink); }
.drawer__form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--sp-5); }
.drawer__foot { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--line); background: var(--canvas); }
body.drawer-open { overflow: hidden; }

.secret-box { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-4); margin: var(--sp-4) 0; padding: var(--sp-4); border: 1px dashed var(--brand-gold); border-radius: var(--radius); background: var(--brand-gold-soft); }
.secret-box dt { font-weight: 600; color: var(--ink-muted); }
.secret-box dd { margin: 0; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.secret-box code { font-size: var(--text-lg); letter-spacing: .05em; color: var(--ink); }
.field input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--brand-gold-strong); vertical-align: middle; }

@media (max-width: 767px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: var(--sp-1) 0; }
  .table td[data-label]:not(.table__primary)::before { content: attr(data-label) ": "; color: var(--ink-muted); font-size: var(--text-sm); }
  .table__actions { text-align: left; padding-top: var(--sp-2) !important; }
  .table__actions > * { margin: 0 var(--sp-1) 0 0; }
  .drawer { width: 100vw; }
  .btn--small, .table__actions .btn { min-height: 38px; }
  .menu__list { left: 0; right: auto; }
  /* Primary page action stays reachable at the bottom on phones (UI_UX §2). */
  .page-head > .btn--primary, .page-head .page-actions > .btn--primary { position: fixed; left: var(--sp-3); right: var(--sp-3); bottom: var(--sp-3); z-index: 30; box-shadow: var(--shadow); }
  .content { padding-bottom: 88px; }
  .filter-bar .input, .input--auto { width: 100%; }
}

/* Loading state for HTMX-refreshed lists */
.card.htmx-request { opacity: .6; transition: opacity .15s; }
.error-summary { margin-bottom: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); background: var(--status-danger-bg); color: var(--status-danger); font-weight: 600; }

/* ---------- CRM screens (step 4) ---------- */
.page-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.tabs { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-bottom: var(--sp-4); border-bottom: 1px solid var(--line); }
.tabs__link { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding: var(--sp-2) var(--sp-3); color: var(--ink-muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs__link:hover { color: var(--ink); }
.tabs__link.is-active { color: var(--ink); border-bottom-color: var(--brand-gold); }
.tabs__count { min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--canvas); color: var(--ink-muted); font-size: var(--text-xs); text-align: center; }
.tabs__count--alert { background: var(--status-danger-bg); color: var(--status-danger); }
.tabs__spacer { flex: 1; }
.chip--muted { background: var(--status-neutral-bg); color: var(--status-neutral); }
.card__head--padded { padding: var(--sp-4) var(--sp-4) 0; }

.notice { margin-bottom: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); background: var(--status-info-bg); color: var(--ink); }
.notice--warning { background: var(--status-warning-bg); }
.notice ul { margin: var(--sp-2) 0; padding-left: var(--sp-5); }
.fieldset { border: 0; padding: 0; margin: 0 0 var(--sp-5); }
.fieldset legend { padding: 0; margin-bottom: var(--sp-3); font-weight: 700; color: var(--ink); }
.grid--tight { gap: 0 var(--sp-3); }
.checkbox { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-2); font-weight: 600; }

.suggestions { position: relative; }
.suggestions__list { list-style: none; margin: var(--sp-1) 0 0; padding: var(--sp-1); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.suggestions__list button { display: flex; flex-direction: column; width: 100%; text-align: left; padding: var(--sp-2) var(--sp-3); min-height: 44px; border: 0; background: none; font: inherit; color: var(--ink); border-radius: var(--radius-sm); cursor: pointer; }
.suggestions__list button:hover, .suggestions__list button:focus-visible { background: var(--brand-gold-soft); }
.suggestions__none { margin: var(--sp-1) 0 0; }

/* ---------- Occasion Picker (Combobox) ---------- */
.occasion-picker { position: relative; width: 100%; }
.occasion-picker__control { position: relative; width: 100%; }
.occasion-picker__input-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.occasion-picker__input { width: 100%; padding-right: 56px !important; }
.occasion-picker__clear {
  position: absolute; right: 28px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--ink-muted); font-size: 18px; line-height: 1;
  padding: 4px; cursor: pointer; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
}
.occasion-picker__clear:hover { color: var(--ink); }
.occasion-picker__toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--ink-muted); padding: 6px;
  cursor: pointer; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
}
.occasion-picker__toggle:hover { color: var(--ink); background: var(--canvas); }
.occasion-picker__dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); max-height: 250px; overflow-y: auto;
}
.occasion-picker__results { padding: var(--sp-1); display: flex; flex-direction: column; gap: 2px; }
.occasion-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-2) var(--sp-3); min-height: 38px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: var(--text-base); color: var(--ink); text-align: left;
  border: 0; background: none; width: 100%; font-family: inherit;
}
.occasion-option:hover, .occasion-option--focused { background: var(--brand-gold-soft); }
.occasion-option--selected { font-weight: 600; color: var(--brand-gold-strong); }
.occasion-option--create {
  color: var(--brand-gold-strong); font-weight: 600; border-top: 1px solid var(--line);
  margin-top: 4px; padding-top: var(--sp-2);
}
.occasion-option--create:hover, .occasion-option--create.occasion-option--focused {
  background: var(--brand-gold-soft);
}
.occasion-option--empty {
  padding: var(--sp-2) var(--sp-3); color: var(--ink-muted); font-size: var(--text-sm);
}
.occasion-badge-similar {
  font-size: 11px; padding: 2px 6px; border-radius: var(--radius-sm);
  background: #fef3c7; color: #92400e; font-weight: 500;
}
.occasion-picker__similar-prompt {
  margin-top: var(--sp-2);
}
.occasion-similar-alert {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-sm);
  padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2);
  font-size: var(--text-sm); color: #78350f;
}
.occasion-similar-alert__content {
  display: flex; align-items: flex-start; gap: var(--sp-2);
}
.occasion-similar-alert__icon { flex-shrink: 0; stroke: #d97706; margin-top: 2px; }
.occasion-similar-alert__actions {
  display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; margin-left: 24px;
}

.details { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: var(--sp-2) var(--sp-4); margin: 0; }
.details dt { color: var(--ink-muted); font-size: var(--text-sm); }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); }
.task-list .task:first-child { border-top: 0; }
.task-list--compact .task { padding: var(--sp-2) 0; }
.task__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.task__actions { display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.task--overdue { box-shadow: inset 3px 0 0 var(--status-danger); }
.task--overdue .task__main .muted { color: var(--status-danger); }
.task--closed .task__main strong { color: var(--ink-muted); text-decoration: line-through; }

.discussion-list { list-style: none; margin: 0; padding: 0; }
.discussion-item { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); }
.discussion-list .discussion-item:first-child { border-top: 0; }
.discussion-item__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.discussion-item__meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.discussion-item__notes { font-size: var(--text-sm); line-height: 1.55; color: var(--ink); white-space: pre-line; word-break: break-word; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { position: relative; display: flex; gap: var(--sp-3); padding-bottom: var(--sp-4); }
.timeline__item:not(:last-child)::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline__dot { flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand-gold); }
.timeline__item--status_changed .timeline__dot { border-color: var(--status-info); }
.timeline__item--activity_logged .timeline__dot { background: var(--brand-gold); }
.timeline__title { font-weight: 600; }
.timeline__text { margin-top: 2px; white-space: normal; }
.timeline__meta { margin-top: 2px; }

.status-move { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-4); }

/* Step 4 review fixes */
.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 767px) { .details { grid-template-columns: 1fr; } .details dd { margin-bottom: var(--sp-2); } }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: var(--sp-3); }
.segmented__item { padding: var(--sp-2) var(--sp-3); color: var(--ink-muted); text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.segmented__item + .segmented__item { border-left: 1px solid var(--line); }
.segmented__item.is-active { background: var(--brand-gold-soft); color: var(--ink); font-weight: 600; }
.segmented__item:focus-visible { outline: var(--focus-outline); outline-offset: -2px; }
.char-count { font-size: var(--text-sm); color: var(--ink-muted); text-align: right; }
.char-count.is-short { color: var(--status-danger); }


/* Step 5: enquiries, functions, holds, calendar */
.grid--3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
@media (max-width: 480px) { .grid--3 { grid-template-columns: 1fr 1fr; } }
.fieldset--inner { margin-top: var(--sp-3); }
.notice--success { background: var(--status-success-bg); color: var(--status-success); border-color: transparent; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.chip--button { border: 0; cursor: pointer; min-height: 32px; font: inherit; font-size: var(--text-xs); }
.chip--button:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.availability-check { margin: calc(-1 * var(--sp-2)) 0 var(--sp-3); }
.availability-free { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-top: var(--sp-2); }

.function-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-4); }
@media (max-width: 480px) { .function-grid { grid-template-columns: 1fr; } }
.function-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.function-card--held { border-left: 4px solid var(--status-warning); }
.function-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-2); }
.function-card__title { margin: 0; font-size: var(--text-lg); overflow-wrap: anywhere; }
.function-card__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin: 0; }
.function-card__facts dt { color: var(--ink-muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .03em; }
.function-card__facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .function-card__facts { grid-template-columns: 1fr 1fr; } }
.function-card__hold { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.function-card__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: auto; padding-top: var(--sp-2); border-top: 1px solid var(--line); }

.calendar-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.calendar-head__title { margin: 0 var(--sp-2); font-size: var(--text-lg); min-width: 10ch; text-align: center; }
.month-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--sp-4); align-items: start; }
@media (max-width: 1023px) { .month-layout { grid-template-columns: 1fr; } }
.month-grid { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.month-grid th { padding: var(--sp-2); font-size: var(--text-xs); color: var(--ink-muted); text-align: left; border-bottom: 1px solid var(--line); }
.month-grid__day { vertical-align: top; height: 104px; padding: var(--sp-1); border: 1px solid var(--line); overflow: hidden; }
.month-grid__day.is-outside { background: var(--status-neutral-bg); }
.month-grid__day.is-outside .month-grid__date { color: var(--ink-muted); }
.month-grid__day.is-today .month-grid__date { background: var(--brand-gold-strong); color: #fff; }
.month-grid__day.is-selected { box-shadow: inset 0 0 0 2px var(--brand-gold-strong); }
.month-grid__date { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 28px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: var(--text-sm); }
.month-grid__date:focus-visible { outline: var(--focus-outline); outline-offset: 1px; }
@media (max-width: 767px) {
  .month-grid__day { height: 64px; }
  .month-grid .event-pill--compact .event-pill__title, .month-grid .event-pill--compact .event-pill__meta { display: none; }
}
.day-panel { position: sticky; top: var(--sp-4); }

.event-pill { display: flex; flex-wrap: wrap; gap: 0 var(--sp-2); align-items: baseline; padding: 2px var(--sp-2); margin-top: 2px; border-radius: var(--radius-sm); border-left: 3px solid; font-size: var(--text-xs); text-decoration: none; color: var(--ink); min-width: 0; }
.event-pill--tentative { background: var(--status-warning-bg); border-color: var(--status-warning); }
.event-pill--confirmed { background: var(--status-success-bg); border-color: var(--status-success); }
.event-pill__time { font-weight: 700; font-variant-numeric: tabular-nums; }
.event-pill__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.event-pill__meta { color: var(--ink-muted); }
.event-pill--compact { flex-wrap: nowrap; overflow: hidden; }
.event-pill--compact .event-pill__meta { display: none; }
a.event-pill:hover { filter: brightness(0.97); }
a.event-pill:focus-visible { outline: var(--focus-outline); outline-offset: 1px; }
.agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.agenda .event-pill { font-size: var(--text-sm); padding: var(--sp-2); }
.agenda-day { margin-bottom: var(--sp-3); }
.schedule { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.schedule__item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
.schedule__time { font-weight: 700; font-variant-numeric: tabular-nums; padding-top: var(--sp-2); }
.schedule .event-pill { font-size: var(--text-sm); padding: var(--sp-2); }

.availability-grid th[scope="row"] { min-width: 160px; }
.slot-cell { min-width: 130px; }
.slot-cell__state { display: inline-block; font-weight: 600; font-size: var(--text-sm); padding: 2px var(--sp-2); border-radius: var(--radius-sm); margin-right: var(--sp-2); }
.slot-cell--free .slot-cell__state { color: var(--status-success); box-shadow: inset 0 0 0 1px var(--status-success); }
.slot-cell--hold .slot-cell__state { color: var(--status-warning); background: var(--status-warning-bg); }
.slot-cell--reserved .slot-cell__state { color: var(--status-danger); background: var(--status-danger-bg); }
.availability-check.htmx-request { opacity: .6; transition: opacity .15s; }
.event-pill__state { font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: .04em; }
.event-pill--tentative .event-pill__state { color: var(--status-warning); }
.event-pill--confirmed .event-pill__state { color: var(--status-success); }
@media (max-width: 767px) {
  .chip--button { min-height: 40px; padding: 0 var(--sp-3); }
  .month-grid__date { min-width: 40px; min-height: 40px; }
  .month-grid a.event-pill { pointer-events: none; }  /* tap the date; events open in the day panel */
  .table th[scope="row"] { display: block; position: static; white-space: normal; min-width: 0; }
  .table td.num { text-align: left; }
}


/* Step 6: quotations, approvals */
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--brand-gold-strong); color: #fff; font-size: var(--text-xs); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 0; margin: 0 0 var(--sp-4); }
.stepper__item a { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: 999px; color: var(--ink-muted); text-decoration: none; background: var(--surface); }
.stepper__item.is-current a { border-color: var(--brand-gold-strong); color: var(--ink); font-weight: 600; background: var(--brand-gold-soft); }
.stepper__item a:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.stepper__num { width: 22px; height: 22px; border-radius: 999px; background: var(--status-neutral-bg); display: inline-flex; align-items: center; justify-content: center; font-size: var(--text-xs); font-weight: 700; }
.stepper__item.is-current .stepper__num { background: var(--brand-gold-strong); color: #fff; }
.wizard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-4); align-items: start; }
.wizard-aside { position: sticky; top: var(--sp-4); }
@media (max-width: 1023px) {
  .wizard-layout { grid-template-columns: 1fr; }
  .wizard-aside { position: sticky; bottom: 0; top: auto; order: 1; z-index: 5; }
  .wizard-aside .money-card { box-shadow: var(--shadow); }
}
.money-card .money-table { max-width: none !important; margin: 0 !important; }
.money-card .money-table td { padding: 2px 0 !important; }
.document-preview { overflow-x: auto; }
.document-preview table { min-width: 0; }
@media (max-width: 767px) {
  .wizard-aside .money-card { padding: var(--sp-3); }
  .wizard-aside .money-card .money-table tr:not(:last-child),
  .wizard-aside .money-card p, .wizard-aside .money-card .card__title { display: none; }
}
.nav-link .nav-badge { display: inline-flex !important; }
@media (min-width: 768px) and (max-width: 1023px) {
  .nav-link { position: relative; }
  .nav-link .nav-badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; font-size: 10px; }
}
.btn.htmx-request, .menu__list button.htmx-request { opacity: .6; cursor: progress; }
.field__group { border: 0; padding: 0; margin: 0; }
.field__group legend { font-weight: 600; margin-bottom: var(--sp-1); padding: 0; }
.field__group ul, .field__group > div > div { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.field__group label { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 40px; font-weight: 400; }
.document-preview table { font-size: 12px; }


/* Chef menu (SPEC §7.9, D84): one card per package course, dishes with a diet mark */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
@media (max-width: 480px) { .course-grid { grid-template-columns: 1fr; } }
.course-card--over { border-color: var(--status-danger); }
.course-card__foot { padding: var(--sp-2) var(--sp-4) var(--sp-3); border-top: 1px solid var(--line); }
.dish-list { list-style: none; margin: 0; padding: var(--sp-2) var(--sp-4); }
.dish { display: flex; align-items: center; gap: var(--sp-2); min-height: 40px; border-bottom: 1px solid var(--line); }
.dish:last-child { border-bottom: 0; }
.dish__name { flex: 1; }
/* Indian food mark: green square = veg, brown-red = non-veg, both = split */
.dish__diet { flex: none; width: 14px; height: 14px; border: 2px solid #1B7F3A; border-radius: 3px; position: relative; }
.dish__diet::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: #1B7F3A; }
.dish__diet--non_veg, .dish__diet--nonveg { border-color: #8A2B14; }
/* non-veg: a triangle (FSSAI mark), so it is told apart by shape, not only colour */
.dish__diet--non_veg::after, .dish__diet--nonveg::after { background: #8A2B14; border-radius: 0; clip-path: polygon(50% 8%, 94% 92%, 6% 92%); }
.diet-tag { font-size: var(--text-xs); font-weight: 700; padding: 0 4px; border: 1px solid currentColor; border-radius: 4px; }
.dish__diet--both { border-color: #8A6A14; }
.dish__diet--both::after { background: linear-gradient(90deg, #1B7F3A 50%, #8A2B14 50%); }

/* Bulk Dish Picker Drawer */
.dish-picker-toolbar { display: flex; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-3); flex-wrap: wrap; }
.dish-picker-search { flex: 1; min-width: 180px; }
.dish-picker-filter-group { display: flex; gap: 4px; }
.dish-picker-filter-btn { font-size: var(--text-xs); padding: 4px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: all 0.15s ease; color: var(--ink); }
.dish-picker-filter-btn.is-active, .dish-picker-filter-btn:hover { background: var(--brand-gold-soft); border-color: var(--brand-gold); font-weight: 600; }
.dish-picker-stats { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-2) var(--sp-3); background: var(--canvas); border-radius: var(--radius-sm); font-size: var(--text-xs); margin-bottom: var(--sp-3); border: 1px solid var(--line); }
.dish-picker-categories { max-height: 52vh; overflow-y: auto; padding-right: 4px; display: flex; flex-direction: column; gap: var(--sp-3); }
.dish-picker-cat-title { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; color: var(--ink-muted); margin-bottom: var(--sp-1); padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.dish-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-2); }
.dish-picker-item { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; user-select: none; transition: border-color 0.15s, background-color 0.15s; }
.dish-picker-item:hover { border-color: var(--brand-gold); background: var(--canvas); }
.dish-picker-item.is-selected { border-color: var(--brand-gold-strong); background: var(--brand-gold-soft); }
.global-search-row:hover { background: var(--canvas); }
.dish-picker-item input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--brand-gold-strong); }
.dish-picker-item__info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dish-picker-item__name { font-size: var(--text-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dish-custom-details { margin-top: var(--sp-3); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); background: var(--canvas); }
.dish-custom-details summary { font-size: var(--text-xs); font-weight: 600; cursor: pointer; color: var(--brand-gold-strong); }

/* BEO preview inside the app (same markup as the print) */
.beo-preview .doc-title { font-size: var(--text-lg, 18px); font-weight: 700; color: var(--brand-gold-strong); margin: 0 0 var(--sp-3); }
.beo-preview .doc-table { width: 100%; border-collapse: collapse; margin-bottom: var(--sp-3); font-size: var(--text-sm); }
.beo-preview .doc-table th, .beo-preview .doc-table td { border: 1px solid var(--line); padding: var(--sp-1) var(--sp-2); text-align: left; vertical-align: top; }
.beo-preview .doc-table th { background: var(--canvas); }
.beo-preview .doc-section { margin: var(--sp-4) 0 var(--sp-2); font-weight: 700; color: var(--brand-gold-strong); border-bottom: 1px solid var(--line); }
.beo-preview .doc-label { color: var(--ink-muted); font-size: var(--text-xs); text-transform: uppercase; }
.beo-preview .doc-muted { color: var(--ink-muted); }
.beo-preview .doc-words { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.beo-preview .doc-blessing { text-align: center; color: var(--ink-muted); font-style: italic; }
.beo-preview { overflow-x: auto; }
.function-card__menu { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); }

/* Notification bell (UI_UX §2 topbar) and list */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius); color: var(--ink); }
.bell:hover { background: var(--canvas); }
.bell svg { width: 22px; height: 22px; }
.bell__count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--status-danger); color: #fff; font-size: var(--text-xs); font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.bell__count.is-empty { display: none; }
.bell.is-active { background: var(--canvas); }
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-item { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.notice-item:last-child { border-bottom: 0; }
.notice-item--unread .notice-item__title { font-weight: 700; }
.notice-item__dot { flex: none; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--brand-gold); }
.notice-item__main { flex: 1; min-width: 0; }
.notice-item__title { display: block; padding: var(--sp-1) 0; min-height: 32px; font-weight: 500; color: var(--ink); text-decoration: none; }
.notice-item__title:hover { text-decoration: underline; }
.notice-item__text { white-space: pre-line; margin: 2px 0 0; }
.notice-item__actions { display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.notice-item__actions form { margin: 0; }
@media (max-width: 600px) { .notice-item { flex-direction: column; } }

/* Dashboard (ROLES §5, D25): action strip, widget grid, KPI tiles, single-series bars,
   occupancy heatmap (one hue, light → dark). Marks use brand gold; values stay in ink. */
.action-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.action-tile { display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; min-height: 80px; transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.action-tile:hover { border-color: var(--brand-gold-strong); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04); }
.action-tile--alert { border-left: 4px solid var(--status-danger); }
.action-tile__top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.action-tile__icon { width: 18px; height: 18px; color: var(--brand-gold-strong); flex-shrink: 0; }
.action-tile__icon svg { width: 100%; height: 100%; }
.action-tile__badge { font-size: 0.6875rem; font-weight: 600; padding: 2px 6px; border-radius: var(--radius-sm); background: var(--canvas); color: var(--ink-muted); white-space: nowrap; }
.action-tile__badge--danger { background: #FEE2E2; color: var(--status-danger); }
.action-tile__badge--blue { background: #DBEAFE; color: #1D4ED8; }
.action-tile__badge--gold { background: var(--brand-gold-soft); color: var(--brand-gold-strong); }
.action-tile__value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.action-tile__label { font-size: var(--text-sm); color: var(--ink-muted); }
.widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--sp-4); align-items: start; }
.widget--wide { grid-column: span 2; }
@media (max-width: 760px) { .widget-grid { grid-template-columns: 1fr; } .widget--wide { grid-column: auto; } }

/* ---------- Dashboard Drag & Drop Customizer (UI_UX §3) ---------- */
.customizer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--brand-gold-soft);
  border: 1px solid rgba(193, 154, 47, 0.4);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.widget__drag-handle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: grab;
  color: var(--ink-muted);
  user-select: none;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.widget__drag-handle:hover {
  color: var(--brand-gold-strong);
  background: var(--canvas);
  border-color: var(--brand-gold);
}
.widget__drag-handle:active {
  cursor: grabbing;
}
.widget__drag-handle .drag-icon {
  font-size: 14px;
  letter-spacing: -2px;
  font-weight: 700;
  line-height: 1;
}

body.dashboard-editing .widget__drag-handle {
  display: inline-flex;
}
body.dashboard-editing .widget {
  border: 1.5px dashed rgba(193, 154, 47, 0.6);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
body.dashboard-editing .widget:hover {
  border-color: var(--brand-gold);
  box-shadow: 0 4px 16px rgba(193, 154, 47, 0.12);
}

.widget.is-dragging {
  opacity: 0.35;
  border: 2px dashed var(--brand-gold-strong) !important;
  transform: scale(0.98);
}
.widget.drag-over {
  border-color: var(--brand-gold-strong) !important;
  background: #fbf8f0;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(138, 106, 20, 0.15);
}

.chart-container {
  position: relative;
  min-height: 240px;
  width: 100%;
}
.widget__header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.widget__header .card__title { margin-bottom: 0; }
.widget__refresh-btn { background: none; border: none; padding: 4px; color: var(--ink-muted); cursor: pointer; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; transition: color 0.15s ease, background-color 0.15s ease; }
.widget__refresh-btn:hover { color: var(--brand-gold-strong); background: var(--canvas); }
.widget__refresh-btn svg { width: 14px; height: 14px; }
.widget__more { margin: var(--sp-3) 0 0; font-size: var(--text-sm); }
.skeleton { height: 96px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--canvas) 25%, var(--line) 50%, var(--canvas) 75%); background-size: 200% 100%; animation: skeleton 1.2s infinite; }
@keyframes skeleton { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.kpi-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-3); }
.kpi { display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; }
a.kpi:hover .kpi__value { text-decoration: underline; }
.kpi__label { font-size: var(--text-sm); color: var(--ink-muted); }
.kpi__value { font-size: 1.4rem; font-weight: 700; }
.kpi__sub { font-size: var(--text-xs); color: var(--ink-muted); }
.kpi__trend--up { color: var(--status-success); }
.kpi__trend--down { color: var(--status-danger); }
.widget-list { list-style: none; margin: 0; padding: 0; }
.widget-list__item { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); min-height: 44px; }
.widget-list__item:last-child { border-bottom: 0; }
.widget-list__main { display: flex; flex-direction: column; min-width: 0; }
.widget-list__main a { color: var(--ink); font-weight: 600; }
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.bar-list__row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: var(--sp-2); font-size: var(--text-sm); }
.bar-list__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-list__track { height: 10px; background: var(--canvas); border-radius: 4px; overflow: hidden; }
.bar-list__bar { display: block; height: 100%; background: var(--brand-gold); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-list__value { white-space: nowrap; color: var(--ink); }
.progress { height: 12px; background: var(--canvas); border-radius: 6px; overflow: hidden; margin-top: var(--sp-2); }
.progress__bar { display: block; height: 100%; background: var(--brand-gold); border-radius: 0 6px 6px 0; }

/* SVG Radial Gauge */
.svg-gauge { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-1) 0; }
.svg-gauge__chart { position: relative; width: 92px; height: 92px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.svg-gauge__svg { width: 92px; height: 92px; transform: rotate(-90deg); }
.svg-gauge__track { fill: transparent; stroke: var(--canvas); stroke-width: 9; }
.svg-gauge__meter { fill: transparent; stroke: var(--brand-gold); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.svg-gauge__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.svg-gauge__pct { font-size: 1.125rem; font-weight: 700; color: var(--ink); }
.svg-gauge__sub { font-size: 0.65rem; color: var(--ink-muted); margin-top: 2px; }
.svg-gauge__meta { display: flex; flex-direction: column; gap: 4px; flex: 1; }

/* SVG Funnel Pipeline */
.funnel-list { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.funnel-step { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--text-xs); }
.funnel-step__label { width: 85px; flex-shrink: 0; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel-step__track { flex: 1; background: var(--canvas); height: 22px; border-radius: var(--radius-sm); overflow: hidden; position: relative; }
.funnel-step__bar { height: 100%; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--sp-2); color: #FFFFFF; font-weight: 600; font-size: 0.725rem; text-decoration: none; transition: filter 0.15s ease; }
.funnel-step__bar:hover { filter: brightness(1.1); }

/* SVG Donut Chart */
.svg-donut { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-1) 0; }
.svg-donut__chart { position: relative; width: 84px; height: 84px; flex-shrink: 0; }
.svg-donut__svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.svg-donut__legend { display: flex; flex-direction: column; gap: 4px; flex: 1; font-size: var(--text-xs); }
.svg-donut__item { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.svg-donut__dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* Occupancy Visual Bars */
.occupancy-bars { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.occupancy-bar__info { display: flex; justify-content: space-between; align-items: center; font-size: var(--text-xs); margin-bottom: 2px; }
.occupancy-bar__track { height: 7px; background: var(--canvas); border-radius: 4px; overflow: hidden; }
.occupancy-bar__fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }

.heatmap { display: grid; gap: 3px; overflow-x: auto; padding-bottom: var(--sp-1); }
.heatmap__row { display: grid; grid-template-columns: 110px repeat(31, minmax(10px, 1fr)) 48px; gap: 2px; align-items: center; min-width: 520px; }
.heatmap__hall { font-size: var(--text-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heatmap__rate { font-size: var(--text-xs); text-align: right; }
.heatmap__cell { display: inline-block; height: 14px; min-width: 10px; border-radius: 3px; background: var(--canvas); border: 1px solid var(--line); }
.heatmap__cell--1 { background: color-mix(in srgb, var(--brand-gold) 45%, var(--surface)); border-color: transparent; }
.heatmap__cell--2 { background: var(--brand-gold-strong); border-color: transparent; }
.heatmap__legend .heatmap__cell { width: 14px; vertical-align: middle; margin-left: var(--sp-2); }
.quick-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.quick-links .btn svg { width: 18px; height: 18px; }

/* ---------- SweetAlert2 Aviyaan One Theme Integration (UI_UX §3) ---------- */
.swal2-container {
  z-index: 10000 !important;
  font-family: var(--font-ui) !important;
}

/* Modals */
.swal2-popup {
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 12px 32px rgba(31, 26, 18, 0.16) !important;
  font-family: var(--font-ui) !important;
  color: var(--ink) !important;
  padding: var(--sp-5) var(--sp-5) var(--sp-4) !important;
}
.swal2-title {
  color: var(--ink) !important;
  font-size: var(--text-lg) !important;
  font-weight: 600 !important;
  margin-bottom: var(--sp-2) !important;
}
.swal2-html-container {
  color: var(--ink-muted) !important;
  font-size: var(--text-base) !important;
  line-height: 1.5 !important;
}

/* Modal Buttons */
.swal2-actions {
  gap: var(--sp-2) !important;
  margin-top: var(--sp-4) !important;
}
.swal2-actions .swal2-confirm {
  background-color: var(--brand-gold-strong) !important;
  border-color: var(--brand-gold-strong) !important;
  color: #fff !important;
  font-family: var(--font-ui) !important;
  font-weight: 600 !important;
  font-size: var(--text-sm) !important;
  padding: 8px 18px !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
  transition: background-color 0.15s ease !important;
}
.swal2-actions .swal2-confirm:hover {
  background-color: var(--brand-gold-hover) !important;
}
.swal2-actions .swal2-confirm.swal2-danger-btn {
  background-color: var(--status-danger) !important;
  border-color: var(--status-danger) !important;
}
.swal2-actions .swal2-confirm.swal2-danger-btn:hover {
  background-color: #991b1b !important;
}
.swal2-actions .swal2-cancel {
  background-color: var(--surface) !important;
  border: 1px solid var(--line) !important;
  color: var(--ink) !important;
  font-family: var(--font-ui) !important;
  font-weight: 500 !important;
  font-size: var(--text-sm) !important;
  padding: 8px 18px !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
}
.swal2-actions .swal2-cancel:hover {
  background-color: var(--canvas) !important;
  color: var(--ink) !important;
}
.swal2-actions button:focus-visible {
  outline: var(--focus-outline) !important;
  outline-offset: 1px !important;
}

/* Toast Mode */
.swal2-toast {
  background: var(--ink) !important;
  color: #fff !important;
  border-radius: var(--radius) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 24px rgba(31, 26, 18, 0.22) !important;
  padding: var(--sp-3) var(--sp-4) !important;
}
.swal2-toast .swal2-title {
  color: #fff !important;
  font-size: var(--text-sm) !important;
  font-weight: 500 !important;
  margin: 0 !important;
}
.swal2-toast.swal2-toast--success {
  background: #1e3a29 !important;
  border-color: rgba(39, 107, 67, 0.4) !important;
}
.swal2-toast.swal2-toast--error {
  background: #3b1815 !important;
  border-color: rgba(180, 35, 24, 0.4) !important;
}
.swal2-toast.swal2-toast--warning {
  background: #3b2a12 !important;
  border-color: rgba(154, 91, 0, 0.4) !important;
}
.swal2-toast.swal2-toast--info {
  background: #172a45 !important;
  border-color: rgba(47, 95, 168, 0.4) !important;
}
.swal2-timer-progress-bar {
  background: var(--brand-gold) !important;
  height: 3px !important;
}

