/* ==========================================================
   COLORES Y TIPOGRAFÍA — cambia aquí la identidad de la demo
   ========================================================== */
:root {
  --acento: #0F766E;          /* color principal */
  --acento-oscuro: #115E59;
  --acento-suave: #E6F4F2;
  --acento-borde: #A7D7D1;
  --acento-texto: #0F766E;    /* acento usado como texto */
  --acento-hover: #115E59;

  --fondo: #F4F6F8;
  --superficie: #FFFFFF;
  --superficie-2: #F8FAFB;
  --linea-suave: #F1F5F9;
  --barra: #0F172A;
  --toast: #0F172A;
  --wa-bg: #F0FAF4;  --wa-borde: #BBE5CC;
  --rojo-borde: #FECACA;
  --texto: #0F172A;
  --texto-2: #475569;
  --borde: #E2E8F0;
  --borde-2: #CBD5E1;

  --ambar: #92400E;  --ambar-bg: #FEF3C7;
  --verde: #166534;  --verde-bg: #DCFCE7;
  --rojo: #B91C1C;   --rojo-bg: #FEE2E2;
  --gris: #475569;   --gris-bg: #F1F5F9;
  --wa: #128C4A;

  --radio: 14px;
  --radio-sm: 10px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --sombra-lg: 0 24px 60px rgba(15, 23, 42, .18);
  --fuente: "Plus Jakarta Sans", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --foco: 0 0 0 3px var(--superficie), 0 0 0 5px var(--acento);
  color-scheme: light;
}
/* Tono oscuro */
:root[data-theme="dark"] {
  --acento: #0F766E;
  --acento-oscuro: #5EEAD4;
  --acento-suave: #0E2B29;
  --acento-borde: #1F5C56;
  --acento-texto: #5EEAD4;
  --acento-hover: #0D9488;
  --fondo: #0B1120;
  --superficie: #111827;
  --superficie-2: #0F172A;
  --linea-suave: #172033;
  --barra: #020617;
  --toast: #1E293B;
  --texto: #E5E7EB;
  --texto-2: #9CA3AF;
  --borde: #1F2937;
  --borde-2: #334155;
  --ambar: #FCD34D;  --ambar-bg: #3A2A0B;
  --verde: #86EFAC;  --verde-bg: #0F2E1C;
  --rojo: #FCA5A5;   --rojo-bg: #3B1316;
  --gris: #CBD5E1;   --gris-bg: #1E293B;
  --wa-bg: #0D261A;  --wa-borde: #1D4D33;
  --rojo-borde: #7F1D1D;
  --sombra: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  --sombra-lg: 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--fuente); color: var(--texto); background: var(--fondo); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--acento-texto); }
:focus-visible { outline: none; box-shadow: var(--foco); border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--barra); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
.ico { width: 18px; height: 18px; flex: none; }
.muted { color: var(--texto-2); font-size: 13.5px; }
.block { display: block; }

/* ---------- barra de la agencia ---------- */
.demo-bar { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; background: var(--barra); color: #E2E8F0; padding: 7px 16px; font-size: 13px; }
.demo-bar strong { color: #fff; }
.demo-bar__cta { color: #fff; background: var(--acento); padding: 6px 14px; border-radius: 999px; font-weight: 700; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.demo-bar__cta:hover { background: #0d8a80; }

/* ---------- encabezado ---------- */
.intro { max-width: 1440px; margin: 0 auto; padding: 28px 24px 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.theme-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--borde-2); background: var(--superficie); color: var(--texto); border-radius: 999px; font-weight: 700; font-size: 14px; }
.theme-btn:hover { border-color: var(--acento); }
.theme-btn .ico-sun { display: none; }
:root[data-theme="dark"] .theme-btn .ico-sun { display: block; }
:root[data-theme="dark"] .theme-btn .ico-moon { display: none; }
body { transition: background-color .2s ease; }
.intro h1 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.02em; line-height: 1.15; font-weight: 800; }
.intro p { color: var(--texto-2); margin-top: 6px; font-size: 16px; max-width: 60ch; }

/* ---------- escenario: dos vistas ---------- */
.stage { max-width: 1440px; margin: 0 auto; padding: 16px 24px 32px; display: grid; grid-template-columns: 404px minmax(0, 1fr); gap: 28px; align-items: start; }
.stage__label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-2); margin-bottom: 12px; }
.stage__num { width: 22px; height: 22px; border-radius: 50%; background: var(--acento); color: #fff; display: inline-grid; place-items: center; font-size: 12px; letter-spacing: 0; }
.stage__cliente { position: sticky; top: 16px; }
.view-tabs { display: none; }
.foot { text-align: center; color: var(--texto-2); font-size: 12.5px; padding: 8px 16px 32px; }

/* ---------- marco de celular ---------- */
.phone { width: 390px; max-width: 100%; height: min(800px, calc(100vh - 80px)); min-height: 620px; background: #0B1220; border-radius: 48px; padding: 12px; box-shadow: var(--sombra-lg); }
.phone__screen { height: 100%; background: var(--superficie); border-radius: 37px; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.phone__status { height: 40px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 26px 0 30px; font-size: 13px; font-weight: 700; position: relative; }
.phone__notch { position: absolute; left: 50%; top: 9px; transform: translateX(-50%); width: 104px; height: 26px; background: #0B1220; border-radius: 20px; }
.phone__icons { display: flex; gap: 3px; align-items: flex-end; }
.phone__icons i { width: 4px; background: var(--texto); border-radius: 1px; }
.phone__icons i:nth-child(1) { height: 6px; } .phone__icons i:nth-child(2) { height: 9px; } .phone__icons i:nth-child(3) { height: 12px; }

/* ==========================================================
   VISTA DEL CLIENTE
   ========================================================== */
.capp { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.capp__head { padding: 6px 20px 12px; border-bottom: 1px solid var(--borde); }
.brand { display: flex; align-items: center; gap: 11px; }
.brand__mark { width: 40px; height: 40px; border-radius: 12px; background: var(--acento); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 19px; flex: none; }
.brand__mark--sm { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
.brand__name { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.brand__meta { font-size: 12.5px; color: var(--texto-2); }
.capp__body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 20px; scroll-behavior: auto; }
.capp__nav { flex: none; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--borde); background: var(--superficie); padding: 4px 8px 10px; }
.capp__nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; font-size: 12.5px; font-weight: 600; color: var(--texto-2); min-height: 52px; border-radius: 12px; }
.capp__nav button[aria-current="page"] { color: var(--acento-texto); }
.capp__nav .ico { width: 22px; height: 22px; }

.steps { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.capp__back, .capp__back-spacer { width: 40px; height: 40px; flex: none; }
.capp__back { border: 1px solid var(--borde); background: var(--superficie); border-radius: 12px; display: grid; place-items: center; }
.capp__back-spacer { display: none; }
.steps__info { flex: 1; }
.steps__count { font-size: 12.5px; font-weight: 600; color: var(--texto-2); margin-bottom: 5px; }
.steps__bar { height: 5px; background: var(--borde); border-radius: 9px; overflow: hidden; }
.steps__bar span { display: block; height: 100%; background: var(--acento); border-radius: 9px; transition: width .3s ease; }
.capp__title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 12px; }
.capp__title:focus { box-shadow: none; }
.chosen { font-size: 13px; color: var(--acento-oscuro); background: var(--acento-suave); padding: 7px 12px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }

.svc-list, .pro-list { display: grid; gap: 10px; }
.svc-card, .pro-card { width: 100%; text-align: left; border: 1.5px solid var(--borde); background: var(--superficie); border-radius: var(--radio); padding: 14px 16px; transition: border-color .15s, background .15s; }
.svc-card:hover, .pro-card:hover { border-color: var(--acento-borde); }
.svc-card.is-selected, .pro-card.is-selected { border-color: var(--acento); background: var(--acento-suave); }
.svc-card { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name price" "meta price"; row-gap: 2px; align-items: center; }
.svc-card__name { grid-area: name; font-weight: 700; }
.svc-card__meta { grid-area: meta; color: var(--texto-2); font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.svc-card__meta .ico { width: 14px; height: 14px; }
.svc-card__price { grid-area: price; font-weight: 800; font-size: 18px; color: var(--acento-oscuro); }
.pro-card { display: flex; align-items: center; gap: 12px; }
.pro-card__text { display: flex; flex-direction: column; }
.pro-card__name { font-weight: 700; }
.pro-card__meta { font-size: 13px; color: var(--texto-2); }
.avatar { --av: var(--acento); width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: color-mix(in srgb, var(--av) 75%, var(--texto)); background: color-mix(in srgb, var(--av) 16%, var(--superficie)); }
.avatar--any { color: var(--texto-2); background: var(--gris-bg); }

.day-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -20px 6px; padding-left: 20px; padding-right: 20px; scroll-snap-type: x proximity; }
.day-chip { flex: none; width: 66px; border: 1.5px solid var(--borde); background: var(--superficie); border-radius: 14px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; scroll-snap-align: start; }
.day-chip__dow { font-size: 12px; font-weight: 600; color: var(--texto-2); text-transform: capitalize; }
.day-chip__num { font-size: 20px; font-weight: 800; line-height: 1.2; }
.day-chip__sub { font-size: 10.5px; color: var(--texto-2); }
.day-chip.is-selected { border-color: var(--acento); background: var(--acento); color: #fff; }
.day-chip.is-selected .day-chip__dow, .day-chip.is-selected .day-chip__sub { color: #D1FAF4; }
.day-chip:disabled { opacity: .5; cursor: not-allowed; background: var(--gris-bg); }
.slot-date { font-weight: 700; margin: 8px 0 2px; }
.slot-date::first-letter { text-transform: uppercase; }
.slot-group { font-size: 12.5px; font-weight: 700; color: var(--texto-2); text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 8px; }
.slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot { border: 1.5px solid var(--borde); background: var(--superficie); border-radius: 10px; min-height: 44px; font-weight: 700; font-size: 14.5px; }
.slot:hover { border-color: var(--acento-borde); }
.slot.is-selected { background: var(--acento); border-color: var(--acento); color: #fff; }
.capp__sticky { position: sticky; bottom: -20px; margin: 16px -20px -20px; padding: 12px 20px 16px; background: linear-gradient(to bottom, transparent, var(--superficie) 30%); }

.summary { display: grid; gap: 0; border: 1px solid var(--borde); border-radius: var(--radio); padding: 4px 14px; margin-bottom: 16px; background: var(--superficie-2); }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--borde); font-size: 14px; }
.summary div:last-child { border-bottom: 0; }
.summary dt { color: var(--texto-2); }
.summary dd { font-weight: 700; text-align: right; }
.summary dd:first-letter { text-transform: uppercase; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; }
.field label, .field > .lbl { font-weight: 600; font-size: 13.5px; }
.opt { color: var(--texto-2); font-weight: 500; }
input:not([type="checkbox"]), select, textarea { width: 100%; border: 1.5px solid var(--borde-2); border-radius: 10px; padding: 10px 12px; min-height: 44px; background: var(--superficie); }
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px rgba(15, 118, 110, .18); }
.field__hint { font-size: 12.5px; color: var(--texto-2); }
.field__err { font-size: 13px; color: var(--rojo); font-weight: 600; }
.has-error input { border-color: var(--rojo); }
.form__note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texto-2); }
.form__note .ico { color: var(--wa); }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 11px; border: 1.5px solid transparent; font-weight: 700; font-size: 14.5px; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn--primary { background: var(--acento); color: #fff; }
.btn--primary:hover { background: var(--acento-hover); }
.btn--secondary { background: var(--acento-suave); color: var(--acento-oscuro); border-color: var(--acento-borde); }
.btn--secondary:hover { background: color-mix(in srgb, var(--acento-suave) 70%, var(--acento-borde)); }
.btn--ghost { background: var(--superficie); border-color: var(--borde-2); color: var(--texto); }
.btn--ghost:hover { background: var(--gris-bg); }
.btn--danger { background: #B91C1C; color: #fff; }
.btn--danger-text { color: var(--rojo); }
.btn--link { background: none; color: var(--acento-texto); border: 0; }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: #0e7a40; }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-inline { background: none; border: 0; padding: 0; color: var(--acento-texto); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; min-height: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }
.btn-row--end { justify-content: flex-end; }
.btn-row--end > .btn { flex: 0 0 auto; }
.btn-row--appt { margin: -6px 0 16px; }
.stack { display: grid; gap: 10px; margin-top: 4px; }

.done { text-align: center; padding: 6px 0 8px; }
.done__icon { width: 60px; height: 60px; border-radius: 50%; background: var(--acento-suave); color: var(--acento-texto); display: inline-grid; place-items: center; margin-bottom: 10px; animation: pop .4s ease; }
.done__icon .ico { width: 30px; height: 30px; stroke-width: 2.5; }
.done__sub { color: var(--texto-2); margin: -4px 0 16px; }
.done + .summary + .badge { margin: -6px 0 14px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.wa-note { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--wa-borde); background: var(--wa-bg); border-radius: var(--radio); padding: 12px 14px; }
.wa-note .ico { color: var(--wa); width: 22px; height: 22px; margin-top: 1px; }
.wa-note__title { font-weight: 700; font-size: 14px; }
.wa-note__body { font-size: 13px; color: var(--texto-2); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--pendiente { color: var(--ambar); background: var(--ambar-bg); }
.badge--confirmada { color: var(--acento-oscuro); background: var(--acento-suave); }
.badge--atendida { color: var(--verde); background: var(--verde-bg); }
.badge--no_asistio { color: var(--rojo); background: var(--rojo-bg); }
.badge--cancelada { color: var(--gris); background: var(--gris-bg); }

.section-label { font-size: 12.5px; font-weight: 700; color: var(--texto-2); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 8px; }
.my-appt { display: flex; gap: 14px; align-items: center; border: 1px solid var(--borde); border-radius: var(--radio); padding: 12px; margin-bottom: 14px; }
.my-appt--main { border-color: var(--acento-borde); background: var(--acento-suave); }
.my-appt__date { width: 58px; flex: none; text-align: center; background: var(--superficie); border-radius: 12px; padding: 6px 0; border: 1px solid var(--borde); display: flex; flex-direction: column; font-size: 11.5px; color: var(--texto-2); text-transform: capitalize; }
.my-appt__date strong { font-size: 22px; color: var(--texto); line-height: 1.1; }
.my-appt__svc { font-weight: 700; }
.my-appt__meta { font-size: 13.5px; color: var(--texto-2); margin-bottom: 4px; }
.confirm-box { border: 1px solid var(--rojo-borde); background: var(--rojo-bg); border-radius: var(--radio); padding: 12px; margin: -6px 0 16px; display: grid; gap: 10px; font-weight: 600; font-size: 14px; }
.history li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13.5px; padding: 8px 0; border-bottom: 1px solid var(--borde); }
.hint-box { margin-top: 14px; font-size: 13.5px; color: var(--texto-2); background: var(--gris-bg); border-radius: 12px; padding: 12px; }
.empty { color: var(--texto-2); font-size: 14px; padding: 10px 0; }
.alert { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; font-weight: 600; margin: 0 0 12px; }
.alert--warn { background: var(--ambar-bg); color: var(--ambar); }
.alert--ok { background: var(--verde-bg); color: var(--verde); margin-top: 12px; }
.form--inline { margin-bottom: 4px; }

/* ==========================================================
   PANEL DEL NEGOCIO
   ========================================================== */
.papp { container-type: inline-size; background: var(--superficie); border: 1px solid var(--borde); border-radius: 18px; box-shadow: var(--sombra); overflow: hidden; }
.papp__shell { display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: 760px; }
.papp__side { background: var(--superficie-2); border-right: 1px solid var(--borde); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; }
.papp__brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.papp__brand-name { font-weight: 800; font-size: 14.5px; }
.papp__brand-sub { font-size: 12px; color: var(--texto-2); }
.papp__nav { display: grid; gap: 2px; }
.papp__nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--texto-2); min-height: 42px; }
.papp__nav button:hover { background: var(--gris-bg); color: var(--texto); }
.papp__nav button[aria-current="page"] { background: var(--acento-suave); color: var(--acento-oscuro); }
.nav-badge { margin-left: auto; background: #B91C1C; color: #fff; font-size: 11.5px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; }
.papp__reset { margin-top: auto; display: flex; align-items: center; gap: 8px; border: 1.5px dashed var(--borde-2); background: var(--superficie); border-radius: 10px; padding: 10px; font-weight: 700; font-size: 13.5px; color: var(--texto-2); min-height: 44px; }
.papp__reset:hover { border-color: var(--acento); color: var(--acento-texto); }
.papp__main { min-width: 0; display: flex; flex-direction: column; }
.papp__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--borde); flex-wrap: wrap; }
.papp__title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.papp__top .muted:first-letter { text-transform: uppercase; }
.pill-alert { border: 0; background: var(--rojo-bg); color: var(--rojo); font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 999px; min-height: 36px; animation: soft-pulse 2s ease infinite; }
@keyframes soft-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, .25); } 50% { box-shadow: 0 0 0 6px rgba(185, 28, 28, 0); } }
.papp__content { padding: 20px 24px 24px; display: grid; gap: 16px; align-content: start; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 16px; }
.kpi__label { font-size: 13px; color: var(--texto-2); font-weight: 600; }
.kpi__value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.kpi__sub { font-size: 12.5px; color: var(--texto-2); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; background: var(--superficie); min-width: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card__head--pad { padding: 16px 16px 0; }
.card__title { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.card__head .card__title { margin-bottom: 0; }

.next-appt { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; border: 1px solid var(--acento-borde); background: var(--acento-suave); border-radius: 12px; padding: 12px 14px; }
.next-appt__time { font-size: 22px; font-weight: 800; color: var(--acento-oscuro); }
.next-appt__info { flex: 1; display: flex; flex-direction: column; font-size: 13.5px; color: var(--texto-2); min-width: 0; }
.next-appt__info strong { color: var(--texto); font-size: 15px; }
.next-appt__info span:last-child:first-letter { text-transform: uppercase; }
.appt-list { display: grid; gap: 6px; }
.appt-row { --pc: var(--acento); width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--borde); border-left: 4px solid var(--pc); background: var(--superficie); border-radius: 10px; padding: 9px 12px; min-height: 52px; }
.appt-row:hover { background: var(--superficie-2); }
.appt-row__time { font-weight: 800; width: 52px; flex: none; display: flex; flex-direction: column; line-height: 1.2; }
.appt-row__time small { font-size: 11px; color: var(--texto-2); font-weight: 600; text-transform: capitalize; }
.appt-row__info { flex: 1; display: flex; flex-direction: column; font-size: 13px; color: var(--texto-2); min-width: 0; }
.appt-row__info strong { color: var(--texto); font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.new-tag { background: #B91C1C; color: #fff; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }

/* llegada de cita nueva */
.is-fresh { animation: arrive 1.6s ease 2; position: relative; z-index: 2; }
@keyframes arrive {
  0% { box-shadow: 0 0 0 0 rgba(15, 118, 110, .55); transform: scale(1); }
  30% { box-shadow: 0 0 0 8px rgba(15, 118, 110, .18); transform: scale(1.02); }
  100% { box-shadow: 0 0 0 14px rgba(15, 118, 110, 0); transform: scale(1); }
}

/* barra de herramientas */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--gris-bg); border-radius: 11px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--texto-2); min-height: 38px; }
.seg button[aria-pressed="true"] { background: var(--superficie); color: var(--texto); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--borde-2); }
.datenav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.datenav__label { font-weight: 700; margin-left: 6px; }
.icon-btn { width: 38px; height: 38px; border: 1.5px solid var(--borde-2); background: var(--superficie); border-radius: 10px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--gris-bg); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { --pc: var(--acento); display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--borde-2); background: var(--superficie); border-radius: 999px; padding: 6px 13px; font-weight: 600; font-size: 13.5px; min-height: 38px; }
.chip[aria-pressed="true"] { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 14%, var(--superficie)); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); }

/* calendario */
.cal-wrap { border: 1px solid var(--borde); border-radius: var(--radio); overflow: auto; max-height: 640px; background: var(--superficie); }
.cal { min-width: calc(56px + var(--cols) * 150px); }
.cal__header { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(150px, 1fr)); position: sticky; top: 0; z-index: 5; background: var(--superficie); border-bottom: 1px solid var(--borde); }
.cal__corner { border-right: 1px solid var(--borde); }
.cal__head { --pc: var(--texto-2); padding: 10px 10px 9px; border-right: 1px solid var(--borde); border-top: 3px solid var(--pc); display: flex; flex-direction: column; min-width: 0; }
.cal__head strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: capitalize; }
.cal__head span { font-size: 12px; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal__head.is-today strong { color: var(--acento-texto); }
.cal__body { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(150px, 1fr)); padding: 8px 0; }
.cal__times { position: relative; border-right: 1px solid var(--borde); }
.cal__times span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11.5px; color: var(--texto-2); font-weight: 600; }
.cal__col { position: relative; border-right: 1px solid var(--borde);
  background-image: linear-gradient(to bottom, var(--borde) 1px, transparent 1px), linear-gradient(to bottom, var(--linea-suave) 1px, transparent 1px);
  background-size: 100% var(--hour), 100% calc(var(--hour) / 2); }
.cal__col:last-child { border-right: 0; }
.cal__block { position: absolute; left: 3px; right: 3px; border-radius: 8px; background: repeating-linear-gradient(-45deg, var(--gris-bg), var(--gris-bg) 6px, var(--borde) 6px, var(--borde) 12px); border: 1px solid var(--borde-2); display: flex; align-items: flex-start; padding: 5px 8px; font-size: 12px; font-weight: 700; color: var(--texto-2); overflow: hidden; }
.cal__appt { --pc: var(--acento); position: absolute; left: 4px; right: 4px; text-align: left; border: 1px solid color-mix(in srgb, var(--pc) 35%, var(--superficie)); border-left: 4px solid var(--pc); background: color-mix(in srgb, var(--pc) 12%, var(--superficie)); border-radius: 8px; padding: 4px 8px; display: flex; flex-direction: column; overflow: hidden; font-size: 12px; line-height: 1.3; color: var(--texto); }
.cal__appt:hover { background: color-mix(in srgb, var(--pc) 20%, var(--superficie)); z-index: 3; }
.cal__appt-top { display: flex; align-items: center; gap: 6px; }
.cal__appt-time { font-weight: 800; }
.cal__appt-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal__appt-svc { color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal__appt.is-short { flex-direction: row; align-items: center; gap: 6px; }
.cal__appt.is-short .cal__appt-svc { display: none; }
.cal__appt.st-pendiente { border-style: dashed; border-left-style: solid; }
.cal__appt.st-pendiente .cal__appt-time::after { content: " · por confirmar"; font-weight: 600; color: var(--ambar); }
.cal__appt.st-atendida { background: var(--superficie-2); border-left-color: var(--verde); }
.cal__appt.st-no_asistio { background: var(--rojo-bg); border-left-color: var(--rojo); }
.cal__appt.st-cancelada { background: repeating-linear-gradient(-45deg, var(--superficie), var(--superficie) 5px, var(--superficie-2) 5px, var(--superficie-2) 10px); border-color: var(--borde); border-left-color: var(--borde-2); color: var(--texto-2); opacity: .8; }
.cal__appt.st-cancelada .cal__appt-name { text-decoration: line-through; }
.cal__now { position: absolute; left: 0; right: 0; height: 2px; background: #DC2626; z-index: 4; pointer-events: none; }
.cal__now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #DC2626; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--texto-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend__sw { width: 14px; height: 10px; border-radius: 3px; border: 1px solid var(--borde-2); }
.st-pendiente.legend__sw { background: var(--ambar-bg); border-color: #FCD34D; }
.st-confirmada.legend__sw { background: var(--acento-suave); border-color: var(--acento-borde); }
.st-atendida.legend__sw { background: var(--verde-bg); border-color: #86EFAC; }
.st-no_asistio.legend__sw { background: var(--rojo-bg); border-color: #FCA5A5; }
.st-cancelada.legend__sw { background: var(--gris-bg); }
.st-block.legend__sw { background: repeating-linear-gradient(-45deg, #F1F5F9, #F1F5F9 3px, #CBD5E1 3px, #CBD5E1 5px); }
.sw-solid { background: var(--acento); border-color: var(--acento); }
.sw-soft { background: var(--acento-borde); border-color: var(--acento-borde); }
.legend--inline { margin-top: 12px; }

/* tablas */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-2); font-weight: 700; padding: 10px 16px; background: var(--superficie-2); border-bottom: 1px solid var(--borde); }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.td-actions { text-align: right; }
.table--edit td { padding: 8px 12px; }
.table--edit input, .table--edit select { min-height: 40px; padding: 7px 10px; }
.table--edit tr.is-off td { background: var(--superficie-2); }
.table--edit tr.is-off input, .table--edit tr.is-off select { color: var(--texto-2); }
.money-input { position: relative; max-width: 120px; }
.money-input span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--texto-2); font-weight: 600; }
.money-input input { padding-left: 22px !important; }
.field--search { flex: 1; max-width: 360px; }

.switch { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; font-weight: 600; font-size: 13.5px; min-height: 40px; padding: 0; white-space: nowrap; }
.switch__track { width: 38px; height: 22px; border-radius: 11px; background: var(--borde-2); position: relative; transition: background .2s; flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch[aria-checked="true"] .switch__track { background: var(--acento); }
.switch[aria-checked="true"] .switch__track::after { transform: translateX(16px); }

.add-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; background: var(--superficie-2); border-top: 1px solid var(--borde); }
.card .add-row { margin: 16px -16px -16px; border-radius: 0 0 var(--radio) var(--radio); }
.add-row__title { width: 100%; font-weight: 800; font-size: 13.5px; }
.add-row .field { flex: 1 1 140px; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.staff-card { --pc: var(--acento); border: 1px solid var(--borde); border-top: 3px solid var(--pc); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.staff-card.is-off { background: var(--superficie-2); }
.staff-card__top { display: flex; justify-content: space-between; align-items: center; }
.svc-checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.svc-checks legend { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; padding: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.svc-checks .check { border: 1px solid var(--borde-2); border-radius: 999px; padding: 4px 10px 4px 8px; min-height: 32px; }
.svc-checks .check:has(input:checked) { border-color: var(--acento-borde); background: var(--acento-suave); }
.check input { width: 16px; height: 16px; accent-color: var(--acento); margin: 0; }
.check--inline { min-height: 44px; font-weight: 600; font-size: 13.5px; }

.block-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; margin-top: 12px; }
.block-form .field--grow { grid-column: span 2; }
.quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.block-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--borde); }
.block-list li:last-child { border-bottom: 0; }

.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 130px minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__track { height: 14px; background: var(--gris-bg); border-radius: 7px; display: flex; overflow: hidden; }
.bar__fill { height: 100%; background: var(--acento); transition: width .5s ease; }
.bar__fill--soft { background: var(--acento-borde); }
.bar__fill--warn { background: #DC2626; border-radius: 0 7px 7px 0; }
.bar__val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.noshow { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 20px; align-items: center; }
.noshow__big .kpi__value { font-size: 40px; color: var(--rojo); }

/* modal */
.has-modal { overflow: hidden; }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
.modal__card { background: var(--superficie); border-radius: 18px; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 20px; box-shadow: var(--sombra-lg); display: grid; gap: 14px; }
.modal__card--sm { width: min(400px, 100%); }
.modal__card h3 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal__card > .badge { justify-self: start; margin-top: -6px; }
.summary--modal { margin: 0; }
.summary--modal .span-2 { flex-direction: column; gap: 2px; }
.summary--modal .span-2 dd { text-align: left; font-weight: 500; }
.modal__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* avisos */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--texto); color: #fff; border-radius: 14px; padding: 12px 12px 12px 16px; box-shadow: var(--sombra-lg); animation: slide-in .3s ease; }
.toast { background: var(--toast); }
.toast--accent { background: #115E59; }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: .25s; }
.toast__text { flex: 1; min-width: 0; }
.toast__title { font-weight: 800; font-size: 14px; }
.toast__body { font-size: 13px; color: #D9F2EF; }
.toast--neutral .toast__body { color: #CBD5E1; }
.toast__action { border: 0; background: #fff; color: #115E59; font-weight: 800; font-size: 13px; border-radius: 9px; padding: 8px 12px; min-height: 38px; white-space: nowrap; }
.toast__close { border: 0; background: none; color: #fff; opacity: .7; font-size: 22px; width: 32px; height: 32px; border-radius: 8px; line-height: 1; }
@keyframes slide-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- panel estrecho (contenedor) ---------- */
@container (max-width: 820px) {
  .papp__shell { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .papp__side { min-width: 0; }
  .papp__side { border-right: 0; border-bottom: 1px solid var(--borde); padding: 12px; gap: 10px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .papp__brand { flex: 1; }
  .papp__reset { margin-top: 0; order: 2; padding: 8px 10px; min-height: 40px; }
  .papp__nav { order: 3; width: 100%; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 2px; scrollbar-width: thin; }
  .papp__nav button { width: auto; white-space: nowrap; flex: none; padding: 8px 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@container (max-width: 600px) {
  .papp__top, .papp__content { padding-left: 14px; padding-right: 14px; }
  .papp__nav .ico { display: none; }
  .kpi { padding: 12px; }
  .kpi__value { font-size: 21px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 14px; border-bottom: 1px solid var(--borde); }
  .table td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  .table td[data-label]::before { content: attr(data-label); color: var(--texto-2); font-size: 12.5px; font-weight: 600; flex: none; }
  .table td:first-child { display: block; }
  .table td:first-child::before { display: none; }
  .table--edit td:first-child { display: block; }
  .table--edit td > input, .table--edit td > select, .table--edit .money-input { max-width: 60%; }
  .table--edit td:first-child > input { max-width: 100%; }
  .td-actions { text-align: left; padding-top: 8px !important; }
  .block-form { grid-template-columns: 1fr 1fr; }
  .block-form .field:first-child, .block-form .field--grow, .block-form .btn { grid-column: 1 / -1; }
  .bar { grid-template-columns: 96px minmax(0, 1fr) 60px; font-size: 13px; }
  .noshow { grid-template-columns: 1fr; gap: 10px; }
  .modal__actions { grid-template-columns: 1fr; }
  .cal { min-width: calc(48px + var(--cols) * 128px); }
  .cal__header, .cal__body { grid-template-columns: 48px repeat(var(--cols), minmax(128px, 1fr)); }
  .datenav__label { width: 100%; margin: 4px 0 0; }
}

/* ---------- pantallas medianas y celular ---------- */
@media (max-width: 1180px) and (min-width: 1024px) {
  .stage { grid-template-columns: 370px minmax(0, 1fr); gap: 20px; }
  .phone { width: 370px; }
}
@media (max-width: 1023px) {
  .intro { padding: 20px 16px 4px; }
  .intro p { font-size: 15px; }
  .theme-btn__txt { display: none; }
  .theme-btn { padding: 8px 11px; }
  .view-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; position: sticky; top: 0; z-index: 30; background: var(--fondo); padding: 10px 16px; border-bottom: 1px solid var(--borde); }
  .view-tabs button { border: 1.5px solid var(--borde-2); background: var(--superficie); border-radius: 12px; min-height: 50px; font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--texto-2); }
  .view-tabs button[aria-selected="true"] { background: var(--acento); border-color: var(--acento); color: #fff; }
  .tab-badge { background: #B91C1C; color: #fff; font-size: 12px; min-width: 22px; height: 22px; border-radius: 11px; display: inline-grid; place-items: center; padding: 0 6px; }
  .tab-badge[hidden] { display: none; }
  .stage { display: block; padding: 14px 16px 24px; }
  .stage__label { display: none; }
  .stage__cliente { position: static; }
  body[data-view="cliente"] .stage__panel, body[data-view="panel"] .stage__cliente { display: none; }
  .phone { width: 100%; max-width: 480px; margin: 0 auto; height: auto; min-height: 0; background: none; padding: 0; box-shadow: none; border-radius: 0; }
  .phone__screen { border-radius: 18px; border: 1px solid var(--borde); box-shadow: var(--sombra); overflow: visible; }
  .phone__status { display: none; }
  .capp__head { padding-top: 14px; }
  .capp__body { overflow: visible; }
  .capp__nav { position: sticky; bottom: 0; border-radius: 0 0 18px 18px; z-index: 10; }
  .capp__sticky { bottom: 64px; margin-bottom: 0; }
  .papp { border-radius: 16px; }
  .cal-wrap { max-height: 70vh; }
  .toasts { left: 16px; right: 16px; bottom: 16px; width: auto; }
}
@media (max-width: 400px) {
  .slot-grid { grid-template-columns: repeat(3, 1fr); }
  .capp__body { padding-left: 16px; padding-right: 16px; }
  .day-scroll { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .demo-bar { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.cal__appt.is-short .cal__appt-time::after { content: none; }
.cal__appt.is-short .cal__appt-top { flex: none; }
:root[data-theme="dark"] .phone { box-shadow: 0 0 0 1px var(--borde-2), var(--sombra-lg); }
