@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-stretch: 62% 125%; font-display: swap; src: url(/fonts/archivo-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-stretch: 62% 125%; font-display: swap; src: url(/fonts/archivo-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --ink: #17191e;
  --ink-2: #2b2f37;
  --muted: #5d636e;
  --faint: #8a909a;
  --line: #e2e4e8;
  --line-2: #eef0f2;
  --canvas: #f3f4f6;
  --paper: #ffffff;
  --hover: #eceef1;
  --turno: #d92d20;
  --turno-dark: #b42318;
  --turno-soft: #fdecea;
  --ok: #25784a;
  --ok-soft: #e6f3ea;
  --warn: #9a5b06;
  --warn-soft: #fbf0dc;
  --error: #b42318;
  --radius: 10px;
  --radius-s: 7px;
  --sidebar: 232px;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  font-stretch: 100%;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea, label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 18px; line-height: 1.25; font-weight: 650; text-wrap: balance; }
h3 { font-size: 15px; line-height: 1.3; font-weight: 650; }
p { line-height: 1.55; }
small, .muted { color: var(--muted); }
strong { font-weight: 650; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:where(.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; }

/* Foco: nada al hacer clic; con teclado, cambio de fondo y borde integrado. */
:focus { outline: none; }
:focus-visible { outline: none; }
button:focus-visible, .button:focus-visible, a:focus-visible { background-color: var(--hover); box-shadow: inset 0 0 0 1.5px var(--ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.skip { position: fixed; top: -100px; left: 12px; background: var(--paper); padding: 12px 16px; z-index: 100; border-radius: var(--radius-s); }
.skip:focus-visible { top: 12px; }

/* Botones */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--paper); color: var(--ink);
  font-weight: 600; font-size: 14px; line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
button:hover, .button:hover { background: var(--hover); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:disabled:hover { background: var(--paper); }
button.primary, .button.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
button.primary:disabled:hover { background: var(--ink); }
button.accent, .button.accent { background: var(--turno); border-color: var(--turno); color: #fff; }
button.accent:hover, .button.accent:hover { background: var(--turno-dark); border-color: var(--turno-dark); }
button.primary:focus-visible, .button.primary:focus-visible, button.accent:focus-visible, .button.accent:focus-visible { box-shadow: inset 0 0 0 2px #fff, 0 0 0 1.5px var(--ink); }
button.ghost, .button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover, .button.ghost:hover { background: var(--hover); }
button.danger, .button.danger { color: var(--error); }
button.danger:hover { background: var(--turno-soft); border-color: #f5c7c2; }
button.small, .button.small, .compact { min-height: 32px; padding: 0 11px; font-size: 13px; }
.icon-button { width: 40px; padding: 0; }
.icon-button.small { width: 32px; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.small .icon, .compact .icon { width: 16px; height: 16px; }
.link-button { border: 0; background: none; min-height: 0; padding: 0; color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.link-button:hover { background: none; color: var(--ink); text-decoration-color: currentColor; }

/* Formularios */
form { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 42px;
  border: 1px solid #d3d6dc; border-radius: var(--radius-s);
  padding: 9px 12px; background: var(--paper); color: var(--ink);
  font-size: 15px; font-weight: 400;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #b9bdc5; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235d636e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--ink); flex: none; }
input[type=file] { padding: 8px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; line-height: 1.45; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full, .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.form-actions .spacer { margin-right: auto; }
.checkline { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 14px; line-height: 1.45; color: var(--ink); cursor: pointer; }
.checkline input { margin-top: 1px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 12px; }
legend { font-size: 14px; font-weight: 650; padding: 0; margin-bottom: 4px; }
.error { background: var(--turno-soft); border: 1px solid #f5c7c2; padding: 11px 13px; color: var(--error); border-radius: var(--radius-s); font-size: 14px; line-height: 1.45; }
.notice { background: var(--canvas); border-radius: var(--radius-s); padding: 14px 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Días como pastillas */
.day-checks { display: flex; gap: 6px; flex-wrap: wrap; }
.day-checks label { position: relative; display: block; cursor: pointer; }
.day-checks input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.day-checks span { display: grid; place-items: center; min-width: 50px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 14px; font-weight: 600; color: var(--muted); background: var(--paper); transition: background-color .15s, color .15s, border-color .15s; }
.day-checks label:hover span { background: var(--hover); }
.day-checks input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.day-checks input:focus-visible + span { box-shadow: inset 0 0 0 2px #fff, 0 0 0 1.5px var(--ink); }

/* Interruptor */
.switch { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; font-weight: 400; font-size: 14px; color: var(--ink); cursor: pointer; }
.switch > span { display: grid; gap: 3px; }
.switch > span strong { font-weight: 600; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 99px; background: #cfd3d9; position: relative; cursor: pointer; transition: background-color .15s; flex: none; border: 0; padding: 0; min-height: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(23,25,30,.25); transition: transform .18s; }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--ink); }

/* Control segmentado */
.segmented { display: inline-flex; padding: 3px; background: var(--hover); border-radius: 9px; gap: 2px; }
.segmented button { border: 0; background: transparent; min-height: 32px; padding: 0 13px; font-size: 13px; color: var(--muted); border-radius: 7px; }
.segmented button:hover { background: rgba(255,255,255,.6); color: var(--ink); }
.segmented button.active, .segmented button[aria-pressed=true] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(23,25,30,.08), 0 0 0 1px rgba(23,25,30,.04); }

/* Marca */
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; font-weight: 800; font-size: 22px; font-stretch: 75%; letter-spacing: -0.01em; line-height: 1; }
.brand-mark { width: 26px; height: 20px; flex: none; }

/* Estructura de la aplicación */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px 18px; background: var(--paper); border-right: 1px solid var(--line); }
.sidebar .brand { padding: 0 8px; }
.business-switch { position: relative; }
.business-switch select { font-weight: 650; font-size: 14px; min-height: 40px; background-color: var(--canvas); border-color: transparent; }
.business-switch select:hover { background-color: var(--hover); }
.business-name { padding: 0 10px; font-weight: 650; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.nav { display: grid; gap: 2px; }
.nav button { justify-content: flex-start; gap: 11px; width: 100%; border: 0; background: transparent; min-height: 40px; padding: 0 10px; font-size: 14px; font-weight: 550; color: var(--ink-2); }
.nav button .icon { color: var(--faint); }
.nav button:hover { background: var(--canvas); }
.nav button[aria-current=page] { background: var(--canvas); color: var(--ink); font-weight: 650; }
.nav button[aria-current=page] .icon { color: var(--turno); }
.sidebar-foot { margin-top: auto; display: grid; gap: 2px; }
.sidebar-foot a, .sidebar-foot button { justify-content: flex-start; gap: 11px; width: 100%; border: 0; background: transparent; min-height: 38px; padding: 0 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.sidebar-foot a:hover, .sidebar-foot button:hover { background: var(--canvas); color: var(--ink); }
.sidebar-foot .icon { width: 17px; height: 17px; }
.feedback-form { display: grid; gap: 18px; }
.feedback-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.feedback-form legend { font-weight: 600; margin-bottom: 10px; }
.feedback-types { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-types label { position: relative; cursor: pointer; }
.feedback-types input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.feedback-types span { display: flex; align-items: center; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; }
.feedback-types input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.feedback-types input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.feedback-contact { display: flex; align-items: start; gap: 10px; overflow-wrap: anywhere; }
.feedback-contact input { width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--ink); }
.main { min-width: 0; padding: 30px 40px 56px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px 0 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; border-radius: 0; background: transparent; min-height: 42px; padding: 0 12px; font-size: 14px; font-weight: 550; color: var(--muted); box-shadow: inset 0 -2px 0 transparent; }
.tabs button:hover { background: transparent; color: var(--ink); }
.tabs button[aria-current=page] { color: var(--ink); font-weight: 650; box-shadow: inset 0 -2px 0 var(--ink); }
.tabs button:focus-visible { background: var(--hover); box-shadow: inset 0 -2px 0 var(--ink); }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel + .panel { margin-top: 16px; }
.panel > h2:first-child, .panel > header h2 { margin-bottom: 4px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.panel-head h2 { margin: 0 0 4px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 14px; }
.loading { padding: 80px 20px; text-align: center; color: var(--muted); }
.empty-state { padding: 44px 20px; text-align: center; max-width: 440px; margin: 0 auto; }
.empty-state h2 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); margin-bottom: 18px; }

/* Hoy */
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.today-main { display: grid; gap: 18px; min-width: 0; }
.today-side { display: grid; gap: 16px; }
.day-summary { display: flex; gap: 22px; flex-wrap: wrap; margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.day-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* El tique */
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--staff, var(--faint)); }

/* Lista del día */
.day-list { list-style: none; margin: 0; padding: 0; }
.day-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 6px; border-top: 1px solid var(--line-2); }
.day-list li:first-child { border-top: 0; }
.day-list .t { font-weight: 750; font-stretch: 75%; font-size: 17px; font-variant-numeric: tabular-nums; }
.day-list .who { min-width: 0; }
.day-list .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-list .who span { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 13px; margin-top: 2px; }
.day-list li.past { color: var(--faint); }
.day-list li.past .t, .day-list li.past strong { color: var(--faint); }
.day-list li.is-now { background: var(--turno-soft); border-radius: var(--radius-s); border-top-color: transparent; }
.day-list li.is-now + li { border-top-color: transparent; }
.day-list button.row-open { display: block; width: 100%; min-width: 0; border: 0; background: transparent; padding: 0; min-height: 0; text-align: left; font-weight: inherit; white-space: normal; }
.day-list button.row-open:hover { background: transparent; }
.day-list button.row-open:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--canvas); color: var(--muted); white-space: nowrap; }
.status-pill.completed { background: var(--ok-soft); color: var(--ok); }
.status-pill.no_show { background: var(--warn-soft); color: var(--warn); }
.status-pill.cancelled { background: var(--canvas); color: var(--faint); text-decoration: line-through; }
.status-pill.now { background: var(--turno); color: #fff; }
.status-pill.confirmed { background: var(--canvas); color: var(--ink); }
.activity-panel .day-list li { grid-template-columns: 92px minmax(0, 1fr); align-items: start; }
.activity-panel .status-pill { justify-self: start; }
.activity-panel .row-open { padding: 3px 0; line-height: 1.5; }
.activity-panel summary { cursor: pointer; padding: 12px 6px 0; color: var(--muted); }
.activity-panel .panel-head { flex-wrap: wrap; gap: 12px; }
.activity-panel { margin-bottom: 18px; }
.service-staff-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.service-staff-row .checkline { min-width: 0; margin: 0; }
.staff-minutes { display: flex; align-items: center; gap: 6px; flex: none; font-weight: 400; }
.staff-minutes input { width: 76px; min-width: 0; }
.staff-minutes span { color: var(--muted); font-size: 13px; }
.staff-services-readonly { margin: 0; font-size: 14px; line-height: 1.5; }
.wait-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.public-waitlist { margin-top: 16px; }
.public-waitlist .block { margin-top: 18px; }

/* Tarjetas laterales */
.side-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; }
.side-card h2 { font-size: 15px; margin: 0; display: flex; align-items: center; gap: 9px; }
.side-card p { margin: 0; font-size: 14px; color: var(--muted); }
.side-card .buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.link-box { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; min-height: 42px; background: var(--canvas); border-radius: var(--radius-s); font-size: 14px; font-variant-numeric: tabular-nums; }
.link-box span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.link-box button { min-height: 32px; }
.state-line { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.state-line .led { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.state-line.on .led { background: var(--ok); }
.state-line.warn .led { background: var(--warn); }
.gcal { width: 18px; height: 18px; flex: none; }

/* Preparación */
.setup { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.setup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.setup-head h2 { margin: 0; }
.setup-progress { display: flex; gap: 4px; }
.setup-progress i { width: 26px; height: 5px; border-radius: 3px; background: var(--line); }
.setup-progress i.done { background: var(--ink); }
.setup ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.setup li { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 13px; display: grid; gap: 8px; align-content: space-between; }
.setup li.done { background: var(--canvas); border-color: transparent; }
.setup li strong { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.setup li strong .icon { width: 16px; height: 16px; color: var(--ok); }
.setup li span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.setup li button { justify-self: start; }
.setup-foot { display: flex; justify-content: flex-end; margin-top: 14px; }

/* Agenda */
.agenda-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.agenda-bar .group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.date-title { font-size: 20px; font-weight: 700; margin: 0 6px; text-transform: none; }
.date-pick { position: relative; }
.date-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; padding: 0; border: 0; }
.date-pick input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.staff-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.staff-chips button { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 99px; gap: 7px; color: var(--ink-2); }
.staff-chips button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.staff-chips button[aria-pressed=true] .dot { box-shadow: 0 0 0 2px #fff; }
.agenda { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; position: relative; }
.agenda-grid { display: grid; min-width: 560px; }
.agenda-head { position: sticky; top: 0; z-index: 3; background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px 10px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 650; }
.agenda-head.today-col { color: var(--turno); }
.agenda-head small { font-weight: 500; }
.time-col { position: relative; }
.time-label { position: absolute; right: 10px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; transform: translateY(-50%); }
.agenda-col { position: relative; border-left: 1px solid var(--line); }
.agenda-col .hour-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line-2); }
.agenda-col .half-line { position: absolute; left: 0; right: 0; border-top: 1px dashed #f1f2f4; }
.now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--turno); z-index: 2; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--turno); }
.booking {
  position: absolute; left: 4px; right: 4px; z-index: 1;
  display: block; min-height: 0; padding: 4px 8px; text-align: left; overflow: hidden;
  border: 0; border-left: 3px solid var(--staff, var(--ink)); border-radius: 6px;
  background: color-mix(in srgb, var(--staff, var(--ink)) 11%, white);
  color: var(--ink); font-size: 12px; font-weight: 400; line-height: 1.25; white-space: normal;
}
.booking:hover { background: color-mix(in srgb, var(--staff, var(--ink)) 18%, white); }
.booking strong { display: block; font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking span { display: block; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking.short { display: flex; align-items: center; gap: 6px; padding-top: 0; padding-bottom: 0; }
.booking.short strong { font-size: 12px; }
.booking.short span { display: none; }
.booking.completed { background: var(--ok-soft); border-left-color: var(--ok); }
.booking.no_show { background: var(--warn-soft); border-left-color: var(--warn); }
.booking.cancelled { background: repeating-linear-gradient(135deg, #f6f7f8 0 6px, #eff0f2 6px 12px); border-left-color: #c8ccd2; color: var(--faint); }
.booking.cancelled strong { text-decoration: line-through; }
.booking:focus-visible { box-shadow: inset 0 0 0 1.5px var(--ink); }
.agenda-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Tablas y listas */
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; max-width: 340px; }
.search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-box input { padding-left: 38px; }
.count { font-size: 13px; color: var(--muted); }
.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); background: var(--paper); }
td, th { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfb; }
td small { display: block; margin-top: 3px; font-size: 13px; }
td.actions, th.actions { text-align: right; white-space: nowrap; }
td.actions button + button { margin-left: 6px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap tbody tr { content-visibility: auto; contain-intrinsic-size: auto 58px; }
.muted-tag { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--canvas); padding: 3px 8px; border-radius: 99px; }

/* Ajustes */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: 24px; display: grid; gap: 2px; }
.settings-nav button { justify-content: flex-start; border: 0; background: transparent; min-height: 38px; padding: 0 12px; font-size: 14px; font-weight: 550; color: var(--muted); }
.settings-nav button:hover { background: var(--hover); color: var(--ink); }
.settings-nav button[aria-current=page] { background: var(--paper); color: var(--ink); font-weight: 650; box-shadow: 0 0 0 1px var(--line); }
.settings-body { display: grid; gap: 16px; min-width: 0; max-width: 760px; }
.settings-body .panel h2 { margin-bottom: 4px; }
.settings-body .panel > p.lead { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.section-gap { height: 4px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* Calendarios */
.cal-provider { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.cal-provider:first-of-type { border-top: 0; }
.cal-provider .who { display: flex; align-items: center; gap: 12px; }
.cal-provider .who p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.cal-connection { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px; display: grid; gap: 10px; margin-top: 10px; }
.cal-connection h3 { margin: 0; }
.cal-connection p { margin: 0; font-size: 14px; color: var(--muted); }
.cal-connection .form-actions { justify-content: flex-start; flex-wrap: wrap; }

/* Diálogos */
dialog { width: min(560px, calc(100% - 24px)); max-height: min(88vh, 900px); padding: 0; border: 0; border-radius: 14px; color: var(--ink); background: var(--paper); box-shadow: 0 24px 64px rgba(23,25,30,.22), 0 0 0 1px rgba(23,25,30,.06); overscroll-behavior: contain; }
dialog[open] { animation: dialog-in .16s ease-out; }
dialog::backdrop { background: rgba(23,25,30,.42); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
#modal-content { padding: 22px 24px 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-head h2 { flex: 1; }
.modal-head .modal-back { width: auto; padding: 0 4px; gap: 4px; }
.modal-head button { width: 36px; min-height: 36px; padding: 0; border: 0; color: var(--muted); }
.summary { background: var(--canvas); padding: 14px 16px; border-radius: var(--radius-s); font-size: 14px; display: grid; gap: 3px; }
.summary p { margin: 0; }
.summary strong { font-size: 15px; }
.booking-detail-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.booking-detail-head .big-time { font-size: 40px; line-height: 1; font-weight: 800; font-stretch: 62%; font-variant-numeric: tabular-nums; }
.booking-detail-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.quick-status { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-status button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.contact-lines { display: grid; gap: 6px; font-size: 14px; }
.contact-lines a { text-decoration: none; color: var(--ink); }
.contact-lines a:hover { text-decoration: underline; text-underline-offset: 3px; }
.more-sheet { display: grid; gap: 4px; }
.more-sheet button, .more-sheet a { justify-content: flex-start; gap: 12px; border: 0; min-height: 48px; font-size: 15px; font-weight: 550; }

#toast { position: fixed; inset: auto auto 22px 50%; margin: 0; border: 0; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 9px; padding: 12px 18px; z-index: 200; display: none; width: max-content; max-width: calc(100% - 32px); font-size: 14px; box-shadow: 0 10px 30px rgba(23,25,30,.25); }

/* Barra inferior móvil */
.tabbar { display: none; }

/* Acceso */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-form { display: grid; place-items: center; padding: 40px 28px; background: var(--paper); }
.auth-form > div { width: 100%; max-width: 380px; }
.auth-form .brand { margin-bottom: 44px; }
.auth-form h1 { margin-bottom: 6px; }
.auth-form .lead { color: var(--muted); margin-bottom: 22px; }
.auth-form form { margin-top: 18px; }
.auth-form .segmented { width: 100%; }
.auth-form .segmented button { flex: 1; }
.auth-form .stack { display: grid; gap: 10px; margin-top: 14px; }
.auth-form .stack .button, .auth-form .stack button { width: 100%; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 18px 0 4px; }
.or::before, .or::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.auth-legal { margin-top: 28px; font-size: 13px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }
.auth-legal a { color: var(--muted); }
#auth-feedback, #verification-feedback { font-size: 14px; color: var(--muted); margin-top: 12px; }
.auth-story { background: var(--canvas); display: grid; place-items: center; padding: 40px; border-left: 1px solid var(--line); }
.auth-story-inner { width: 100%; max-width: 440px; display: grid; gap: 28px; }
.auth-story h2 { font-size: 30px; line-height: 1.12; font-weight: 750; letter-spacing: -0.015em; margin: 0; }
.auth-story ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--ink-2); font-size: 15px; }
.auth-story li { display: flex; gap: 10px; align-items: flex-start; }
.auth-story li .icon { color: var(--turno); margin-top: 1px; }
.made-by { font-size: 13px; color: var(--muted); }
.made-by a { color: var(--ink-2); }

/* Página pública de reservas */
.public { max-width: 1040px; margin: 0 auto; padding: 32px 24px 40px; }
.public-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 48px; align-items: start; }
.business-profile { position: sticky; top: 32px; }
.business-profile .initial { width: 56px; height: 56px; border-radius: 14px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 26px; font-stretch: 75%; margin-bottom: 20px; }
.business-profile h1 { font-size: 34px; line-height: 1.05; margin-bottom: 12px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.business-profile p { color: var(--muted); font-size: 15px; }
.business-facts { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; font-size: 14px; }
.business-facts li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.business-facts .icon { color: var(--faint); margin-top: 1px; }
.business-facts a { text-decoration: none; }
.business-facts a:hover { text-decoration: underline; text-underline-offset: 3px; }
.booking-flow { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 26px; min-width: 0; }
.flow-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; min-height: 32px; }
.steps { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.steps i { width: 22px; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--ink); }
.flow-back { border: 0; background: transparent; min-height: 32px; padding: 0 8px 0 4px; color: var(--muted); font-weight: 550; gap: 4px; }
.flow-back:hover { color: var(--ink); }
.booking-flow h2 { font-size: 22px; margin-bottom: 4px; }
.booking-flow .lead { color: var(--muted); margin-bottom: 18px; font-size: 14px; }
.service-list { display: grid; gap: 8px; }
.service-option { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; min-height: 64px; padding: 12px 16px; text-align: left; white-space: normal; font-weight: 400; border-radius: var(--radius-s); }
.service-option strong { display: block; font-size: 15px; }
.service-option small { display: block; margin-top: 3px; font-size: 13px; }
.service-option .price { font-weight: 650; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pick-label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 18px 0 8px; }
.date-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.date-strip button { flex: none; width: 58px; min-height: 66px; padding: 0; flex-direction: column; gap: 3px; scroll-snap-align: start; }
.date-strip button small { font-size: 12px; font-weight: 500; color: var(--muted); }
.date-strip button b { font-size: 20px; font-weight: 750; font-stretch: 75%; font-variant-numeric: tabular-nums; }
.date-strip button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.date-strip button[aria-pressed=true] small { color: rgba(255,255,255,.75); }
.date-strip button:disabled { opacity: .35; }
.date-more { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.date-more input { width: auto; min-height: 34px; padding: 4px 10px; font-size: 13px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slots button { min-height: 44px; padding: 0; font-variant-numeric: tabular-nums; font-size: 15px; }
.slots button.selected { background: var(--ink); color: #fff; border-color: var(--ink); }
.flow-foot { display: flex; justify-content: flex-end; margin-top: 22px; }
.flow-foot button { min-width: 160px; min-height: 46px; }
.fine-print { font-size: 12px; color: var(--muted); line-height: 1.5; }
.fine-print a { color: var(--muted); }
.manage { display: flex; gap: 8px; flex-wrap: wrap; }
.public-footer { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.public-footer a { color: var(--muted); }
.public-footer .brand { font-size: 16px; color: var(--ink-2); }
.public-footer .brand-mark { width: 20px; height: 15px; }
.public-footer nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* Operaciones integradas (ausencias, accesos, datos) */
.ops #panel { display: grid; gap: 18px; }
.ops .section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.ops .section-head h2 { margin-bottom: 4px; }
.ops .section-head p { margin: 0; color: var(--muted); font-size: 14px; max-width: 60ch; }
.ops h3 { margin: 10px 0 6px; }
.ops p { font-size: 14px; color: var(--ink-2); }
.ops .stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0; }
.ops .stat { background: var(--canvas); border-radius: var(--radius-s); padding: 12px 14px; display: grid; gap: 4px; min-width: 180px; }
.ops .stat span { font-size: 13px; color: var(--muted); }
.ops .stat strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.ops .stat small { font-size: 12px; }
.ops .downloads { display: flex; gap: 8px; flex-wrap: wrap; }
.ops .downloads a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 14px; font-weight: 600; text-decoration: none; background: var(--paper); }
.ops .downloads a:hover { background: var(--hover); }
.ops .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
.ops .note { font-size: 13px; color: var(--muted); }
.ops .empty { padding: 26px 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--paper); }
.ops .empty h3 { margin: 0 0 4px; }
.ops .empty p { margin: 0; color: var(--muted); }
.ops details { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0 14px; background: var(--paper); }
.ops details[open] { padding-bottom: 14px; }
.ops summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; font-size: 14px; list-style: none; }
.ops summary::-webkit-details-marker { display: none; }
.ops summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.ops details[open] summary::after { transform: rotate(-135deg); }
.ops .activity { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.ops .field { display: grid; gap: 6px; }
.ops .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ops ul { padding-left: 18px; font-size: 14px; }
.ops #pending-invites li { margin-bottom: 6px; }
.ops #invite-result { display: grid; gap: 8px; }
.ops .tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--canvas); }

#editor, #confirm { padding: 22px 24px 24px; }
#editor .dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
#editor .dialog-head h2 { margin: 0; }
#editor .dialog-head button { width: 36px; min-height: 36px; padding: 0; border: 0; color: var(--muted); }
#editor #fields { display: grid; gap: 14px; }
#editor .actions, #confirm .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#editor #save, #confirm #confirmyes { background: var(--ink); color: #fff; border-color: var(--ink); }
#formerror:empty { display: none; }

/* Privacidad */
.doc { max-width: 760px; margin: 0 auto; padding: 32px 24px 56px; }
.doc h1 { font-size: 30px; margin: 22px 0 10px; }
.doc .panel { margin-top: 16px; }
.doc .panel p, .doc .panel li { font-size: 14px; color: var(--ink-2); }

@media (max-width: 1100px) {
  .today-grid { grid-template-columns: minmax(0, 1fr); }
  .today-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 26px 26px 48px; }
}
@media (max-width: 860px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .settings-nav { position: static; display: flex; overflow-x: auto; gap: 4px; margin-bottom: 16px; scrollbar-width: none; border-bottom: 1px solid var(--line); }
  .settings-nav button { border-radius: 0; white-space: nowrap; flex: none; }
  .settings-nav button[aria-current=page] { background: transparent; box-shadow: inset 0 -2px 0 var(--ink); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-story { display: none; }
  .public-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .business-profile { position: static; }
}
@media (max-width: 760px) {
  :root { --tabbar: 64px; }
  .shell { display: block; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .mobile-top { display: flex !important; }
  .main { padding: 14px 16px 32px; }
  h1 { font-size: 23px; }
  .page-head { margin-bottom: 16px; align-items: center; }
  .page-head .sub { font-size: 13px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar button { flex-direction: column; gap: 3px; min-height: var(--tabbar); border: 0; border-radius: 0; background: transparent; font-size: 11px; font-weight: 600; color: var(--muted); padding: 0; }
  .tabbar button .icon { width: 22px; height: 22px; }
  .tabbar button[aria-current=page] { color: var(--ink); }
  .tabbar button[aria-current=page] .icon { color: var(--turno); }
  .today-side { grid-template-columns: minmax(0, 1fr); }
  .setup { padding: 16px; }
  .setup ol { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .ops .row { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 16px; }
  .agenda-bar { gap: 10px; }
  .date-title { font-size: 17px; margin: 0 2px; }
  td, th { padding: 11px 12px; }
  .hide-sm { display: none; }
  .public { padding: 18px 16px 28px; }
  .business-profile h1 { font-size: 27px; }
  .business-profile .initial { width: 46px; height: 46px; font-size: 22px; margin-bottom: 14px; }
  .booking-flow { padding: 18px 16px; border-radius: 12px; }
  .flow-foot button { width: 100%; }
  dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92vh; }
  #modal-content, #editor, #confirm { padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); }
  .form-actions { flex-wrap: wrap; }
  .form-actions button { flex: 1; }
  .form-actions .spacer { flex-basis: 100%; margin: 0; order: 9; }
}
.mobile-top { display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.mobile-top .biz { font-weight: 650; font-size: 14px; max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body[data-role="viewer"] .owner-or-editor { display: none !important; }

/* Ajustes tras la primera revisión */
.today-side, .side-card, .today-main > *, .content { min-width: 0; }
.sidebar-foot a { display: flex; align-items: center; text-decoration: none; border-radius: var(--radius-s); }
.today-side, .side-card, .today-main { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1100px) { .today-side { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .today-side { grid-template-columns: minmax(0, 1fr); } }
.booking { justify-content: flex-start; align-items: stretch; }
.booking.short { align-items: center; }
@media (min-width: 761px) { .agenda { max-height: calc(100vh - 230px); min-height: 420px; } }
.ops .panel .lead, .panel p.lead { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.ops .panel h2 { margin-bottom: 4px; }
.ops .panel > form { gap: 14px; }
.ops .panel details { margin-top: 0; }
input[type=file] { color: var(--muted); font-size: 14px; min-height: 0; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: 13px; margin-right: 12px; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--hover); }
.ops #invite-result:not(:empty) { margin-top: 16px; padding: 14px; background: var(--canvas); border-radius: var(--radius-s); }
.ops .panel + .panel { margin-top: 0; }
#importpreview:empty { display: none; }
th.actions { width: 1%; }
.ops #invite-result button { justify-self: start; }
.ops #pending-invites ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ops #pending-invites li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--canvas); border-radius: var(--radius-s); font-size: 14px; }
.public-footer > span { display: inline-flex; align-items: center; gap: 8px; }
.flow-top { margin-bottom: 14px; }
@media (min-width: 761px) {
  .date-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: visible; padding-bottom: 0; }
  .date-strip button { width: auto; min-height: 58px; }
}
@media (max-width: 760px) { .date-strip { scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; } .date-strip::-webkit-scrollbar { display: none; } }
.form-grid { align-items: start; }
.booking-flow .summary { margin-bottom: 18px; }
@media (max-width: 760px) {
  .setup ol { gap: 6px; }
  .setup li { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 10px 12px; }
  .setup li span { display: none; }
  .setup li.done { padding: 8px 12px; }
  .setup-foot .primary { width: 100%; }
  .page-head .actions { width: 100%; }
  .page-head .actions .accent { flex: 1; min-height: 44px; }
}
.setup { margin-bottom: 18px; }
@media (max-width: 760px) {
  .agenda-bar { align-items: flex-end; }
  .agenda-bar .group:first-child { flex: 1; }
  .date-pick { order: -1; flex-basis: 100%; justify-content: flex-start; padding: 0; min-height: 30px; margin-bottom: 4px; }
  .date-pick:hover { background: transparent; }
  .date-title { margin: 0; }
  .agenda-grid { min-width: 0; }
  .agenda { max-height: calc(100vh - 300px); min-height: 360px; }
}
@media (max-width: 760px) { .date-strip { scroll-padding-inline: 16px; } }
.break-zone { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #f4f5f7 0 6px, #eceef1 6px 12px); pointer-events: none; display: flex; align-items: flex-start; justify-content: center; padding-top: 6px; }
.break-zone span { font-size: 12px; color: var(--faint); font-weight: 600; }
.setup ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.setup-foot { align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
@media (max-width: 760px) { .setup ol { grid-template-columns: minmax(0, 1fr); } .setup-foot .hint { display: none; } }
.brand { gap: 5px; }
.brand-mark { width: 30px; height: 22px; }
.public-footer .brand-mark { width: 24px; height: 18px; }

/* El tique: forma recortada, borde dentado, perforación y número impreso */
.ticket-wrap { filter: drop-shadow(0 0 .6px rgba(23,25,30,.42)) drop-shadow(0 10px 22px rgba(23,25,30,.07)); }
.ticket {
  --cut: 176px; --tooth: 6px; --notch: 11px;
  position: relative; display: grid; grid-template-columns: var(--cut) minmax(0, 1fr);
  background: var(--paper); border-radius: 12px; min-height: 152px;
  -webkit-mask:
    conic-gradient(from 45deg at 0 50%, #000 90deg, #0000 0) 0 0 / var(--tooth) 12px repeat-y,
    linear-gradient(#000 0 0) var(--tooth) 0 / calc(100% - var(--tooth)) 100% no-repeat,
    radial-gradient(circle var(--notch) at var(--cut) 0, #0000 calc(var(--notch) - .5px), #000 var(--notch)) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at var(--cut) 100%, #0000 calc(var(--notch) - .5px), #000 var(--notch)) bottom / 100% 51% no-repeat;
  -webkit-mask-composite: source-over, source-in, source-over;
  mask:
    conic-gradient(from 45deg at 0 50%, #000 90deg, #0000 0) 0 0 / var(--tooth) 12px repeat-y,
    linear-gradient(#000 0 0) var(--tooth) 0 / calc(100% - var(--tooth)) 100% no-repeat,
    radial-gradient(circle var(--notch) at var(--cut) 0, #0000 calc(var(--notch) - .5px), #000 var(--notch)) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at var(--cut) 100%, #0000 calc(var(--notch) - .5px), #000 var(--notch)) bottom / 100% 51% no-repeat;
  mask-composite: add, intersect, add;
}
.ticket-stub { position: relative; background: var(--turno); color: #fff; padding: 16px 20px 16px 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.ticket-stub::after { content: ""; position: absolute; top: calc(var(--notch) + 5px); bottom: calc(var(--notch) + 5px); right: -3px; width: 6px; background: radial-gradient(circle at 3px 3px, var(--hole, var(--canvas)) 1.9px, #0000 2.3px) 0 0 / 6px 9px repeat-y; }
.ticket-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 650; }
.ticket-num { font-variant-numeric: tabular-nums; font-weight: 700; opacity: .85; font-size: 12px; }
.ticket-time { font-size: 68px; line-height: .88; font-weight: 800; font-stretch: 62%; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin-top: 4px; }
.ticket-end { font-size: 13px; opacity: .88; font-variant-numeric: tabular-nums; }
.ticket-body { padding: 18px 22px 18px 26px; display: grid; gap: 14px; align-content: space-between; min-width: 0; }
.ticket-who { font-size: 24px; font-weight: 700; line-height: 1.15; margin: 0 0 6px; overflow-wrap: anywhere; }
.ticket-what { color: var(--muted); margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.ticket-what span { display: inline-flex; align-items: center; gap: 7px; }
.ticket-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ticket.quiet .ticket-stub { background: var(--ink-2); }
.ticket.quiet .ticket-time { font-size: 52px; }
.ticket.cancelled .ticket-stub { background: #9aa0a9; }
.booking-flow .ticket-wrap { --hole: var(--paper); margin: 6px 0 20px; }
.booking-flow .ticket { --cut: 156px; }
.auth-story .ticket-wrap { filter: drop-shadow(0 0 .6px rgba(23,25,30,.42)) drop-shadow(0 18px 30px rgba(23,25,30,.1)); }
@media (max-width: 760px) {
  .ticket, .booking-flow .ticket { --cut: 122px; min-height: 0; }
  .ticket-stub { padding: 12px 12px 12px 18px; }
  .ticket-time { font-size: 48px; }
  .ticket-body { padding: 14px 14px 14px 18px; }
  .ticket-who { font-size: 19px; }
  .ticket-actions button, .ticket-actions .button { flex: 1; padding: 0 10px; }
}
.ticket:has(.ticket-facts) { grid-template-columns: var(--cut) minmax(0, 1fr) auto; }
.ticket-facts { margin: 0; padding: 18px 24px 18px 22px; display: grid; align-content: center; gap: 10px; min-width: 170px; border-left: 1.5px dashed var(--line); }
.ticket-facts div { display: grid; gap: 1px; }
.ticket-facts dt { font-size: 12px; color: var(--muted); }
.ticket-facts dd { margin: 0; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ticket-facts a { text-decoration: none; }
.ticket-facts a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1100px) { .ticket-facts { min-width: 140px; padding-left: 16px; padding-right: 16px; } }
@media (max-width: 760px) {
  .ticket:has(.ticket-facts) { grid-template-columns: var(--cut) minmax(0, 1fr); }
  .ticket-facts { grid-column: 2; border-left: 0; border-top: 1.5px dashed var(--line); padding: 10px 14px 14px 18px; display: flex; flex-wrap: wrap; gap: 6px 18px; min-width: 0; }
  .ticket:has(.ticket-facts) .ticket-stub { grid-row: span 2; }
}

/* Página legal */
.legal { max-width: 760px; }
.legal h1 { margin: 26px 0 6px; }
.legal .updated { color: var(--muted); font-size: 14px; }
.legal section { margin-top: 34px; }
.legal h2 { font-size: 21px; margin-bottom: 10px; scroll-margin-top: 20px; }
.legal h3 { margin: 18px 0 6px; }
.legal p, .legal li { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.legal ul, .legal ol { padding-left: 20px; display: grid; gap: 6px; }
.legal a { text-underline-offset: 3px; }
.legal .panel { margin: 4px 0 6px; }
.legal .panel p:last-child { margin-bottom: 0; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; }
.toc a { font-size: 13px; font-weight: 550; text-decoration: none; padding: 6px 11px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); }
.toc a:hover { background: var(--hover); }
.legal-foot { margin-top: 44px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.ticket-num, .ticket-label { white-space: nowrap; }
@media (max-width: 760px) { .ticket-top { flex-direction: column; align-items: flex-start; gap: 2px; } }

/* Agenda: vista Mes */
.month { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-head { padding: 10px 10px 8px; font-size: 12px; font-weight: 650; color: var(--muted); border-bottom: 1px solid var(--line); }
.month-day { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px; min-height: 108px; padding: 8px 9px; border: 0; border-radius: 0; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); background: var(--paper); text-align: left; font-weight: 400; white-space: normal; min-width: 0; }
.month-day:nth-child(7n + 7) { border-right: 0; }
.month-day:hover { background: var(--canvas); }
.month-day .n { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; margin: -3px 0 0 -4px; }
.month-day.is-today .n { background: var(--turno); color: #fff; }
.month-day.closed { background: repeating-linear-gradient(135deg, var(--paper) 0 7px, var(--line-2) 7px 8px); }
.month-day.closed:hover { background: var(--canvas); }
.month-day.out .n, .month-day.past .n { color: var(--faint); }
.month-day.out { background: var(--canvas); }
.month-day .count { font-size: 12px; font-weight: 650; color: var(--ink); }
.month-day.past .count { color: var(--muted); }
.month-day .peek { display: grid; gap: 2px; min-width: 0; }
.month-day .peek > span { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.month-day .peek .dot { flex: none; }
.month-day .peek .more { color: var(--muted); }
.month .agenda-foot { border-top: 0; }

/* Agenda: vista Próximas */
.upcoming { display: grid; gap: 14px; }
.upcoming-day { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 8px; }
.upcoming-day h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 16px; margin: 0 0 6px; padding: 0 6px; }
.upcoming-day h2 span { font-size: 13px; font-weight: 500; color: var(--muted); }

@media (max-width: 760px) {
  .agenda-bar .group:has(.view-switch) { order: -1; flex-basis: 100%; }
  .view-switch { display: flex; width: 100%; }
  .view-switch button { flex: 1; padding: 0 6px; }
  .month-head { padding: 8px 4px 6px; text-align: center; font-size: 11px; }
  .month-day { min-height: 62px; padding: 6px 3px; align-items: center; gap: 3px; }
  .month-day .n { margin: 0; }
  .month-day .peek, .month-day .hide-sm { display: none; }
  .month-day .count { min-width: 20px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--turno-soft); color: var(--turno-dark); display: grid; place-items: center; font-size: 11px; }
  .month-day.past .count { background: var(--canvas); color: var(--muted); }
  .upcoming-day { padding: 12px 10px 6px; }
}

/* Componentes nuevos del panel (revisión 2026-10-21). Se integran al final de public/style.css. */

/* Bloque con título dentro de una ficha */
.block { display: grid; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line-2); }
.block:first-of-type { border-top: 0; padding-top: 0; }
.block-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; font-size: 14px; font-weight: 650; color: var(--ink); }
.block-title .link-button { font-size: 13px; }

/* Buscador de cliente */
.client-search { position: relative; }
.client-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.client-search input { padding-left: 38px; }
.suggest { list-style: none; margin: 0; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); display: grid; gap: 2px; }
.suggest button { width: 100%; min-height: 48px; justify-content: space-between; gap: 12px; border: 0; padding: 6px 10px; text-align: left; font-weight: 400; white-space: normal; }
.suggest button strong { display: block; font-weight: 600; }
.suggest button small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.suggest button .meta { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.suggest .new { color: var(--ink-2); }
.suggest .new .icon { color: var(--muted); }

/* Cliente elegido */
.picked { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--canvas); }
.picked strong { display: block; }
.picked span { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.picked .flag { display: inline-block; margin-left: 6px; color: var(--warn); font-size: 12px; font-weight: 600; }

/* Elección de servicio en el panel: filas compactas */
.choice-list { display: grid; gap: 6px; }
.choice-list label { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); font-weight: 400; font-size: 14px; color: var(--ink); cursor: pointer; transition: background-color .15s, border-color .15s; }
.choice-list label:hover { background: var(--hover); }
.choice-list input { position: absolute; opacity: 0; pointer-events: none; }
.choice-list label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice-list label:has(input:focus-visible) { background: var(--hover); }
.choice-list .name { flex: 1; font-weight: 600; }
.choice-list .meta { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.choice-list.collapsed label:not(:has(input:checked)) { display: none; }

/* Selector de profesional dentro de «Cuándo» */
.who-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.who-chips button { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 99px; gap: 7px; color: var(--ink-2); }
.who-chips button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.who-chips button[aria-pressed=true] .dot { box-shadow: 0 0 0 2px #fff; }

/* Huecos con profesional */
.slots.with-staff button { flex-direction: column; gap: 1px; min-height: 52px; }
.slots.with-staff button small { font-size: 11.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 4px; }
.slots.with-staff button.selected small { color: rgba(255,255,255,.78); }

/* Sin huecos ese día */
.no-slots { display: grid; gap: 12px; padding: 14px 16px; border-radius: var(--radius-s); background: var(--canvas); font-size: 14px; }
.no-slots p { margin: 0; color: var(--ink-2); }
.no-slots .buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* Pie fijo de una ficha con resumen y acción */
.sheet-foot { position: sticky; bottom: -24px; margin: 8px -24px -24px; padding: 14px 24px 18px; background: var(--paper); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.sheet-foot .recap { min-width: 0; font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.sheet-foot .recap strong { display: block; color: var(--ink); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-foot .accent, .sheet-foot .primary { flex: none; min-height: 46px; padding: 0 20px; }

/* Ficha de cita */
.appt-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 18px; align-items: center; }
.appt-head .big-time { grid-row: span 2; font-size: 44px; line-height: .95; font-weight: 800; font-stretch: 62%; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.appt-head .when { font-weight: 650; }
.appt-head .what { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.appt-head .what span { display: inline-flex; align-items: center; gap: 6px; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--canvas); }
.person .name { display: block; font-weight: 650; border: 0; background: none; padding: 0; min-height: 0; text-align: left; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.person .name:hover { background: none; text-decoration-color: currentColor; }
.person small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.person .buttons { display: flex; gap: 6px; flex: none; }
.state-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--radius-s); font-size: 14px; font-weight: 600; }
.state-banner.completed { background: var(--ok-soft); color: var(--ok); }
.state-banner.no_show { background: var(--warn-soft); color: var(--warn); }
.state-banner.cancelled { background: var(--canvas); color: var(--muted); }
.act-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.act-grid .wide { grid-column: 1 / -1; }
.news-button .count { background: var(--turno); color: white; }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li + li { border-top: 1px solid var(--line); }
.news-row { display: flex; width: 100%; align-items: center; justify-content: flex-start; gap: 10px; padding: 12px 0; border: 0; border-radius: 0; text-align: left; white-space: normal; font-weight: 400; }
.news-row > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.news-row .status-pill { flex-shrink: 0; }
.unread-dot { flex: 0 0 7px; height: 7px; border-radius: 50%; background: var(--turno); }
.history-filters { margin: 18px 0; flex-wrap: wrap; }
@media (max-width: 560px) {
  .news-row { flex-wrap: wrap; }
  .news-row > span:last-child { flex-basis: 100%; }
  .modal-head { flex-wrap: wrap; }
  .modal-head .modal-back { font-size: 13px; }
}
.act-grid button { justify-content: center; text-align: center; min-height: 46px; gap: 10px; }
.act-grid button.primary, .act-grid button.wide { justify-content: center; }
.notes-form { display: grid; gap: 8px; }
.notes-form textarea { min-height: 72px; }
.notes-form .form-actions { padding-top: 0; }

/* Ficha de cliente */
.facts-line { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 14px; color: var(--muted); }
.facts-line strong { color: var(--ink); font-weight: 650; }
.facts-line .warn strong, .facts-line .warn { color: var(--warn); }
.next-appt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--turno); border-radius: var(--radius-s); text-align: left; font-weight: 400; white-space: normal; background: var(--paper); }
.next-appt .t { font-size: 24px; font-weight: 800; font-stretch: 62%; font-variant-numeric: tabular-nums; }
.next-appt strong { display: block; }
.next-appt small { display: block; color: var(--muted); font-size: 13px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li + li { border-top: 1px solid var(--line-2); }
.history button { width: 100%; display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 50px; padding: 8px 4px; border: 0; border-radius: 0; text-align: left; font-weight: 400; white-space: normal; }
.history .d { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.history .d b { display: block; color: var(--ink); font-weight: 650; font-size: 14px; }
.history .s { min-width: 0; font-size: 14px; }
.history .s small { display: block; color: var(--muted); font-size: 12.5px; }

/* Tabla de clientes: filas que se abren */
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--canvas); }
td .tag-warn { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-size: 11.5px; font-weight: 650; vertical-align: 1px; }

/* Lista de espera */
.wait-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wait-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.wait-list .who strong { display: block; }
.wait-list .who small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.wait-list .buttons { display: flex; gap: 6px; }
.wait-list li.contacted { background: var(--canvas); }
.wait-list .src { color: var(--faint); font-size: 12px; }
.wait-day { margin: 14px 0 6px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.wait-day:first-child { margin-top: 0; }
.wait-button .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--turno); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }

@media (max-width: 760px) {
  .sheet-foot { bottom: -22px; margin: 8px -16px -22px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
  .history button { grid-template-columns: 78px minmax(0, 1fr) auto; }
  .act-grid button { min-height: 48px; }
}

/* Integración de las fichas con los controles del panel existente. */
.customer-name, .wait-name { display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; font-weight: 650; text-align: left; white-space: normal; }
.customer-name:hover, .wait-name:hover { background: transparent; text-decoration: underline; }
.customer-name:focus-visible, .wait-name:focus-visible { background: var(--hover); }
#customer-new { justify-self: start; white-space: normal; }
#new-appointment .block-title label { margin: 0; font-weight: inherit; color: inherit; }
#new-appointment .block-title .hint { margin: 0; font-weight: 400; }
#new-appointment .form-grid, #change-appointment .form-grid { margin: 0; }
#modal-content .person > div:first-child { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .agenda-bar .wait-label { display: none; }
  .agenda-bar .wait-button { padding: 0 10px; gap: 5px; }
  #modal-content .person { flex-wrap: wrap; }
  .suggest button .meta { white-space: normal; text-align: right; }
  .wait-list li { padding: 10px; }
  .wait-list .buttons { flex-wrap: wrap; justify-content: flex-end; }
  .wait-list .who { overflow-wrap: anywhere; }
}

@media (max-width: 760px) {
  .agenda-bar .group:has(.view-switch) { flex-wrap: nowrap; }
  .agenda-bar .wait-button { flex: none; }
  .agenda-bar .view-switch { flex: 1; min-width: 0; width: auto; }
}

#modal-content .sheet-foot { bottom: 0; }

/* Ajustes de la revisión 1C. */
.slot-group + .slot-group { margin-top: 16px; }
.slot-group .wait-day { margin: 0 0 6px; }
@media (max-width: 760px) {
  [data-availability] .slots:not(.with-staff) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wait-list li { grid-template-columns: minmax(0, 1fr); }
  .wait-list .buttons { width: 100%; flex-wrap: nowrap; }
  .wait-list .buttons .primary { flex: 1; }
}
