/* ==========================================================================
   Cluster Events — sistema de diseño
   Colores y formas del diseño aprobado. Usar siempre las variables de :root.
   ========================================================================== */

:root {
  /* Superficies */
  --bg: #F4F6F8;
  --card: #FFFFFF;
  --border: #DCE2E7;

  /* Texto */
  --text: #142430;
  --text-2: #4F5F6B;

  /* Principal (azul océano) */
  --primary: #0B5C7A;
  --primary-hover: #08445B;
  --on-primary: #FFFFFF;

  /* Acentos */
  --mint: #7FD8BE;
  --green: #1F9E85;
  --dark: #142430;

  /* Etiquetas por tipo de empresa */
  --tour-fg: #0E6B57;   --tour-bg: #E3F4EE;
  --hotel-fg: #8A4B08;  --hotel-bg: #FBEBD6;
  --air-fg: #3A3F9E;    --air-bg: #E7E8FA;

  /* Estados de turno */
  --slot-free-fg: #0B5C7A;
  --slot-mine-bg: #0B5C7A;
  --slot-taken-bg: #DDE3E8;  --slot-taken-fg: #47545E;
  --slot-clash-bg: #FDF0E6;  --slot-clash-border: #E8B48F;  --slot-clash-fg: #8A3F0E;
  --slot-closed-border: #8C99A3;  --slot-closed-fg: #56636D;

  /* Mensajes */
  --error-bg: #FDECEC;  --error-fg: #9B1C1C;  --error-border: #F3C2C2;
  --info-bg: #E8F3F7;   --info-fg: #0B4A62;   --info-border: #BBDCE8;
  --warn-bg: #FDF0E6;   --warn-fg: #8A3F0E;   --warn-border: #E8B48F;

  /* Forma */
  --radius-card: 14px;
  --radius: 10px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(20, 36, 48, .06), 0 4px 16px rgba(20, 36, 48, .05);
  --focus: 0 0 0 3px rgba(11, 92, 122, .35);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --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: 15px;
  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; letter-spacing: -.01em; }
.h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; }
.h2 { font-size: 22px; font-weight: 800; }
.h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }

.muted { color: var(--text-2); }
.small { font-size: 13px; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  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 ---------------------------------------------------------------- */

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-size: 19px; letter-spacing: -.01em;
}
.logo:hover { color: var(--text); }
.logo__icon { width: 34px; height: 34px; }
.logo__name { font-weight: 800; }
.logo__name span { font-weight: 500; }
.logo--inverse, .logo--inverse:hover { color: #FFFFFF; }

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

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--card); border-bottom: 1px solid var(--border);
}
.topbar--admin { background: var(--dark); border-bottom-color: var(--dark); color: #FFFFFF; }
.topbar__inner {
  max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter);
  min-height: 64px; display: flex; align-items: center; gap: 16px;
}
.topbar__event { color: var(--text-2); font-size: 13px; border-left: 1px solid var(--border); padding-left: 16px; }
.topbar--admin .topbar__event { color: rgba(255, 255, 255, .7); border-left-color: rgba(255, 255, 255, .2); }
.topbar__spacer { flex: 1; }

.nav { display: flex; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 14px;
  border-radius: var(--radius); color: var(--text-2); font-weight: 600; text-decoration: none;
}
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a[aria-current="page"] { background: var(--info-bg); color: var(--primary); }
.topbar--admin .nav a { color: rgba(255, 255, 255, .75); }
.topbar--admin .nav a:hover { background: rgba(255, 255, 255, .08); color: #FFFFFF; }
.topbar--admin .nav a[aria-current="page"] { background: rgba(255, 255, 255, .14); color: #FFFFFF; }

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

.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) 16px;
    background: inherit; border-bottom: 1px solid var(--border);
  }
  .topbar--admin .nav { background: var(--dark); }
  .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: 15px; font-weight: 700; margin-bottom: 12px; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.stat__value { font-size: 28px; font-weight: 800; 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: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--text);
  font: inherit; font-weight: 700; font-size: 14px; text-decoration: none;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: #C3CCD3; background: #FAFBFC; color: var(--text); }
.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 12px; font-size: 13px; }
.btn--icon { width: var(--touch); padding: 0; }
.topbar--admin .btn--ghost { color: #FFFFFF; }
.topbar--admin .btn--ghost:hover { background: rgba(255, 255, 255, .1); }

/* --- 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: 14px; font-weight: 600; }
.hint { font-size: 13px; color: var(--text-2); }

.input {
  width: 100%; min-height: var(--touch); padding: 10px 12px;
  border: 1px 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: var(--bg); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
}
.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); font-weight: 700; font-size: 14px; color: var(--text-2); cursor: pointer;
}
.segmented input:checked + label { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }
.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: #C3CCD3;
  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(--primary); }
.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: #BFE3D6; }
.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(20, 36, 48, .3); font-weight: 600; font-size: 14px;
  pointer-events: auto; animation: toast-in .2s ease-out;
}
.toast .icon { color: var(--mint); }
.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: 700; line-height: 1.5;
  background: var(--bg); 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: 5px; 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: 800; font-size: 15px; 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: 5px; 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(--primary); color: #FFFFFF; padding: 40px clamp(24px, 5vw, 64px);
  display: flex; flex-direction: column; gap: 32px; position: relative; overflow: hidden;
}
.auth__info::after {
  /* textura sutil de nodos conectados */
  content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px;
  border-radius: 50%; border: 60px solid rgba(255, 255, 255, .05); pointer-events: none;
}
.auth__event { margin: auto 0; display: flex; flex-direction: column; gap: 20px; max-width: 520px; }
.auth__event .eyebrow { color: var(--mint); }
.auth__title { font-size: clamp(28px, 4.2vw, 44px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.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: 16px; font-weight: 600; }
.auth__facts .icon { color: var(--mint); }
.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 { font-size: 13px; color: rgba(255, 255, 255, .7); }

.auth__form { display: flex; align-items: center; justify-content: center; padding: 40px var(--gutter); }
.auth__card { width: 100%; max-width: 420px; }
.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: 24px var(--gutter) 28px; gap: 20px; }
  .auth__info::after { display: none; }
  .auth__event { margin: 0; gap: 14px; }
  .auth__foot { display: none; }
  .auth__form { padding: 24px var(--gutter) 48px; align-items: flex-start; }
}

/* --- 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: 700; text-transform: uppercase; letter-spacing: .05em; 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: 700; color: var(--text-2); background: var(--card);
}
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.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: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--card); color: var(--text); box-shadow: 0 16px 48px rgba(20, 36, 48, .25);
}
.dialog::backdrop { background: rgba(20, 36, 48, .45); }
.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: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); font-size: 14px;
}
.summary__sync:hover { border-color: #C3CCD3; 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: #C3CCD3; background: #FAFBFC; }
.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: 700; text-transform: uppercase; letter-spacing: .05em; 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: #FAFCFD; }
.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: 4px solid var(--green); }
.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); }

/* --- 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; }
}
