/* ==========================================================================
   Cluster Events — sistema de diseño (marca Exploring Puerto Plata)
   Tokens tomados de exploringpuertoplata.com (src/styles/tokens.css).
   Usar siempre las variables de :root; no inventar colores.
   ========================================================================== */

:root {
  /* Marca Exploring */
  --azul-nautico: #003B5C;
  --noche: #0C1E49;
  --arena: #F6F1E7;
  --azul: #0058DE;
  --amarillo: #FEC72C;
  --turquesa: #48D3E7;
  --verde: #04A860;
  --rojo: #DE0910;
  --naranja: #FD8A0C;
  --lima: #A1CE42;
  --magenta: #EB248E;
  --rosa: #FC4E80;

  /* Superficies */
  --bg: #F6F1E7;
  --card: #FFFFFF;
  --border: #D5DEE5;

  /* Texto */
  --text: #003B5C;
  --text-2: #4A6275;

  /* Principal (azul Exploring: botones y enlaces) */
  --primary: #0058DE;
  --primary-hover: #0047B3;
  --on-primary: #FFFFFF;

  /* Acentos */
  --mint: #48D3E7;     /* turquesa: acentos sobre fondo oscuro */
  --green: #03784A;    /* verde para texto sobre blanco */
  --dark: #0C1E49;     /* noche: encabezado del administrador */

  /* Etiquetas por tipo de empresa */
  --tour-fg: #03784A;   --tour-bg: #E1F5EC;
  --hotel-fg: #9A4A00;  --hotel-bg: #FFEBD3;
  --air-fg: #0047B3;    --air-bg: #E3EDFC;

  /* Estados de turno */
  --slot-free-fg: #0058DE;
  --slot-mine-bg: #0058DE;
  --slot-taken-bg: #E4E9EE;  --slot-taken-fg: #4A6275;
  --slot-clash-bg: #FFF4D6;  --slot-clash-border: #E5AE1A;  --slot-clash-fg: #7A5300;
  --slot-closed-border: #8DA2B3;  --slot-closed-fg: #4A6275;

  /* Mensajes */
  --error-bg: #FDE8E8;  --error-fg: #A3070C;  --error-border: #F5BDBF;
  --info-bg: #E6EFFC;   --info-fg: #003B5C;   --info-border: #BCD3F5;
  --warn-bg: #FFF4D6;   --warn-fg: #7A5300;   --warn-border: #F2D58A;

  /* Forma: tarjetas de 24 px, botones en cápsula */
  --radius-card: 24px;
  --radius: 12px;
  --radius-pill: 999px;
  --shadow: 0 8px 24px rgba(0, 59, 92, .08);
  --focus: 0 0 0 3px rgba(0, 88, 222, .35);

  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --script: "Yellowtail", cursive;
  --touch: 44px;
  --gutter: 16px;
}

/* --- Base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
code { font-size: .9em; background: var(--bg); padding: 1px 5px; border-radius: 6px; }

h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
/* Titulares de marca: mayúsculas, peso 900 */
.h1 { font-size: clamp(28px, 4.4vw, 40px); font-weight: 900; text-transform: uppercase; line-height: 1; }
.h2 { font-size: 24px; font-weight: 900; text-transform: uppercase; line-height: 1.05; }
.h3 { font-size: 18px; font-weight: 800; }
p { margin: 0; }

.muted { color: var(--text-2); }
.small { font-size: 13px; }
.eyebrow {
  font-size: 12px; font-weight: 800; letter-spacing: .2em;
  text-transform: uppercase; color: var(--text-2);
}
.num, .tabular { font-variant-numeric: tabular-nums; }
.list { margin: 0; padding-left: 18px; }

.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

[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;
}

:focus-visible { outline: none; box-shadow: var(--focus); }

.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon--sm { width: 16px; height: 16px; }

/* --- Logo ---------------------------------------------------------------- */

/* Nueve puntos de color de Exploring + nombre en mayúsculas */
.logo {
  display: inline-flex; flex-direction: column; gap: 5px;
  color: var(--text); text-decoration: none; line-height: 1;
}
.logo:hover { color: var(--text); }
.logo--inverse, .logo--inverse:hover { color: #FFFFFF; }
.logo__name { font-size: 19px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.logo__name span { font-weight: 600; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; }
.dots i:nth-child(1) { background: var(--rojo); }     .dots i:nth-child(2) { background: var(--azul); }
.dots i:nth-child(3) { background: var(--naranja); }  .dots i:nth-child(4) { background: var(--amarillo); }
.dots i:nth-child(5) { background: var(--turquesa); } .dots i:nth-child(6) { background: var(--verde); }
.dots i:nth-child(7) { background: var(--lima); }     .dots i:nth-child(8) { background: var(--magenta); }
.dots i:nth-child(9) { background: var(--rosa); }
.logo--inverse .dots i:nth-child(2) { background: #3F86F0; } /* el azul se pierde sobre el náutico */
.dots--lg i { width: 12px; height: 12px; }
.script { font-family: var(--script); font-weight: 400; }

/* --- Encabezado de la app ----------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--azul-nautico); color: #FFFFFF;
}
.topbar--admin { background: var(--dark); }
.topbar--admin .nav a { padding: 0 9px; letter-spacing: .06em; }
.topbar--admin .nav a::after { left: 9px; right: 9px; }
.topbar__inner {
  max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter);
  min-height: 68px; display: flex; align-items: center; gap: 16px;
}
.topbar__event { color: rgba(255, 255, 255, .75); font-size: 14px; border-left: 1px solid rgba(255, 255, 255, .22); padding-left: 16px; }
.topbar__spacer { flex: 1; }

.nav { display: flex; gap: 2px; }
.nav a {
  position: relative; display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 12px;
  color: rgba(255, 255, 255, .8); font-size: 13px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; text-decoration: none; white-space: nowrap;
}
.nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px;
  background: var(--amarillo); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.nav a:hover { color: #FFFFFF; }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: none; }
.nav a[aria-current="page"] { color: #FFFFFF; }
.topbar :focus-visible { box-shadow: 0 0 0 3px rgba(72, 211, 231, .6); }

.user-chip { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.user-chip__name { font-weight: 700; }

.topbar .nav-toggle { display: none; }

@media (max-width: 860px) {
  .topbar__event { display: none; }
  .topbar .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; padding: 8px var(--gutter) 20px; background: inherit;
  }
  .nav a { font-size: 20px; font-weight: 900; padding: 0; }
  .nav a::after { left: 0; right: auto; width: 40px; }
  .nav.is-open { display: flex; }
  .user-chip__name { display: none; }
}

/* --- Página -------------------------------------------------------------- */

.page { max-width: 1240px; margin: 0 auto; padding: 24px var(--gutter) 64px; }
.page__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }

/* --- Tarjetas ------------------------------------------------------------ */

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 20px; box-shadow: var(--shadow);
}
.card--flat { box-shadow: none; }
.card__title { font-size: 13px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__label { font-size: 12px; color: var(--text-2); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.stat__value { font-size: 32px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat__value small { font-size: 15px; font-weight: 600; color: var(--text-2); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* --- Botones ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch); padding: 0 18px;
  border: 2px solid var(--border); border-radius: var(--radius-pill);
  background: var(--card); color: var(--text);
  font: inherit; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.btn:hover { border-color: #B5C4D0; background: #FFFFFF; color: var(--text); }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn--ghost:hover { background: var(--info-bg); border-color: transparent; color: var(--primary-hover); }
.btn--danger { color: var(--error-fg); }
.btn--danger:hover { background: var(--error-bg); border-color: var(--error-border); color: var(--error-fg); }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 12px; }
.btn--yellow { background: var(--amarillo); border-color: var(--amarillo); color: var(--azul-nautico); }
.btn--yellow:hover { background: #F2B70F; border-color: #F2B70F; color: var(--azul-nautico); }
.btn--icon { width: var(--touch); padding: 0; }
.topbar .btn--ghost { color: #FFFFFF; }
.topbar .btn--ghost:hover { background: rgba(255, 255, 255, .1); color: #FFFFFF; }

/* --- Formularios --------------------------------------------------------- */

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 4px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.hint { font-size: 13px; color: var(--text-2); }

.input {
  width: 100%; min-height: var(--touch); padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--text); font: inherit; font-size: 16px; /* 16px: iOS no hace zoom */
}
.input:hover { border-color: #C3CCD3; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
textarea.input { min-height: 96px; resize: vertical; }
select.input { appearance: none; padding-right: 36px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234F5F6B' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center / 18px; }

.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.input-icon .input { padding-left: 40px; }

.check { display: flex; align-items: flex-start; gap: 10px; min-height: var(--touch); padding: 10px 0; cursor: pointer; font-size: 14px; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); flex-shrink: 0; }

/* Selector segmentado (Soy mayorista / Soy empresa) */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 4px; background: #EEF1F4; border-radius: var(--radius-pill);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: flex; align-items: center; justify-content: center; min-height: 40px;
  border-radius: var(--radius-pill); font-weight: 800; font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-2); cursor: pointer;
}
.segmented input:checked + label { background: var(--azul-nautico); color: #FFFFFF; }
.segmented input:focus-visible + label { box-shadow: var(--focus); }

/* Interruptor (abrir/cerrar turno) */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: var(--touch); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  width: 42px; height: 24px; border-radius: var(--radius-pill); background: #B5C4D0;
  position: relative; transition: background .15s; flex-shrink: 0;
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #FFFFFF; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.switch input:checked + .switch__track { background: var(--verde); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus); }
.switch input:disabled + .switch__track { opacity: .5; }

/* --- Avisos -------------------------------------------------------------- */

.alert { padding: 12px 14px; border-radius: var(--radius); border: 1px solid; font-size: 14px; }
.alert--error { background: var(--error-bg); color: var(--error-fg); border-color: var(--error-border); }
.alert--info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-border); }
.alert--warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-border); }
.alert--ok { background: var(--tour-bg); color: var(--tour-fg); border-color: #A9DEC6; }
.alert.row { flex-wrap: nowrap; align-items: flex-start; }

/* Confirmación (barra oscura con check verde) */
.toast-region {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100;
  width: min(560px, calc(100% - 2 * var(--gutter)));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--dark); color: #FFFFFF; border-radius: var(--radius-card);
  box-shadow: 0 8px 28px rgba(12, 30, 73, .35); font-weight: 700; font-size: 15px;
  pointer-events: auto; animation: toast-in .2s ease-out;
}
.toast .icon { color: var(--verde); }
.toast--error .icon { color: #F7A8A8; }
.toast__text { flex: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* --- Píldoras y etiquetas ------------------------------------------------ */

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 800; line-height: 1.5;
  background: #EEF1F4; color: var(--text-2); white-space: nowrap;
}
.pill--primary { background: var(--primary); color: var(--on-primary); }
.pill--outline { background: transparent; border: 1px solid var(--border); }
.tag--tour { background: var(--tour-bg); color: var(--tour-fg); }
.tag--hotel { background: var(--hotel-bg); color: var(--hotel-fg); }
.tag--airline { background: var(--air-bg); color: var(--air-fg); }

.avatar {
  width: 44px; height: 44px; border-radius: var(--radius); flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: var(--info-bg); color: var(--primary); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #FFFFFF; }
.avatar.tag--tour, .avatar.tag--hotel, .avatar.tag--airline { font-size: 15px; }

/* --- Turnos -------------------------------------------------------------- */

/* Barra de 16 cuadritos del resumen */
.slotbar { display: flex; gap: 4px; flex-wrap: wrap; }
.slotbar__cell { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--primary); background: var(--card); }
.slotbar__cell.is-filled { background: var(--primary); }

/* Cuadrícula de 4×4 */
.slots { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 520px) { .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.slot {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 76px; padding: 10px 12px; border-radius: var(--radius);
  font: inherit; text-align: left; border: 2px solid transparent; width: 100%;
}
button.slot { cursor: pointer; }
.slot__time { font-weight: 900; font-size: 17px; font-variant-numeric: tabular-nums; }
.slot__label { font-size: 12.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }

.slot--free { background: var(--card); border-color: var(--slot-free-fg); color: var(--slot-free-fg); }
button.slot--free:hover { background: var(--info-bg); }
.slot--mine { background: var(--slot-mine-bg); border-color: var(--slot-mine-bg); color: #FFFFFF; }
button.slot--mine:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.slot--taken { background: var(--slot-taken-bg); color: var(--slot-taken-fg); }
.slot--clash { background: var(--slot-clash-bg); border-color: var(--slot-clash-border); color: var(--slot-clash-fg); }
.slot--closed { background: var(--card); border: 2px dashed var(--slot-closed-border); color: var(--slot-closed-fg); }
.slot[disabled] { cursor: default; }
.slot.is-busy { opacity: .6; pointer-events: none; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--text-2); }
.legend__item { display: inline-flex; align-items: center; gap: 8px; }
.legend__swatch { width: 18px; height: 18px; border-radius: 6px; border: 2px solid transparent; }
.legend__swatch.slot--free { border-color: var(--slot-free-fg); }
.legend__swatch.slot--mine { border-color: var(--slot-mine-bg); }
.legend__swatch.slot--clash { border-color: var(--slot-clash-border); }
.legend__swatch.slot--closed { border: 2px dashed var(--slot-closed-border); }

/* --- Entrada (login) ---------------------------------------------------- */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth__info {
  background: var(--azul-nautico); color: #FFFFFF; padding: 40px clamp(24px, 5vw, 64px);
  display: flex; flex-direction: column; gap: 32px; position: relative; overflow: hidden;
}
.auth__info::after {
  /* esfera turquesa de fondo, como en la portada de Exploring */
  content: ""; position: absolute; right: -140px; bottom: -160px; width: 440px; height: 440px;
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(72, 211, 231, .28), rgba(72, 211, 231, 0) 70%);
  pointer-events: none;
}
.auth__brand { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.auth__seal { width: 140px; height: auto; }
.auth__event { margin: auto 0; display: flex; flex-direction: column; gap: 20px; max-width: 540px; position: relative; z-index: 1; }
.auth__event .eyebrow { color: var(--turquesa); }
.auth__title { font-size: clamp(34px, 5vw, 58px); font-weight: 900; text-transform: uppercase; line-height: .98; }
.auth__facts { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.auth__facts li { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 700; }
.auth__facts .icon { color: var(--amarillo); }
.auth__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.auth__chips .pill { background: rgba(255, 255, 255, .12); color: #FFFFFF; font-size: 13px; padding: 6px 12px; }
.auth__foot { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth__foot .script { font-size: 34px; line-height: 1; }

.auth__form { display: flex; align-items: center; justify-content: center; padding: 40px var(--gutter); }
.auth__card { width: 100%; max-width: 440px; padding: 32px 28px; }
.auth__notice { display: flex; gap: 10px; align-items: flex-start; }
.auth__notice .icon { color: var(--primary); margin-top: 1px; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth__info { padding: 20px var(--gutter) 28px; gap: 20px; }
  .auth__info::after { display: none; }
  .auth__seal { width: 120px; }
  .auth__event { margin: 0; gap: 14px; }
  .auth__foot { display: none; }
  .auth__form { padding: 24px var(--gutter) 48px; align-items: flex-start; }
  .auth__card { padding: 24px 20px; }
}

/* --- Instalador y páginas sueltas --------------------------------------- */

.install { max-width: 620px; margin: 0 auto; padding: 32px var(--gutter) 64px; }
.install__brand { margin-bottom: 20px; }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 32px var(--gutter); }
.center-page .card { max-width: 480px; width: 100%; text-align: center; }
.center-page .logo { margin: 0 auto 20px; }

/* --- Tablas --------------------------------------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--text-2); }

/* --- Píldoras extra y chips de filtro ------------------------------------ */

.pill--muted { color: var(--slot-closed-fg); }
.pill--pending { background: var(--warn-bg); color: var(--warn-fg); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 800; color: var(--text-2); background: var(--card);
}
.chip input:checked + span { background: var(--azul-nautico); border-color: var(--azul-nautico); color: #FFFFFF; }
.chip input:focus-visible + span { box-shadow: var(--focus); }

.avatar--lg { width: 56px; height: 56px; }
.inline-ok { display: inline; vertical-align: -3px; color: var(--green); }

/* --- Diálogos ------------------------------------------------------------- */

.dialog {
  width: min(440px, calc(100% - 2 * var(--gutter))); padding: 24px;
  border: 0; border-radius: var(--radius-card);
  background: var(--card); color: var(--text); box-shadow: 0 30px 60px rgba(0, 30, 60, .3);
}
.dialog::backdrop { background: rgba(12, 30, 73, .6); }
.dialog__actions { justify-content: flex-end; }
.btn--danger-solid { background: var(--error-fg); border-color: var(--error-fg); color: #FFFFFF; }
.btn--danger-solid:hover { background: #7A1515; border-color: #7A1515; color: #FFFFFF; }

/* --- Mayorista: Reservar citas ------------------------------------------- */

.summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.summary__count { display: flex; flex-direction: column; gap: 8px; }
.summary__sync {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: var(--touch);
  border: 1.5px solid var(--border); border-radius: var(--radius-pill); background: var(--card); text-decoration: none; color: var(--text); font-size: 14px; font-weight: 600;
}
.summary__sync:hover { border-color: #B5C4D0; color: var(--text); }
.summary__sync > .icon:first-child { color: var(--primary); }
.summary__check { color: var(--green); }

#closed-banner { margin-bottom: 16px; }

.book { display: grid; gap: 16px; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); align-items: start; }
.book__list { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 80px; max-height: calc(100vh - 100px); }
.company-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; margin: 0 -8px; padding: 2px 8px; }
.company-list .empty { padding: 12px 4px; }

.company-card {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; min-height: 64px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.company-card:hover { border-color: #B5C4D0; }
.company-card[aria-pressed="true"] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--info-bg); }
.company-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.company-card__name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.book__detail { display: flex; flex-direction: column; gap: 16px; min-height: 300px; }
.detail__back { display: none; }
.detail__head { display: flex; align-items: center; gap: 14px; }
.detail__head .avatar { width: 56px; height: 56px; font-size: 18px; }
.detail__desc { color: var(--text-2); max-width: 65ch; }
.detail__facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.detail__facts dt { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--text-2); }
.detail__facts dd { margin: 2px 0 0; font-weight: 700; }

/* Los hijos de una grilla no deben ensancharla con textos largos (nombres sin cortes) */
.book > *, .agenda > *, .table-layout > * { min-width: 0; }

@media (max-width: 900px) {
  .book { grid-template-columns: 1fr; }
  .book__list { position: static; max-height: none; }
  .company-list { max-height: 50vh; }
  .detail__back { display: block; margin: -8px 0 -4px; }
  .book__detail { scroll-margin-top: 76px; }
}

/* --- Mayorista: Mi agenda ------------------------------------------------- */

.agenda { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 900px) { .agenda { grid-template-columns: 1fr; } }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tl {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border);
}
.tl--meeting { border-left: 4px solid var(--primary); background: #FFFFFF; }
.tl--free { border-style: dashed; }
.tl__time { font-weight: 700; color: var(--text-2); font-size: 14px; }
.tl__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tl__company { font-size: 15px; }
@media (max-width: 520px) {
  .tl { grid-template-columns: 1fr auto; }
  .tl__time { grid-column: 1 / -1; }
}

.cal-email .input, .cal-url .input { flex: 1; min-width: 0; }
.cal-email, .cal-url { flex-wrap: nowrap; }
details summary { cursor: pointer; font-weight: 600; min-height: var(--touch); display: flex; align-items: center; }

/* --- Empresa: Mi mesa ------------------------------------------------------ */

.welcome { margin-bottom: 16px; border-left: 6px solid var(--verde); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
#stats { margin-bottom: 16px; }
.publish-banner { margin-bottom: 16px; align-items: center !important; flex-wrap: wrap !important; }
.publish-banner span { flex: 1; min-width: 200px; font-weight: 600; }
#locked-banner { margin-bottom: 16px; }

.table-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
@media (max-width: 960px) { .table-layout { grid-template-columns: 1fr; } }

.mslots { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 520px) { .mslots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mslot {
  display: flex; flex-direction: column; gap: 4px; min-height: 84px; padding: 10px 12px;
  border-radius: var(--radius); border: 2px solid transparent; font: inherit; text-align: left;
}
.mslot--open { background: var(--card); border-color: var(--slot-free-fg); color: var(--slot-free-fg); }
.mslot--closed { background: var(--card); border: 2px dashed var(--slot-closed-border); color: var(--slot-closed-fg); }
.mslot--booked { background: var(--slot-mine-bg); border-color: var(--slot-mine-bg); color: #FFFFFF; cursor: pointer; }
.mslot__head { display: flex; align-items: center; justify-content: space-between; }
.mslot .switch { min-height: 36px; }
.mslot .switch span.small { font-weight: 600; }

.visits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.visit { display: grid; grid-template-columns: 104px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.visit:last-child { border-bottom: 0; }
.visit__time { font-weight: 700; color: var(--text-2); }

/* --- Administrador ------------------------------------------------------------ */

.heat-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 16px; }
.heat { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
.heat th, .heat td { padding: 4px; text-align: center; border-bottom: 1px solid var(--border); background: var(--card); }
.heat thead th { position: sticky; top: 0; font-weight: 700; color: var(--text-2); white-space: nowrap; z-index: 1; }
.heat .heat__company {
  position: sticky; left: 0; z-index: 2; text-align: left; min-width: 200px; max-width: 240px;
  padding: 8px 12px; border-right: 1px solid var(--border);
}
.heat__name { display: block; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heat__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.heat__publish { border: 0; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; }
.heat__cell {
  display: block; width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; padding: 0; background: none;
}
.heat__cell.is-booked { background: var(--slot-mine-bg); }
.heat__cell.is-open { background: var(--card); border-color: var(--slot-free-fg); }
.heat__cell.is-closed { background: var(--card); border: 2px dashed var(--slot-closed-border); opacity: .6; }
.heat__cell:hover { box-shadow: 0 0 0 3px rgba(0, 88, 222, .25); }
.heat__pct { font-weight: 800; font-size: 13px; padding: 0 12px !important; }
.dialog--wide { width: min(560px, calc(100% - 2 * var(--gutter))); }

.form-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.form-layout > *, .admin-users > * { min-width: 0; }
@media (max-width: 960px) { .form-layout { grid-template-columns: 1fr; } }
.admin-users { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.admin-users > form { max-width: 640px; }
.row--end { justify-content: flex-end; }
.table tr.is-disabled td { opacity: .55; }
.table td { vertical-align: top; }

.action { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.action:last-of-type { border-bottom: 0; }
.action__title { font-weight: 700; }
@media (max-width: 520px) { .action { flex-direction: column; align-items: stretch; } }

/* Encabezado del administrador: más opciones, se pliega antes */
.logo { white-space: nowrap; }
.topbar__event { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1320px) {
  .topbar--admin .topbar__event { max-width: 180px; }
  .topbar--admin .nav-toggle { display: inline-flex; }
  .topbar--admin .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; padding: 8px var(--gutter) 20px; background: var(--dark);
  }
  .topbar--admin .nav a { font-size: 20px; font-weight: 900; padding: 0; }
  .topbar--admin .nav a::after { left: 0; right: auto; width: 40px; }
  .topbar--admin .nav.is-open { display: flex; }
  .topbar--admin .user-chip__name { display: none; }
}

/* --- Eventos ---------------------------------------------------------------- */

.events-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.events-grid > * { min-width: 0; }
.event-card.is-current { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary), var(--shadow); }
.form-narrow { max-width: 640px; }
.auth__lead { font-size: 17px; line-height: 1.5; color: rgba(255, 255, 255, .9); max-width: 46ch; }
.topbar__event--link { color: rgba(255, 255, 255, .8); text-decoration: none; }
.auth__lead.small { font-size: 15px; color: rgba(255, 255, 255, .75); }
.topbar__event--link:hover { color: #FFFFFF; text-decoration: underline; }

/* --- Impresión (Descargar PDF) ------------------------------------------- */

@media print {
  body { background: #FFFFFF; font-size: 12px; }
  .topbar, .toast-region, .no-print, .legend, #publish-banner, #locked-banner, .welcome { display: none !important; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #C3CCD3; break-inside: avoid; }
  .agenda, .table-layout { grid-template-columns: 1fr; }
  .tl { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* --- Guía de estilos (solo APP_DEBUG) ------------------------------------ */

.swatches { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.swatch { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; font-size: 12px; }
.swatch__color { height: 48px; }
.swatch__name { padding: 6px 8px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
