/* ==========================================================================
   Taquería del Barrio — design system
   Brand: Manual de identidad gráfica 2026 (Verde Nopal, Rojo Mexicano, Arena,
   Tonos Tierra, Verde Tradición, Negro Carbón · Quicksand).
   Display serif (Fraunces) stands in for "Etiquette", which is logo-only.
   ========================================================================== */

:root {
  /* brand — primary */
  --nopal: #066337;
  --nopal-700: #04502c;
  --nopal-900: #032f1a;
  --nopal-50: #e6f0ea;
  --rojo: #94001a;
  --rojo-600: #7d0016;
  --rojo-50: #f9e9eb;
  --arena: #a77e47;
  --arena-300: #d2b48a;
  --arena-50: #f4ebdd;
  /* brand — support */
  --tierra: #7b4132;
  --olivo: #6f7263;
  --tradicion: #0a9e58;
  --mostaza: #c9962b;
  --carbon: #110e0c;
  /* surfaces */
  --crema: #f7f1e6;
  --paper: #fcfaf5;
  --kraft: #e8dcc6;
  --white: #ffffff;
  /* ink */
  --ink: #1c1714;
  --ink-2: #51483f;
  --ink-3: #7d7268;
  --line: rgba(28, 23, 20, 0.08);
  --line-2: rgba(28, 23, 20, 0.14);

  /* type */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'Quicksand', ui-rounded, system-ui, sans-serif;

  /* shape & depth */
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --shadow-sm: 0 1px 2px rgba(60, 35, 20, 0.04), 0 4px 14px -6px rgba(60, 35, 20, 0.1);
  --shadow-lg: 0 30px 70px -30px rgba(60, 35, 20, 0.35), 0 10px 24px -12px rgba(60, 35, 20, 0.14);

  /* motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  /* layers */
  --z-sticky: 20;
  --z-nav: 40;
  --z-modal: 60;
  --z-toast: 70;
  --z-grain: 80;

  color-scheme: light;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--crema);
  color: var(--ink);
  font: 500 16px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 500; letter-spacing: -0.015em; line-height: 1.08; }
p { margin: 0; }
::selection { background: var(--arena-300); color: var(--ink); }
:focus-visible { outline: 2px solid var(--nopal); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.03em; line-height: 0.96; }
.display em, .italic { font-style: italic; font-weight: 400; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 12px; border-radius: 999px;
  font: 700 11px/1 var(--font-sans); letter-spacing: 0.18em; text-transform: uppercase;
  background: rgba(167, 126, 71, 0.14); color: #7a5527;
}
.eyebrow--light { background: rgba(255, 255, 255, 0.08); color: var(--arena-300); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.eyebrow i { font-size: 14px; }

/* film grain — public pages only, fixed + non-interactive (never on scrolling layers) */
.grain::after {
  content: ''; position: fixed; inset: 0; z-index: var(--z-grain); pointer-events: none; opacity: 0.07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- layout ---------- */
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.section { padding-block: clamp(72px, 11vw, 160px); }
.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: var(--gap, 20px); grid-template-columns: repeat(auto-fill, minmax(var(--min, 260px), 1fr)); }

/* ---------- buttons ---------- */
.btn {
  --btn-h: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-h); padding: 0 20px; border: 0; border-radius: 999px;
  font: 700 15px/1 var(--font-sans); letter-spacing: 0.005em; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  background: transparent; color: var(--ink);
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease, box-shadow 200ms ease, opacity 200ms ease;
}
.btn i { font-size: 1.25em; }
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn.is-disabled { opacity: 0.42; pointer-events: none; box-shadow: none; }
.btn-sm { --btn-h: 38px; padding: 0 15px; font-size: 14px; }
.btn-lg { --btn-h: 56px; padding: 0 26px; font-size: 16.5px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--btn-h); padding: 0; flex: none; }

/* primary = Rojo Mexicano on public pages, Verde Nopal in the gestionale (red stays for destructive) */
.btn-primary { --pb: var(--rojo); --pb-h: var(--rojo-600); background: var(--pb); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 18px -10px color-mix(in srgb, var(--pb) 80%, transparent); }
.admin .btn-primary, .modal .btn-primary, .drawer .btn-primary { --pb: var(--nopal); --pb-h: var(--nopal-700); }
.btn-secondary { background: rgba(255, 255, 255, 0.6); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost-dark { background: transparent; color: rgba(247, 241, 230, 0.7); }
.btn-light { background: var(--crema); color: var(--ink); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.5); }
.btn-success { background: var(--tradicion); color: #fff; }
.btn-danger { background: var(--rojo-50); color: var(--rojo); }
.btn-danger-solid { background: var(--rojo); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--pb-h); }
  .btn-secondary:hover { background: #fff; box-shadow: inset 0 0 0 1.5px rgba(28, 23, 20, 0.24); }
  .btn-ghost:hover { background: rgba(28, 23, 20, 0.05); color: var(--ink); }
  .btn-ghost-dark:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
  .btn-danger:hover { background: #f3d6da; }
  .btn-danger-solid:hover { background: var(--rojo-600); }
  .btn-success:hover { background: #088a4c; }
  .btn-light:hover { background: #fff; }
}

/* button-in-button trailing orb */
.btn:has(.btn-orb) { padding-right: 6px; }
.btn-sm:has(.btn-orb) { padding-right: 4px; }
.btn-orb {
  display: grid; place-items: center; flex: none;
  width: calc(var(--btn-h) - 12px); height: calc(var(--btn-h) - 12px); border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); margin-left: 4px;
  transition: transform 320ms var(--ease-out);
}
.btn-sm .btn-orb { width: 30px; height: 30px; }
.btn-light .btn-orb, .btn-secondary .btn-orb { background: rgba(28, 23, 20, 0.07); }
.btn-orb i { font-size: 16px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover .btn-orb { transform: translate(2px, -1px) scale(1.06); }
}

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; }
.label { font: 700 13px/1.2 var(--font-sans); color: var(--ink-2); letter-spacing: 0.01em; }
.label .req { color: var(--rojo); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 50px; padding: 0 15px; border: 0; border-radius: 14px;
  background: var(--white); color: var(--ink);
  font: 600 16px/1.3 var(--font-sans); /* 16px: no iOS zoom */
  box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 2px rgba(60, 35, 20, 0.04);
  transition: box-shadow 160ms ease, background-color 160ms ease;
  appearance: none; -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: #a99f95; font-weight: 500; }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--nopal), 0 0 0 4px rgba(6, 99, 55, 0.12); }
.input.is-error, .select.is-error, .textarea.is-error { box-shadow: inset 0 0 0 1.5px var(--rojo), 0 0 0 4px rgba(148, 0, 26, 0.1); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--crema); color: var(--ink-3); }
.textarea { height: auto; min-height: 112px; padding: 13px 15px; resize: vertical; line-height: 1.5; }
.select {
  padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath d='M212 100l-84 84-84-84' fill='none' stroke='%2351483f' stroke-width='16' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
}
input[type='date'].input, input[type='time'].input { cursor: pointer; }
.field-error { display: flex; align-items: center; gap: 6px; font: 700 13px/1.3 var(--font-sans); color: var(--rojo); }
.field-error i { font-size: 16px; }
.help { font-size: 13px; color: var(--ink-3); }

/* checkbox chips (e.g. dietary tags) */
.check { position: relative; display: inline-flex; }
.check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.check span {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px; border-radius: 999px;
  background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line-2); font: 700 14px/1 var(--font-sans); color: var(--ink-2);
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 160ms var(--ease-out);
}
.check input:checked + span { background: var(--ink); color: var(--crema); box-shadow: none; }
.check input:focus-visible + span { outline: 2px solid var(--nopal); outline-offset: 2px; }
.check:active span { transform: scale(0.97); }

/* plain checkbox / consent */
.checkline { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.checkline input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--nopal); flex: none; }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font: 700 14px/1 var(--font-sans); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative; width: 46px; height: 28px; border-radius: 999px; flex: none;
  background: #d9d0c4; transition: background-color 200ms ease;
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 220ms var(--ease-out);
}
.switch input:checked + .switch-track { background: var(--tradicion); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--nopal); outline-offset: 2px; }
.switch:active .switch-track::after { transform: scaleX(1.12); }
.switch input:checked:active + .switch-track::after { transform: translateX(16px) scaleX(1.12); }

/* quantity stepper: <div class="qty"><button class="qty-btn">−</button><span class="qty-val">2</span><button class="qty-btn">+</button></div> */
.qty { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(28, 23, 20, 0.05); }
.qty-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--white); color: var(--ink); cursor: pointer; box-shadow: 0 1px 2px rgba(60, 35, 20, 0.12);
  transition: transform 140ms var(--ease-out);
}
.qty-btn:active { transform: scale(0.92); }
.qty-btn i { font-size: 18px; }
.qty-val { min-width: 30px; text-align: center; font: 700 16px/1 var(--font-sans); font-variant-numeric: tabular-nums; }

/* ---------- badges ---------- */
.badge {
  --b-bg: rgba(28, 23, 20, 0.06); --b-fg: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 9px; border-radius: 999px;
  background: var(--b-bg); color: var(--b-fg); font: 700 12.5px/1 var(--font-sans); letter-spacing: 0.01em; white-space: nowrap;
}
.badge i { font-size: 15px; }
.badge-lg { height: 36px; padding: 0 15px 0 12px; font-size: 15px; gap: 8px; }
.badge-lg i { font-size: 19px; }
/* booking */
.badge--confermata { --b-bg: var(--nopal-50); --b-fg: var(--nopal); }
.badge--arrivato { --b-bg: #f8edd3; --b-fg: #7a5410; }
.badge--completata { --b-bg: #ebebe5; --b-fg: #4a4c40; }
.badge--annullata { --b-bg: var(--rojo-50); --b-fg: var(--rojo); }
.badge--no_show { --b-bg: #f4e5e0; --b-fg: var(--tierra); }
/* table */
.badge--libero { --b-bg: #e0f3e8; --b-fg: #06703f; }
.badge--prenotato { --b-bg: var(--arena-50); --b-fg: #6e4f22; }
.badge--occupato { --b-bg: var(--rojo-50); --b-fg: var(--rojo); }
/* preparation / order */
.badge--da_preparare, .badge--aperta { --b-bg: #ece6dd; --b-fg: var(--ink); }
.badge--in_preparazione { --b-bg: #f8edd3; --b-fg: #7a5410; }
.badge--pronto, .badge--pronta { --b-bg: var(--nopal); --b-fg: #fff; }
.badge--chiusa { --b-bg: #ebebe5; --b-fg: #4a4c40; }
/* product availability */
.badge--disponibile { --b-bg: #e0f3e8; --b-fg: #06703f; }
.badge--non_disponibile { --b-bg: #ece6dd; --b-fg: var(--ink-2); }
/* dietary tags */
.tag--vegetariano { --b-bg: var(--nopal-50); --b-fg: var(--nopal); }
.tag--senza_glutine { --b-bg: var(--arena-50); --b-fg: #6e4f22; }
.tag--piccante { --b-bg: var(--rojo-50); --b-fg: var(--rojo); }

.pill-warn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 9px; border-radius: 999px;
  font: 700 12.5px/1 var(--font-sans); white-space: nowrap; color: #8a5a14; background: #fdf6e7;
  box-shadow: inset 0 0 0 1.5px #e7c98f; background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(201, 150, 43, 0.1) 6px 12px);
}
.pill-warn i { font-size: 15px; }

/* ---------- cards ---------- */
.card { background: var(--white); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.card-pad { padding: 22px; }
/* double-bezel: machined tray + glass plate */
.bezel { padding: 6px; border-radius: var(--r-xl); background: rgba(60, 35, 20, 0.04); box-shadow: inset 0 0 0 1px var(--line); }
.bezel > .bezel-core {
  height: 100%; border-radius: calc(var(--r-xl) - 6px); background: var(--white); overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(60, 35, 20, 0.05), 0 14px 34px -22px rgba(60, 35, 20, 0.32);
}
.bezel--dark { background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.bezel--dark > .bezel-core { background: #1a1512; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 20px 40px -24px rgba(0, 0, 0, 0.6); }

/* KPI (dashboard, tavoli summary) */
.kpi { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 22px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 700 13.5px/1.2 var(--font-sans); color: var(--ink-2); }
.kpi-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--arena-50); color: var(--arena); font-size: 22px; }
.kpi-value { font: 500 clamp(40px, 4vw, 54px)/0.9 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: 13px; color: var(--ink-3); }

/* product image */
.pimg { width: 100%; height: 100%; object-fit: cover; }
.pimg--placeholder {
  display: grid; place-items: center; color: rgba(123, 65, 50, 0.55); font-size: 40px;
  background-color: var(--kraft);
  background-image: radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.5), transparent 60%),
    repeating-linear-gradient(45deg, rgba(167, 126, 71, 0.12) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, rgba(167, 126, 71, 0.12) 0 2px, transparent 2px 14px);
}

/* ---------- data table ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.table th {
  text-align: left; padding: 13px 16px; white-space: nowrap;
  font: 700 11.5px/1 var(--font-sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 120ms ease; }
.table tbody tr.is-clickable { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .table tbody tr.is-clickable:hover { background: rgba(167, 126, 71, 0.06); } }
.table .t-strong { font-weight: 700; color: var(--ink); }
.table .t-time { font: 700 15px/1 var(--font-sans); font-variant-numeric: tabular-nums; }

/* ---------- chips / tabs ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border: 0; border-radius: 999px;
  background: rgba(28, 23, 20, 0.05); color: var(--ink-2); font: 700 14px/1 var(--font-sans); cursor: pointer; scroll-snap-align: start;
  transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out);
}
.chip:active { transform: scale(0.97); }
.chip.is-active, .chip[aria-selected='true'] { background: var(--ink); color: var(--crema); }
.chip .count { font-variant-numeric: tabular-nums; opacity: 0.6; }
@media (hover: hover) and (pointer: fine) { .chip:not(.is-active):hover { background: rgba(28, 23, 20, 0.09); color: var(--ink); } }

.segmented { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(28, 23, 20, 0.06); }
.segmented button {
  height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2);
  font: 700 14px/1 var(--font-sans); cursor: pointer; transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}
.segmented button.is-active { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(60, 35, 20, 0.14); }

/* ---------- alerts / notes / empty ---------- */
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; font: 600 14.5px/1.45 var(--font-sans); }
.alert i { font-size: 20px; flex: none; margin-top: 1px; }
.alert strong { display: block; font-weight: 700; }
.alert--info { background: var(--nopal-50); color: var(--nopal-900); }
.alert--error { background: var(--rojo-50); color: #6b0013; }
.alert--warn { background: #fbf0d9; color: #6b4a0e; }

.allergy {
  display: grid; gap: 5px; padding: 12px 14px 12px 16px; border-radius: 14px;
  background: var(--rojo-50); color: #5c0011; box-shadow: inset 4px 0 0 var(--rojo);
  font: 600 14.5px/1.4 var(--font-sans);
}
.allergy-title { display: flex; align-items: center; gap: 7px; font: 800 12px/1.2 var(--font-sans); letter-spacing: 0.07em; text-transform: uppercase; color: var(--rojo); }
.allergy-title i { font-size: 18px; }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--arena-50); color: #5a4220; font: 600 14px/1.4 var(--font-sans); }
.note i { font-size: 17px; margin-top: 1px; flex: none; }

.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 56px 24px; color: var(--ink-2); }
.empty-icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 22px; background: var(--arena-50); color: var(--arena); font-size: 32px; margin-bottom: 6px; }
.empty-title { font: 500 22px/1.2 var(--font-display); color: var(--ink); }
.empty p { max-width: 36ch; font-size: 14.5px; }

/* ---------- overlays: modal (centered) + drawer (right panel); mobile modal = bottom sheet ---------- */
.overlay {
  position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 16px;
  background: rgba(24, 16, 10, 0.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 220ms var(--ease-out);
}
.overlay.is-open { opacity: 1; }
.overlay:not(.is-open) { transition-duration: 160ms; pointer-events: none; }
.modal, .drawer { display: flex; flex-direction: column; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lg); }
.modal {
  width: min(540px, 100%); max-height: calc(100dvh - 32px); border-radius: 28px; overflow: hidden;
  transform: translateY(10px) scale(0.97); opacity: 0;
  transition: transform 260ms var(--ease-out), opacity 200ms var(--ease-out);
}
.modal--sm { width: min(420px, 100%); }
.modal--lg { width: min(760px, 100%); }
.overlay.is-open .modal { transform: none; opacity: 1; }
.overlay:not(.is-open) .modal { transition-duration: 160ms; }
.modal-head, .drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 6px 26px; }
.modal-title, .drawer-title { font: 500 24px/1.15 var(--font-display); letter-spacing: -0.02em; padding-top: 6px; }
.modal-body, .drawer-body { padding: 12px 26px 20px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.modal-foot, .drawer-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 16px 22px 22px; border-top: 1px solid var(--line); background: rgba(247, 241, 230, 0.6); }
.overlay--drawer { place-items: stretch end; padding: 0; }
.drawer { width: min(500px, 100%); height: 100dvh; transform: translateX(100%); transition: transform 320ms var(--ease-drawer); }
.drawer-body { flex: 1; }
.overlay.is-open .drawer { transform: none; }
.overlay:not(.is-open) .drawer { transition-duration: 200ms; }
.confirm-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--nopal-50); color: var(--nopal); font-size: 28px; }
.confirm-icon.is-danger { background: var(--rojo-50); color: var(--rojo); }
@media (max-width: 640px) {
  .overlay--modal { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 26px 26px 0 0; transform: translateY(100%); opacity: 1; transition: transform 320ms var(--ease-drawer); }
  .modal-foot { padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
}

/* detail list inside drawers: <dl class="dl"><div><dt>…</dt><dd>…</dd></div></dl> */
.dl { display: grid; gap: 0; margin: 0; }
.dl > div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.dl > div:last-child { border-bottom: 0; }
.dl dt { color: var(--ink-3); font-size: 14px; }
.dl dd { margin: 0; font-weight: 700; text-align: right; }
.section-label { font: 700 11.5px/1 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }

/* table picker (assign / check-in modals) */
.tpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpick-item { position: relative; display: flex; }
.tpick-item input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tpick-card {
  flex: 1; display: grid; gap: 6px; justify-items: start; padding: 14px; border-radius: 18px; background: var(--white);
  box-shadow: inset 0 0 0 1.5px var(--line-2); transition: box-shadow 160ms ease, background-color 160ms ease, transform 160ms var(--ease-out);
}
.tpick-card strong { font: 500 19px/1 var(--font-display); }
.tpick-card small { color: var(--ink-3); font-weight: 700; font-size: 13px; }
.tpick-card em { display: inline-flex; align-items: center; gap: 4px; font: 700 12px/1.2 var(--font-sans); font-style: normal; }
.tpick-warn { color: #8a5a14; }
.tpick-info { color: var(--ink-3); }
.tpick-item input:checked + .tpick-card { box-shadow: inset 0 0 0 2px var(--nopal), 0 0 0 4px rgba(6, 99, 55, 0.12); background: #f6fbf8; }
.tpick-item input:focus-visible + .tpick-card { outline: 2px solid var(--nopal); outline-offset: 2px; }
.tpick-item input:disabled + .tpick-card { opacity: 0.45; }
.tpick-item input:disabled { cursor: not-allowed; }
.tpick-item:active input:not(:disabled) + .tpick-card { transform: scale(0.98); }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: var(--z-toast); left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px; border-radius: 16px;
  background: var(--ink); color: var(--crema); font: 700 14px/1.35 var(--font-sans); box-shadow: var(--shadow-lg);
  transition: transform 320ms var(--ease-out), opacity 320ms var(--ease-out);
}
@starting-style { .toast { opacity: 0; transform: translateY(14px) scale(0.98); } }
.toast.is-leaving { opacity: 0; transform: translateY(8px) scale(0.98); transition-duration: 180ms; }
.toast i { font-size: 20px; }
.toast--success i { color: #5fd69a; }
.toast--error i { color: #ff8b9c; }
.toast--info i { color: var(--arena-300); }

/* ---------- scroll reveal (public) ---------- */
.js [data-reveal] {
  opacity: 0; transform: translateY(28px); filter: blur(8px);
  transition: opacity 900ms var(--ease-out), transform 1000ms var(--ease-out), filter 900ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; filter: none; }

/* ==========================================================================
   PUBLIC SHELL — floating island nav, mobile overlay menu, footer
   ========================================================================== */
.site-nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: var(--z-nav);
  width: min(1120px, calc(100% - 24px)); display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 7px 7px 7px 18px; border-radius: 999px;
  background: rgba(252, 250, 245, 0.74); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(28, 23, 20, 0.06), 0 12px 32px -14px rgba(28, 23, 20, 0.28);
}
.site-brand img { height: 44px; width: auto; }
.site-nav-links { display: flex; gap: 2px; }
.site-nav-links a { padding: 11px 16px; border-radius: 999px; font: 700 14.5px/1 var(--font-sans); color: var(--ink-2); transition: background-color 180ms ease, color 180ms ease; }
.site-nav-links a.is-active { color: var(--ink); background: rgba(28, 23, 20, 0.06); }
@media (hover: hover) and (pointer: fine) { .site-nav-links a:hover { color: var(--ink); background: rgba(28, 23, 20, 0.05); } }
.site-nav-cta { display: flex; align-items: center; gap: 8px; }
.burger { display: none; position: relative; width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(28, 23, 20, 0.06); cursor: pointer; }
.burger span { position: absolute; left: 14px; right: 14px; height: 1.6px; border-radius: 2px; background: var(--ink); transition: transform 380ms var(--ease-in-out); }
.burger span:first-child { transform: translateY(-4px); }
.burger span:last-child { transform: translateY(4px); }
.menu-open .burger span:first-child { transform: rotate(45deg); }
.menu-open .burger span:last-child { transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: calc(var(--z-nav) - 1); display: flex; flex-direction: column; justify-content: center; gap: 40px;
  padding: 110px 28px 40px; background: rgba(247, 241, 230, 0.86); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  opacity: 0; visibility: hidden; transition: opacity 300ms var(--ease-out), visibility 0s linear 300ms;
}
.menu-open .mobile-menu { opacity: 1; visibility: visible; transition: opacity 300ms var(--ease-out); }
.menu-open { overflow: hidden; }
.mobile-menu nav { display: grid; gap: 6px; justify-items: start; }
.mobile-menu nav a:not(.btn) { font: 500 clamp(44px, 12vw, 64px)/1.05 var(--font-display); letter-spacing: -0.03em; }
.mobile-menu nav .btn { margin-top: 22px; }
.mobile-menu nav > *, .mobile-menu-foot { opacity: 0; transform: translateY(40px); transition: opacity 500ms var(--ease-out), transform 600ms var(--ease-out); }
.menu-open .mobile-menu nav > *, .menu-open .mobile-menu-foot { opacity: 1; transform: none; transition-delay: calc(80ms + var(--i, 0) * 60ms); }
.mobile-menu-foot { color: var(--ink-2); font-size: 15px; }
@media (max-width: 860px) {
  .site-nav-links { display: none; }
  .burger { display: block; }
  .site-brand img { height: 38px; }
}
@media (max-width: 480px) {
  .site-nav-cta .btn-primary { display: none; }
}

.site-footer { background: var(--carbon); color: rgba(247, 241, 230, 0.72); padding: 88px 0 28px; font-size: 14.5px; }
.site-footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 40px; }
.site-footer h3 { font: 700 11.5px/1 var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--arena-300); margin-bottom: 16px; }
.site-footer p { margin-bottom: 8px; }
.site-footer a { transition: color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .site-footer a:hover { color: #fff; } }
.site-footer-brand img { width: 170px; height: auto; margin-bottom: 20px; }
.site-footer-quote { font: italic 400 19px/1.4 var(--font-display); color: rgba(247, 241, 230, 0.86); max-width: 30ch; }
.site-footer-social { display: flex; gap: 8px; }
.site-footer-social a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); font-size: 20px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.site-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 64px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 13px; color: rgba(247, 241, 230, 0.5); }
@media (max-width: 960px) { .site-footer-grid { grid-template-columns: 1fr 1fr; } .site-footer-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .site-footer-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   ADMIN SHELL — sidebar (desktop) → icon rail (tablet) → bottom bar (mobile)
   ========================================================================== */
.admin { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100dvh; background: #f3ede2; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px 16px;
  background: var(--carbon); color: rgba(247, 241, 230, 0.78);
  background-image: radial-gradient(120% 60% at 0% 0%, rgba(6, 99, 55, 0.28), transparent 60%);
}
.sidebar-brand { display: grid; place-items: center; padding: 4px 0 6px; }
.sidebar-logo { width: 150px; height: auto; }
.sidebar-mark { display: none; width: 44px; height: auto; }
.sidebar-nav { display: grid; gap: 3px; align-content: start; flex: 1; overflow-y: auto; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px 0 14px; border-radius: 14px;
  font: 700 15px/1 var(--font-sans); color: rgba(247, 241, 230, 0.7); transition: background-color 150ms ease, color 150ms ease;
}
.nav-item i { font-size: 22px; flex: none; }
.nav-item.is-active { background: rgba(247, 241, 230, 0.1); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.nav-item.is-active::before { content: ''; position: absolute; left: -14px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--arena); }
@media (hover: hover) and (pointer: fine) { .nav-item:not(.is-active):hover { background: rgba(247, 241, 230, 0.06); color: #fff; } }
.nav-count {
  margin-left: auto; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center;
  background: rgba(247, 241, 230, 0.12); color: #fff; font: 700 12px/1 var(--font-sans); font-variant-numeric: tabular-nums;
}
.nav-count.is-hot { background: var(--tradicion); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--arena); color: var(--carbon); font: 700 14px/1 var(--font-sans); }
.sidebar-user-meta { display: grid; gap: 2px; min-width: 0; flex: 1; }
.sidebar-user-meta strong { color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-meta small { font-size: 12px; color: rgba(247, 241, 230, 0.55); }
.sidebar-user .btn { --btn-h: 38px; }

.admin-body { min-width: 0; display: flex; flex-direction: column; }
.admin-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 30px 36px 6px; }
.admin-title { font: 500 clamp(30px, 3.2vw, 40px)/1 var(--font-display); letter-spacing: -0.03em; }
.admin-subtitle { display: flex; align-items: center; gap: 7px; margin-top: 8px; color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.admin-subtitle i { font-size: 17px; color: var(--arena); }
.admin-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-user { display: none; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.admin-user i { font-size: 20px; }
.admin-header-actions [data-logout] { display: none; }
.admin-main { flex: 1; padding: 22px 36px 56px; display: grid; gap: 22px; align-content: start; }
/* toolbar above lists */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

@media (max-width: 1180px) {
  .admin { grid-template-columns: 100px minmax(0, 1fr); }
  .sidebar { padding: 18px 8px 14px; gap: 16px; }
  .sidebar-logo { display: none; }
  .sidebar-mark { display: block; }
  .nav-item { flex-direction: column; justify-content: center; gap: 5px; height: 64px; padding: 0 2px; font-size: 11px; letter-spacing: -0.01em; text-align: center; }
  .nav-item.is-active::before { left: -8px; }
  .nav-count { position: absolute; top: 5px; right: 8px; margin: 0; min-width: 20px; height: 18px; font-size: 11px; padding: 0 5px; }
  .sidebar-user { flex-direction: column; padding: 8px 4px; }
  .sidebar-user-meta { display: none; }
  .admin-header { padding: 24px 24px 4px; }
  .admin-main { padding: 18px 24px 40px; }
}
@media (max-width: 760px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: var(--z-nav); flex-direction: row; padding: 6px 6px max(6px, env(safe-area-inset-bottom));
    background: rgba(17, 14, 12, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .sidebar-brand, .sidebar-user { display: none; }
  .sidebar-nav { display: flex; overflow-x: auto; gap: 2px; scrollbar-width: none; }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: 1 0 74px; height: 58px; }
  .nav-item.is-active::before { display: none; }
  .admin-header { position: relative; padding: 20px 64px 2px 16px; }
  .admin-header-actions [data-logout] { display: inline-flex; position: absolute; top: 18px; right: 16px; width: 38px; padding: 0; }
  .admin-header-actions [data-logout] span { display: none; }
  .admin-main { padding: 14px 16px 104px; }
}
@media (min-width: 761px) { .admin-header-actions .admin-user { display: none; } }

/* ---------- reduced motion: keep fades, drop movement ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .js [data-reveal] { transform: none; filter: none; transition: opacity 300ms ease !important; }
}
