/* Generated by scripts/build_css.py from css/brand/*.css (studio brand tokens)
   and css/tabaibi.components.css. Do not edit: change those and rebuild. */

/* Generated from tokens/tokens.json by scripts/build_tokens.py. Do not edit. */

/* base: brand primitives */
:root {
  --ink: #000000;
  --paper: #FFFFFF;
  --charcoal: #222222;
  --mist: #F2F2F2;
  --status-success: #1B7A43;
  --status-success-tint: #EAF3ED;
  --status-warning: #8A5300;
  --status-warning-tint: #FBF2E4;
  --status-danger: #B3261E;
  --status-danger-tint: #F9E9E7;
  --font: "Manrope", sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px #000000;
  --transition: 150ms cubic-bezier(0, 0, .2, 1);
  --radius-control: 8px;
  --radius-card: 16px;
  --radius-surface: 20px;
  --radius-pill: 9999px;
  --tap-min: 44px;
}

/* semantic: product UI roles */
:root {
  --color-primary: #000000;
  --color-primary-hover: #222222;
  --color-primary-active: #000000;
  --color-accent: #000000;
  --color-accent-hover: #222222;
  --surface-app: #FFFFFF;
  --surface-card: #FFFFFF;
  --surface-panel: #F2F2F2;
  --surface-chat: #FFFFFF;
  --surface-hover: rgba(242, 242, 242, .6);
  --surface-input: #FFFFFF;
  --text-primary: #222222;
  --text-secondary: rgba(34, 34, 34, .65);
  --text-brand: #000000;
  --text-inverse: #FFFFFF;
  --border-structural: #F2F2F2;
  --border-variant: rgba(34, 34, 34, .35);
  --font-display: "Manrope", sans-serif;
  --font-text: "Manrope", sans-serif;
  --shadow-overlay: 0 20px 35px -8px rgba(0, 0, 0, .18);
  --overlay-fill: rgba(242, 242, 242, .8);
  --overlay-blur: none;
}

/* Generated from tokens/tokens.json by scripts/build_tokens.py. Do not edit. */

/* tabaibi: product overrides (load after sanchesque.css) */
:root {
  --brand-accent: #4F6B35;
  --brand-accent-hover: #3E5529;
  --brand-accent-tint: #EEF1EA;
  --color-accent: #4F6B35;
  --color-accent-hover: #3E5529;
  --logo-dark: #26504E;
  --logo-mid: #7FAB8E;
  --logo-light: #B7CEA4;
}

/* tabaibi: small logo mark (logos/tabaibi/svg/tabaibi-favicon.svg) */
:root {
  --logo-mark: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%2224 24 464 464%22 role=%22img%22 aria-labelledby=%22t%22%3E%3Ctitle id=%22t%22%3ETabaibi%3C/title%3E%3Crect x=%2224%22 y=%2224%22 width=%22464%22 height=%22464%22 rx=%2296%22 fill=%22%2326504E%22/%3E%3Cg fill=%22%237FAB8E%22%3E%3Cellipse cx=%22349%22 cy=%22264%22 rx=%22102%22 ry=%2230%22 transform=%22rotate%28-30 256 264%29%22/%3E%3Cellipse cx=%22349%22 cy=%22264%22 rx=%22102%22 ry=%2230%22 transform=%22rotate%28-90 256 264%29%22/%3E%3Cellipse cx=%22349%22 cy=%22264%22 rx=%22102%22 ry=%2230%22 transform=%22rotate%28-150 256 264%29%22/%3E%3C/g%3E%3Cg fill=%22%23B7CEA4%22%3E%3Cellipse cx=%22349%22 cy=%22264%22 rx=%22102%22 ry=%2230%22 transform=%22rotate%280 256 264%29%22/%3E%3Cellipse cx=%22349%22 cy=%22264%22 rx=%22102%22 ry=%2230%22 transform=%22rotate%28-60 256 264%29%22/%3E%3Cellipse cx=%22349%22 cy=%22264%22 rx=%22102%22 ry=%2230%22 transform=%22rotate%28-120 256 264%29%22/%3E%3Cellipse cx=%22349%22 cy=%22264%22 rx=%22102%22 ry=%2230%22 transform=%22rotate%28-180 256 264%29%22/%3E%3C/g%3E%3Ccircle cx=%22256%22 cy=%22246%22 r=%2246%22 fill=%22%23B7CEA4%22 stroke=%22%2326504E%22 stroke-width=%2210%22/%3E%3Cpath d=%22M168 300L176 360Q177 372 190 372H322Q335 372 336 360L344 300Z%22 fill=%22%23B7CEA4%22 stroke=%22%2326504E%22 stroke-width=%2210%22 stroke-linejoin=%22round%22/%3E%3Crect x=%22150%22 y=%22270%22 width=%22212%22 height=%2236%22 rx=%2210%22 fill=%22%23B7CEA4%22 stroke=%22%2326504E%22 stroke-width=%2210%22/%3E%3C/svg%3E");
}

/* ================================================================
   tabaibi.components.css: component layer of the Tabaibi design system.
   Edit this file, then run scripts/build_css.py to regenerate tabaibi.css.
   Structure:
   1. Tokens            2. Reset + base     3. Tipografía utilidades
   4. Iconos             5. Botones          6. Badges / dots
   7. Superficies        8. Formularios      9. Feedback (bars/notice)
   10. Tablas            11. Modal           12. Shell/Nav (dashboard)
   13. Chat (guest)      14. Responsive
   Dependencias: Google Fonts (Manrope, Material
   Symbols Outlined). Sin Tailwind, sin framework.
   ================================================================ */

/* ---------------- 1. Tokens (layout layer) ---------------------- */
/* Colours, status palette, fonts, radii, focus ring and motion come from
   brand/ (sanchesque.css + tabaibi.css, prepended by scripts/build_css.py).
   Only the panel's own layout scale lives here. */
:root {
  --color-gold: #F2F2F2;
  --status-warning-strong: #8A5300;
  --tier-1: #222222;
  --tier-1-tint: rgba(34, 34, 34, .08);
  --tier-1-border: rgba(34, 34, 34, .22);
  --tier-2: #222222;
  --tier-2-tint: rgba(34, 34, 34, .08);
  --tier-2-border: rgba(34, 34, 34, .22);
  --tier-3: #222222;
  --tier-3-tint: rgba(34, 34, 34, .08);
  --tier-3-border: rgba(34, 34, 34, .22);
  --fs-display: 48px;
  --lh-display: 56px;
  --fs-headline-lg: 32px;
  --lh-headline-lg: 40px;
  --fs-headline-md: 24px;
  --lh-headline-md: 32px;
  --fs-headline-sm: 20px;
  --lh-headline-sm: 28px;
  --fs-title-md: 16px;
  --lh-title-md: 24px;
  --fs-title-sm: 14px;
  --lh-title-sm: 20px;
  --fs-body-lg: 16px;
  --lh-body-lg: 24px;
  --fs-body-md: 14px;
  --lh-body-md: 20px;
  --fs-body-sm: 12px;
  --lh-body-sm: 16px;
  --fs-label-md: 12px;
  --lh-label-md: 16px;
  --fs-label-sm: 11px;
  --lh-label-sm: 14px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --gutter: 24px;
  --margin-page: 32px;
  --radius-sm: 4px;
  --radius-input: 8px;
  --radius-lg: 20px;
  --radius-modal: 24px;
  --radius-bubble: 16px;
  --radius-frame: 28px;
  --shadow-sunlit: 0 4px 20px -2px rgba(0, 0, 0, .04);
  --shadow-sunlit-hover: 0 4px 20px -2px rgba(0, 0, 0, .04);
  --control-h: 40px;
  --control-h-sm: 32px;
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 24px;
  --sidebar-w: 256px;
  --topbar-h: 64px;
  --chat-max: 410px;
}

/* ---------------- 2. Reset + base -------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* display:none from the UA sheet loses to any author display rule */
[hidden] { display: none !important; }
.page::-webkit-scrollbar, .sidenav::-webkit-scrollbar { width: 10px; }
.page::-webkit-scrollbar-track, .sidenav::-webkit-scrollbar-track { background: transparent; }
.page::-webkit-scrollbar-thumb, .sidenav::-webkit-scrollbar-thumb {
  background: var(--border-variant); border-radius: var(--radius-pill);
  border: 3px solid var(--surface-app); }
.page::-webkit-scrollbar-thumb:hover { background: var(--border-variant); }
.page { scrollbar-width: thin; scrollbar-color: var(--border-variant) transparent; }
.sidenav { scrollbar-width: thin; scrollbar-color: var(--border-variant) transparent; }
html { height: 100%; }
body {
  min-height: 100%;
  font-family: var(--font-text);
  font-size: var(--fs-body-md); line-height: var(--lh-body-md);
  color: var(--text-primary); background: var(--surface-app);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

/* ---------------- 3. Tipografía ----------------------------------- */
.t-display   { font: 600 var(--fs-display)/var(--lh-display) var(--font-display); letter-spacing: -.02em; }
.t-headline-lg { font: 600 var(--fs-headline-lg)/var(--lh-headline-lg) var(--font-display); letter-spacing: -.015em; }
.t-headline-md { font: 500 var(--fs-headline-md)/var(--lh-headline-md) var(--font-display); letter-spacing: -.01em; }
.t-headline-sm { font: 500 var(--fs-headline-sm)/var(--lh-headline-sm) var(--font-display); }
.t-title-md   { font: 600 var(--fs-title-md)/var(--lh-title-md) var(--font-text); }
.t-title-sm   { font: 600 var(--fs-title-sm)/var(--lh-title-sm) var(--font-text); }
.t-body-lg    { font: 400 var(--fs-body-lg)/var(--lh-body-lg) var(--font-text); }
.t-body-sm    { font: 400 var(--fs-body-sm)/var(--lh-body-sm) var(--font-text); }
.t-label-md   { font: 600 var(--fs-label-md)/var(--lh-label-md) var(--font-text); letter-spacing: .02em; }
.t-label-sm   { font: 600 var(--fs-label-sm)/var(--lh-label-sm) var(--font-text); letter-spacing: .04em; }
.t-c-brand    { color: var(--color-primary); }
.t-c-muted    { color: var(--text-secondary); }
.t-tnum       { font-variant-numeric: tabular-nums; }
.t-mono       { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.t-uppercase  { text-transform: uppercase; }
/* KPI card label: 13 px sentence case reads better than 11 px capitals */
.stat-label   { font: 600 13px/18px var(--font-text); color: var(--text-secondary); }

/* ---------------- 4. Iconos --------------------------------------- */
.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.icon-sm svg, .icon-sm .material-symbols-outlined { font-size: var(--icon-sm); }
.icon-md .material-symbols-outlined { font-size: var(--icon-md); }
.icon-lg .material-symbols-outlined { font-size: var(--icon-lg); }
[data-icon] { user-select: none; } /* el texto interno del ligature no se copia */

/* ---------------- 5. Botones -------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  min-height: var(--control-h); padding: 10px 20px;
  border-radius: var(--radius-card); border: var(--border-w) solid transparent;
  font: 600 var(--fs-title-sm)/var(--lh-title-sm) var(--font-text);
  transition: background var(--transition), box-shadow var(--transition), transform 80ms;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn--sm { min-height: var(--control-h-sm); padding: 5px 12px; font-size: var(--fs-label-sm); border-radius: var(--radius-input); }
.btn--primary { background: var(--color-primary); color: var(--text-inverse); box-shadow: var(--shadow-sunlit); }
.btn--primary:hover:not(:disabled) { background: var(--color-primary-hover); }
.btn--accent { background: var(--color-accent); color: var(--text-inverse); box-shadow: var(--shadow-sunlit); }
.btn--accent:hover:not(:disabled) { background: var(--color-accent-hover); }
.btn--success { background: var(--status-success); color: var(--text-inverse); }
.btn--success:hover:not(:disabled) { background: #166637; }
.btn--danger { background: var(--status-danger); color: var(--text-inverse); }
.btn--secondary { background: var(--surface-card); border-color: var(--border-structural); color: var(--text-primary); }
.btn--secondary:hover:not(:disabled) { background: var(--surface-panel); }
.btn--danger-outline { background: transparent; border-color: rgba(179, 38, 30, .4); color: var(--status-danger); }
.btn--danger-outline:hover:not(:disabled) { background: var(--status-danger-tint); }
.btn--ghost { color: var(--text-secondary); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-panel); color: var(--text-primary); }
.btn--icon { min-height: 36px; min-width: 36px; padding: 0; border-radius: var(--radius-input); }
.btn--block { width: 100%; }

/* ---------------- 6. Badges / dots -------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font: 600 var(--fs-label-sm)/var(--lh-label-sm) var(--font-text);
  border: 1px solid transparent; white-space: nowrap;
}
.badge--neutral { background: var(--surface-app); color: var(--text-secondary); border-color: var(--border-structural); }
.badge--mono { background: var(--surface-app); color: var(--text-brand); font-family: ui-monospace, monospace; font-size: 11px; }
.badge--success { background: var(--status-success-tint); color: var(--status-success); border-color: rgba(27, 122, 67, .3); }
.badge--warning { background: var(--status-warning-tint); color: var(--status-warning-strong); border-color: rgba(138, 83, 0, .3); }
.badge--danger  { background: var(--status-danger-tint); color: var(--status-danger); border-color: rgba(179, 38, 30, .3); }
.badge--tier-1 { background: var(--tier-1-tint); color: var(--tier-1); border-color: var(--tier-1-border); }
.badge--tier-2 { background: var(--tier-2-tint); color: var(--tier-2); border-color: var(--tier-2-border); }
.badge--tier-3 { background: var(--tier-3-tint); color: var(--tier-3); border-color: var(--tier-3-border); }
.badge--alert { background: var(--status-warning); color: #fff; } /* dataset hambriento */

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot--sm { width: 6px; height: 6px; }
.dot--success { background: var(--status-success); }
.dot--warning { background: var(--status-warning); }
.dot--danger  { background: var(--status-danger); }
.pulse { animation: gb-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; }
@keyframes gb-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(1.15); } }

/* ---------------- 7. Superficies ----------------------------------- */
.card {
  background: var(--surface-card); border: 1px solid var(--border-structural);
  border-radius: var(--radius-lg); padding: var(--space-lg);
  box-shadow: var(--shadow-sunlit);
}
.card--interactive:hover { box-shadow: var(--shadow-sunlit-hover); }
.card--warning { border: 2px solid rgba(231, 111, 81, .4); }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding-bottom: var(--space-md); margin-bottom: var(--space-md); border-bottom: 1px solid var(--border-hair, var(--border-structural)); }

/* ---------------- 8. Formularios ---------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font: 600 var(--fs-label-md)/var(--lh-label-md) var(--font-text); color: var(--text-primary); }
.input, .select, textarea.input {
  width: 100%; min-height: var(--control-h); padding: 8px 14px;
  background: var(--surface-input); border: 1px solid var(--border-structural);
  border-radius: var(--radius-input); color: var(--text-primary);
  font: 400 var(--fs-body-md)/var(--lh-body-md) var(--font-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input::placeholder { color: var(--text-secondary); }
.input:hover, .select:hover { border-color: var(--border-variant); }
.input:focus, .select:focus { outline: none; border-color: var(--color-primary); box-shadow: var(--focus-ring); }
.select-wrap { position: relative; }
.select-wrap .material-symbols-outlined { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-secondary); }
.select { appearance: none; padding-right: 36px; cursor: pointer; }

/* RadioCard (selección de tier): input real oculto, tarjeta visual */
.radio-card { position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 14px; border: 1px solid var(--border-structural); border-radius: var(--radius-card);
  cursor: pointer; background: var(--surface-card); transition: all var(--transition); }
.radio-card:hover { background: var(--surface-panel); }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card input:checked ~ .radio-card__body,
.radio-card:has(input:checked) { border: 2px solid var(--color-primary); background: rgba(34, 34, 34, .04); }
.radio-card input:focus-visible ~ .radio-card__body { box-shadow: var(--focus-ring); }

/* Checkbox / radio estándar */
input[type="checkbox"], input[type="radio"] { accent-color: var(--color-primary); width: 18px; height: 18px; }

/* ---------------- 9. Feedback -------------------------------------- */
.progress { height: 8px; background: var(--surface-panel); border-radius: var(--radius-pill); overflow: hidden; }
.progress__fill { height: 100%; border-radius: var(--radius-pill); background: var(--color-primary); transition: width var(--transition); }
.progress__fill--success { background: var(--status-success); }
.progress__fill--warning { background: var(--status-warning); }
.progress__fill--danger  { background: var(--status-danger); }

.notice { display: flex; gap: 14px; padding: var(--space-md); border-radius: var(--radius-card); background: var(--status-warning-tint); border: 1px solid rgba(138, 83, 0, .3); }
.notice__icon { flex: none; width: 32px; height: 32px; border-radius: var(--radius-input);
  display: grid; place-items: center; background: rgba(138, 83, 0, .12); color: var(--status-warning); }
.notice--danger { background: var(--status-danger-tint); border-color: rgba(179, 38, 30, .3); }
.notice--success { background: var(--status-success-tint); border-color: rgba(27, 122, 67, .3); }
/* launch kit: QR codes per guest source */
.qr-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.qr-card { display: flex; flex-direction: column; gap: 6px; padding: var(--space-md);
  border: 1px solid var(--border-variant); border-radius: var(--radius-card); background: var(--surface-card); }
.qr-card__code svg { width: 132px; height: auto; display: block; background: #fff; border-radius: var(--radius-input); }
.qr-card__url { word-break: break-all; color: var(--text-secondary); }
.notice--success .notice__icon { background: rgba(27, 122, 67, .12); color: var(--status-success); }

.skeleton { background: linear-gradient(90deg, var(--surface-app) 25%, var(--surface-panel) 50%, var(--surface-app) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-input); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------- 10. Tablas -------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-body-md); }
.table thead th { text-align: left; font: 600 var(--fs-label-sm)/var(--lh-label-sm) var(--font-text);
  letter-spacing: .04em; color: var(--text-secondary);
  padding: 14px 16px; background: rgba(242, 242, 242, .5); border-bottom: 1px solid var(--border-structural); }
.table tbody td { padding: 16px; border-bottom: 1px solid var(--border-structural); vertical-align: middle; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: rgba(242, 242, 242, .5); }
/* Alert rows: a red edge plus the ALERTA badge. No full-row tint, so an
   alert still stands out when many rows are in alert at once. */
.table tr.row--critical td:first-child { box-shadow: inset 3px 0 0 var(--status-danger); }
.table-wrap { overflow-x: auto; }

/* ---------------- 11. Modal ---------------------------------------- */
.modal-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--space-md); overscroll-behavior: contain;
  background: var(--overlay-fill); backdrop-filter: var(--overlay-blur); }
.modal { width: 100%; max-width: 672px; max-height: 90vh; overflow-y: auto;
  /* wheel over an open dialog must never scroll the page behind it:
     without containment Chromium chains the scroll through the top
     layer and the modal looks like a bar sliding over the sidebar */
  overscroll-behavior: contain;
  background: var(--surface-card); border: 1px solid var(--border-structural);
  border-radius: var(--radius-modal); box-shadow: var(--shadow-overlay); }
.modal[hidden], .modal-overlay[hidden] { display: none; }
.modal__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  padding: 20px 28px; border-bottom: 1px solid var(--border-structural); }
.modal__body { padding: 28px; display: flex; flex-direction: column; gap: var(--space-lg); }
.modal__footer { display: flex; justify-content: flex-end; gap: var(--space-md);
  padding: 20px 28px; border-top: 1px solid var(--border-structural); }

/* ---------------- 12. Shell / navegación --------------------------- */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.topbar { position: relative; z-index: 30; flex: none; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg);
  padding: 0 var(--space-xl); background: var(--surface-card); border-bottom: 1px solid var(--border-structural); }
.shell { display: flex; flex: 1; min-height: 0; }
.sidenav { width: var(--sidebar-w); flex: none; background: var(--surface-app);
  overscroll-behavior-y: contain;
  border-right: 1px solid var(--border-structural); padding: var(--space-md);
  display: flex; flex-direction: column; justify-content: space-between;
  overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
.sidenav__item { display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: var(--radius-card); color: var(--text-secondary); font: 600 var(--fs-label-md)/var(--lh-label-md) var(--font-text); }
.sidenav__item:hover { background: var(--surface-card); color: var(--text-primary); }
.sidenav__item[aria-current="page"] { background: rgba(34, 34, 34, .08); color: var(--text-brand); }
.sidenav__item .material-symbols-outlined { font-size: var(--icon-lg); color: var(--border-variant); }
.sidenav__item[aria-current="page"] .material-symbols-outlined { color: var(--color-primary); }
.page { flex: 1; min-width: 0; overflow-y: scroll; overflow-x: hidden;
  /* no scroll chaining and no rubber-band past the ends: on macOS the
     bounce revealed the container's white background over the whole
     dashboard area ("a white bar covering everything") */
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  padding: var(--space-xl); display: flex; flex-direction: column; gap: var(--space-xl); }
.page__header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-md); }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--text-secondary);
  font: 600 var(--fs-label-md)/var(--lh-label-md) var(--font-text); }

/* ---------------- 13. Chat (huésped) ------------------------------- */
.chat-frame { display: flex; flex-direction: column; width: 100%; max-width: var(--chat-max);
  height: 100dvh; background: var(--surface-chat); overflow: hidden; }
@media (min-width: 640px) { .chat-frame { height: calc(100dvh - 32px); max-height: 884px; border-radius: var(--radius-frame); border: 1px solid rgba(34, 34, 34, .14); box-shadow: var(--shadow-overlay); } }
.chat-head { position: sticky; top: 0; z-index: 20; background: var(--surface-card);
  border-bottom: 1px solid rgba(34, 34, 34, .14);
  padding: 12px 16px 8px; }
.chat-stream { flex: 1; overflow-y: auto; padding: var(--space-md);
  display: flex; flex-direction: column; gap: var(--space-md);
  background: var(--surface-app); scrollbar-width: none; }
.chat-stream::-webkit-scrollbar { display: none; }
.chat-msg { display: flex; gap: 10px; max-width: 94%; }
.chat-msg--guest { flex-direction: column; align-items: flex-end; margin-left: auto; }
.chat-bubble { padding: 14px; background: var(--surface-card); border: 1px solid rgba(34, 34, 34, .14);
  border-radius: var(--radius-bubble) var(--radius-bubble) var(--radius-bubble) 4px; box-shadow: var(--shadow-sunlit); }
.chat-msg--guest .chat-bubble { background: var(--color-primary); color: var(--text-inverse);
  border: 0; border-radius: var(--radius-bubble) var(--radius-bubble) 4px var(--radius-bubble); }
.chat-derive { background: var(--status-warning-tint); border-left: 4px solid var(--status-warning);
  border-radius: 4px 16px 16px 16px; padding: 14px; }
.chat-trust { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
  background: var(--status-success-tint); border: 1px solid rgba(27, 122, 67, .3);
  border-radius: var(--radius-card); padding: 6px 12px; font: 600 var(--fs-label-sm)/var(--lh-label-sm) var(--font-text); }
.chat-chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 28px 4px; scrollbar-width: none; }
.chat-chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: var(--surface-card); border: 1px solid rgba(34, 34, 34, .14); border-radius: var(--radius-pill);
  font: 600 var(--fs-label-sm)/var(--lh-label-sm) var(--font-text); transition: all var(--transition); }
.chip:hover { background: var(--surface-panel); }
/* Desktop affordance for the horizontally scrollable chips row.
   Buttons live outside the scroll container (a scroller clips and drags
   absolutely-positioned children with the content) and anchor to the wrapper. */
.chat-chips-wrap { position: relative; }
.chip-scroll { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  display: none; place-items: center; width: 28px; height: 28px;
  background: var(--surface-card); border: 1px solid var(--border-structural);
  border-radius: var(--radius-pill); color: var(--text-brand);
  box-shadow: var(--shadow-overlay); cursor: pointer; }
.chip-scroll:hover { background: var(--surface-panel); }
.chip-scroll--left { left: 0; }
.chip-scroll--right { right: 0; }
@media (min-width: 768px) { .chip-scroll:not([hidden]) { display: grid; } }

.chip:active { transform: scale(.95); }
.chip--active { background: rgba(34, 34, 34, .1); border-color: rgba(34, 34, 34, .25); color: var(--text-brand); }
.chat-composer { position: sticky; bottom: 0; z-index: 20; background: var(--surface-card);
  border-top: 1px solid rgba(34, 34, 34, .14); padding: 12px 12px 20px; box-shadow: var(--shadow-sunlit); }
.chat-composer form { display: flex; align-items: center; gap: 8px; }
.composer-input { flex: 1; display: flex; position: relative; align-items: center; }
.composer-input input { width: 100%; background: var(--surface-input); border: 1px solid var(--border-variant);
  border-radius: var(--radius-pill); padding: 10px 40px 10px 16px; min-height: var(--control-h); }
.composer-input input:focus { outline: none; border-color: var(--color-primary); box-shadow: var(--focus-ring); }
.typing { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); padding: 4px; }
.typing span.b { width: 6px; height: 6px; border-radius: 50%; background: var(--border-variant); animation: gb-bounce 1.2s infinite; }
.typing span.b:nth-child(2) { animation-delay: .2s; } .typing span.b:nth-child(3) { animation-delay: .4s; }
@keyframes gb-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ---------------- 14. Responsive ----------------------------------- */
.hamburger { display: none; }
@media (max-width: 1023px) {
  .sidenav { position: fixed; top: var(--topbar-h); bottom: 0; left: 0; z-index: 40;
    height: auto; transform: translateX(-100%);
    transition: transform var(--transition); box-shadow: var(--shadow-overlay); }
  .sidenav[data-open="true"] { transform: none; }
  .sidenav__scrim { position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 39;
    background: var(--overlay-fill); backdrop-filter: var(--overlay-blur); }
  .hamburger { display: inline-flex; }
}
@media (max-width: 767px) {
  .page { padding: var(--space-md); gap: var(--space-md); }
  .card { padding: var(--space-md); border-radius: var(--radius-card); }
  .btn { min-height: var(--tap-min); }
  /* Tabla → tarjetas: marcar wrapper para render alternativo desde Jinja */
  .table-mobile-cards thead { display: none; }
  .table-mobile-cards tr { display: block; border: 1px solid var(--border-structural); border-radius: var(--radius-card); margin-bottom: var(--space-sm); }
  .table-mobile-cards td { display: flex; justify-content: space-between; gap: var(--space-md); border: 0; }
  .table-mobile-cards td::before { content: attr(data-label); font: 600 var(--fs-label-sm)/var(--lh-label-sm) var(--font-text);
    color: var(--text-secondary); }
  .table-mobile-cards tr.row--critical { border-left: 3px solid var(--status-danger); }
  .table-mobile-cards tr.row--critical td:first-child { box-shadow: none; }
}

/* Utilidades --------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- AppShell: topbar / sidenav / stats (añadido en rebuild) -- */
.topbar__brand { display: flex; align-items: center; gap: 12px; }
/* App avatar. The Tabaibi mark (brand DESIGN.md §12: simplified symbol
   on its own dark tile) comes from brand as --logo-mark. */
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px;
  background: var(--color-primary); padding: 6px;
  border-radius: var(--radius-card); }
.brand-mark--lg { width: 40px; height: 40px; background: transparent; padding: 0; }
.brand-mark--tabaibi { background: var(--logo-mark) center / contain no-repeat; padding: 0; }
.login-logo { display: block; height: 64px; width: auto; }
/* endorsement (brand DESIGN.md §12): smaller than the product name */
.login-byline { display: block; height: 20px; width: auto; margin-top: 6px; }
.topbar__trailing { display: flex; align-items: center; gap: 12px; }
.v-sep { width: 1px; height: 24px; background: var(--border-structural); }
.sidenav__group { display: flex; flex-direction: column; gap: 6px; }
.sidenav__item { position: relative; }
.sidenav__badge { position: absolute; right: 12px; }
.sidenav__cta { margin: var(--space-md) 0; padding: 14px; background: rgba(242, 242, 242, .7);
  border: 1px solid var(--border-structural); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; gap: 8px; }
.sidenav__footer { border-top: 1px solid var(--border-structural); padding-top: 10px; }
.page__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); }
.stat-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-card); }
.stat-icon--primary { background: rgba(34, 34, 34, .08); color: var(--text-brand); }
.stat-icon--success { background: var(--status-success-tint); color: var(--status-success); border: 1px solid rgba(27, 122, 67, .25); }
.stat-icon--warning { background: var(--status-warning-tint); color: var(--status-warning); border: 1px solid rgba(138, 83, 0, .25); }
.stat-icon--danger  { background: var(--status-danger-tint); color: var(--status-danger); border: 1px solid rgba(179, 38, 30, .25); }
.stat-extra { margin-top: var(--space-md); padding-top: 12px; border-top: 1px solid var(--border-structural);
  display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap;
  font: 600 var(--fs-label-sm)/var(--lh-label-sm) var(--font-text); }
.kpi-row { display: grid; gap: var(--space-lg); grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1023px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .kpi-row { grid-template-columns: 1fr; } }

/* Celdas de tabla tipadas */
.device-cell { display: flex; align-items: center; gap: 12px; }
.device-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: var(--radius-card); font: 700 12px var(--font-text); }
.device-avatar--ok      { background: rgba(34, 34, 34, .08); color: var(--text-brand); }
.device-avatar--warning { background: var(--status-warning-tint); color: var(--status-warning-strong); }
.device-avatar--danger  { background: var(--status-danger-tint); color: var(--status-danger); }
.device-id { display: block; font-weight: 700; font-size: 13px; color: var(--text-brand); }
.count-pill { display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; border-radius: var(--radius-pill);
  background: var(--surface-app); font: 700 11px var(--font-text); }
.count-pill--warn { background: var(--status-warning-tint); color: var(--status-warning-strong); }
.count-pill--danger { background: var(--status-danger-tint); color: var(--status-danger); }

/* Cola de etiquetado / editor FAQ */
.two-col { display: grid; grid-template-columns: 8fr 4fr; gap: var(--space-lg); align-items: start; }
@media (max-width: 1023px) { .two-col { grid-template-columns: 1fr; } }
.query-box { background: rgba(242, 242, 242, .5); border: 1px solid rgba(34, 34, 34, .14);
  border-radius: var(--radius-card); padding: var(--space-md); margin-bottom: var(--space-md); }
.query-box p { font: 600 var(--fs-body-lg)/var(--lh-body-lg) var(--font-text); }
.meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 12px;
  margin-bottom: var(--space-md); border-bottom: 1px solid var(--border-structural); }
.actions-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding-top: 12px; border-top: 1px solid var(--border-structural); flex-wrap: wrap; }
.entry-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.answer-box { background: var(--surface-app); border: 1px solid var(--border-structural);
  border-radius: var(--radius-input); padding: 12px; }
.paraf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* Read-only paraphrase chips in the Packages entry card */
.parachip {
  display: inline-flex; align-items: center; max-width: 100%;
  padding: 3px 10px; background: var(--surface-app);
  border: 1px solid var(--border-structural); border-radius: var(--radius-pill);
  font: 400 var(--fs-label-sm)/var(--lh-label-sm) var(--font-text);
  color: var(--text-primary); overflow-wrap: anywhere;
}

/* Formularios y misc del rebuild */
.form-grid { display: flex; flex-direction: column; gap: var(--space-lg); }
fieldset.field { border: 0; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
@media (max-width: 767px) { .field-pair { grid-template-columns: 1fr; } }
.radio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
@media (max-width: 767px) { .radio-grid { grid-template-columns: 1fr; } }
.radio-card__body { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.t-center { text-align: center; } .t-right { text-align: right; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: var(--space-sm);
  text-align: center; padding: var(--space-2xl) var(--space-lg); }
.empty-state .material-symbols-outlined { color: var(--text-secondary); opacity: .6; }
.key-panel { background: var(--status-success-tint); border: 1px solid rgba(27, 122, 67, .3);
  border-radius: var(--radius-card); padding: var(--space-lg); }
.key-panel code { display: block; margin-top: 8px; word-break: break-all;
  font-family: ui-monospace, monospace; font-size: 15px; color: var(--text-primary); }
.release-pill--activa { background: var(--status-success-tint); color: var(--status-success); border-color: rgba(27, 122, 67, .3); }

/* Utilidades (sustituyen estilos inline) + modal <dialog> */
.push-right { margin-left: auto; }
.mt-md { margin-top: var(--space-md); } .mt-sm { margin-top: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); } .ml-sm { margin-left: var(--space-sm); }
.row-start { justify-content: flex-start; }
.list-tight { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.pre-log { white-space: pre-wrap; margin-top: 8px; background: var(--surface-app);
  padding: 12px; border-radius: var(--radius-input); }
.summary-link { cursor: pointer; }
.w-340 { max-width: 340px; }
.w-96 { max-width: 96px; }

dialog.modal { border: 0; padding: 0; width: min(672px, calc(100vw - 32px)); }
/* El reset universal (* { margin: 0 }) anula el margin:auto del User Agent,
   que es el que centra <dialog> al abrirlo con showModal(): centrado explicito. */
dialog.modal:modal { position: fixed; inset: 0; margin: auto; height: fit-content; }
dialog.modal::backdrop { background: var(--overlay-fill); backdrop-filter: var(--overlay-blur); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  padding: 20px 28px; border-bottom: 1px solid var(--border-structural); }
.modal__body-pad { padding: 28px; }
.meta-row--flush { border: 0; padding-bottom: 0; margin-bottom: 12px; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; }

/* Chat PNT-01 (rebuild) */
.brand-mark__dot { position: absolute; right: -2px; bottom: -2px; border: 2px solid var(--surface-card); }
/* Client logo from a Tier 1 branding package (replaces the header mark) */
.chat-logo { width: 40px; height: 40px; border-radius: var(--radius-input);
  object-fit: cover; flex: none; }
.chat-brand { display: flex; align-items: center; gap: 10px; }
.chat-head .badge { flex: none; }
.msg-avatar { display: grid; place-items: center; width: 28px; height: 28px; flex: none;
  background: var(--color-primary); color: var(--text-inverse); border-radius: 10px; margin-top: 2px; }
.msg-name { font-weight: 700; color: var(--color-primary); }
.msg-meta { align-self: flex-end; padding-right: 4px; }
.chat-msg--guest .chat-bubble { margin-bottom: 4px; }
.stack { display: flex; flex-direction: column; gap: 8px; flex: 1; }
/* Solo la pagina de chat del huesped centra su marco; NUNCA aplicar al dashboard */
@media (min-width: 640px) { .chat-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; } }

/* Auth, notificaciones, ajustes (v2) */
.login-body { display: grid; place-items: center; min-height: 100vh;
  background: var(--color-primary); padding: 16px; }
.login-card { width: 100%; max-width: 420px; background: var(--surface-card);
  border-radius: var(--radius-modal); padding: var(--space-xl);
  box-shadow: var(--shadow-overlay); display: flex; flex-direction: column; gap: var(--space-lg); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.notif-count { position: absolute; margin-left: 22px; margin-top: -22px;
  background: var(--color-primary); color: var(--text-inverse);
  font: 700 10px var(--font-text); border-radius: var(--radius-pill);
  padding: 1px 5px; }
.topbar__trailing { position: relative; }
.card--unread { border-left: 4px solid var(--color-primary); }
.stack { display: flex; flex-direction: column; gap: var(--space-lg); }


/* Topbar responsive: tablet oculta entorno/hotel/email; movil tambien el titulo */
@media (max-width: 1023px) {
  .topbar { padding: 0 var(--space-md); }
  .topbar__entorno, .topbar__hotel, .topbar__email, .v-sep { display: none; }
}
@media (max-width: 767px) {
  .topbar__titulo { display: none; }
  .topbar__trailing { gap: 2px; }
}

/* Ciclo de vida del dispositivo en la flota */
.row--inactive td { opacity: .55; }
.row--inactive td .actions-row { opacity: 1; }

/* Feedback del huesped (like/dislike) en respuestas del bot */
.msg-feedback { display: flex; align-items: center; gap: 4px; padding-top: 6px; }
.fb-btn { display: inline-grid; place-items: center; width: 30px; height: 30px;
  border-radius: var(--radius-input); color: var(--text-secondary); transition: all var(--transition); }
.fb-btn:hover { background: var(--surface-panel); color: var(--text-primary); }
.fb-btn[aria-pressed="true"] { color: var(--status-success); background: var(--status-success-tint); }
.fb-btn[aria-pressed="true"].fb-btn--down { color: var(--status-danger); background: var(--status-danger-tint); }
.fb-btn[disabled] { opacity: .45; cursor: default; }
.fb-hint { font: 600 var(--fs-label-sm)/var(--lh-label-sm) var(--font-text);
  color: var(--text-secondary); margin-left: auto; }

/* FAQ authoring prompt (Packages page) */
.prompt-box { max-height: 320px; overflow: auto; white-space: pre-wrap;
  background: var(--surface-panel, #f6f6f6); border: 1px solid var(--border, #ddd);
  border-radius: var(--radius-input, 8px); padding: 12px 16px;
  font: 400 12px/1.6 var(--font-mono, monospace); margin: 0; }

/* ---------- Row actions menu (fleet) ---------- */
/* <details class="menu" data-menu>: the list is fixed-positioned by the
   script in base.html, so the table's horizontal scroll cannot clip it. */
.device-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.device-actions .btn { white-space: nowrap; }
.table .select-wrap { min-width: 96px; }
.table td .actions-row { border-top: 0; padding-top: 0; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: var(--surface-hover); }
.menu__list { position: fixed; z-index: 50; min-width: 240px; padding: 6px;
  display: flex; flex-direction: column; background: var(--surface-card);
  border: 1px solid var(--border-structural); border-radius: var(--radius-card);
  box-shadow: var(--shadow-overlay); }
.menu__list form { display: contents; }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--tap-min);
  padding: 0 12px; border: 0; border-radius: var(--radius-input); background: none;
  color: var(--text-primary); font: 500 var(--fs-body-md) var(--font-text); text-align: left; cursor: pointer; }
.menu__item:hover, .menu__item:focus-visible { background: var(--surface-hover); }
.menu__item--danger { color: var(--status-danger); }
.menu__sep { border: 0; border-top: 1px solid var(--border-structural); margin: 6px 0; }

/* Touch screens: every control reaches the 44 px of brand DESIGN.md §11 */
@media (pointer: coarse), (max-width: 767px) {
  .btn.btn--sm, .btn.btn--icon, .select { min-height: var(--tap-min); }
  .btn.btn--icon { min-width: var(--tap-min); }
}

/* ---------- File inputs ---------- */
/* Native file inputs keep their accessibility and file name; only the
   browser's button is restyled as a secondary button. */
input[type="file"].input { padding: 6px; cursor: pointer; color: var(--text-secondary); }
input[type="file"].input::file-selector-button {
  margin-right: 12px; min-height: var(--control-h-sm); padding: 5px 14px;
  border: 1px solid var(--border-variant); border-radius: var(--radius-input);
  background: var(--surface-card); color: var(--text-primary);
  font: 600 var(--fs-label-md) var(--font-text); cursor: pointer;
  transition: background var(--transition); }
input[type="file"].input:hover::file-selector-button { background: var(--surface-hover); }

/* ---------- Labeling: filters above the queue ---------- */
.queue-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.queue-toolbar .actions-row { padding-top: 0; border-top: 0; }
.queue-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; }
.queue-search .input { flex: 1; min-width: 200px; }

/* ---------- Technical details (collapsed help) ---------- */
.tech-details { margin-top: 4px; }
.tech-details > summary { color: var(--text-secondary); }
.tech-details > p { margin-top: 6px; }
