:root {
  --bg: #0b0b0b; --surface: #141414; --surface-2: #1b1b1b;
  --line: rgba(255,255,255,.09); --line-strong: rgba(255,255,255,.18);
  --text: #f3efe7; --muted: #9b958a;
  --gold: #c9a35a; --gold-light: #e7cc8f;
  --gold-grad: linear-gradient(135deg, #f0d79d 0%, #c9a35a 45%, #9c7a3a 100%);
  --ok: #6fcf8e; --warn: #e9a95b; --danger: #e2675c; --info: #7fb3e8; --wa: #25d366;
  --display: 'Rye', Georgia, serif; --cond: 'Oswald', 'Arial Narrow', sans-serif; --body: 'Manrope', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--gold-light); }
h1, h2, h3 { margin: 0; font-weight: 400; }
img { max-width: 100%; display: block; }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .capital::first-letter { text-transform: uppercase; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .up { color: var(--ok); } .down { color: var(--danger); }
.label { font-family: var(--cond); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.label--gold { color: var(--gold); }

/* Layout */
.side { position: fixed; z-index: 30; }
.side__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.side__brand img { width: 36px; height: 36px; }
.side__brand span { font-family: var(--display); font-size: 19px; }
.side__nav a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--muted); font-weight: 600; }
.side__nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side__nav a.is-active { color: var(--gold-light); }
.side__user { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.side__user span { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; }
.side__user small { color: var(--muted); font-weight: 500; font-size: 12px; }
.main { padding: 16px; max-width: 1080px; margin: 0 auto; }

@media (max-width: 899px) {
  .side { inset: 0 0 auto 0; }
  .side__brand { position: fixed; top: 0; left: 0; right: 0; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; background: rgba(11,11,11,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .side__user { position: fixed; top: env(safe-area-inset-top); right: 12px; height: 56px; }
  .side__user span { display: none; }
  .side__nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; overflow-x: auto; scrollbar-width: none; background: rgba(16,16,16,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .side__nav::-webkit-scrollbar { display: none; }
  .side__nav a { flex: 1 1 0; min-width: 58px; flex-direction: column; gap: 3px; padding: 9px 2px 8px; font-size: 10.5px; white-space: nowrap; }
  .main { padding-top: calc(72px + env(safe-area-inset-top)); padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (min-width: 900px) {
  .side { top: 0; bottom: 0; left: 0; width: 230px; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; }
  .side__nav { display: grid; gap: 2px; }
  .side__nav a { padding: 10px 12px; border-radius: 10px; }
  .side__nav a:hover { background: var(--surface-2); color: var(--text); }
  .side__nav a.is-active { background: rgba(201,163,90,.12); }
  .side__user { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
  body:has(.side) .main { margin-left: 230px; padding: 28px 32px 48px; }
}

/* Página */
.ptitle { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }
.ptitle h1 { font-family: var(--display); font-size: 28px; line-height: 1.15; }
.ptitle__act { display: flex; gap: 8px; align-items: center; }
.flash { position: fixed; z-index: 60; top: calc(64px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(92vw, 460px); padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.5); transition: opacity .4s, transform .4s; }
.flash--ok { background: #16271c; border: 1px solid rgba(111,207,142,.4); color: #b5ecc6; }
.flash--error { background: #2a1513; border: 1px solid rgba(226,103,92,.45); color: #f6b8b0; }
.flash.is-hide { opacity: 0; transform: translate(-50%, -10px); pointer-events: none; }
.notice { display: block; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; background: rgba(201,163,90,.09); border: 1px solid rgba(201,163,90,.35); color: var(--text); text-decoration: none; font-size: 14px; }
.notice--wa { background: rgba(37,211,102,.1); border-color: rgba(37,211,102,.4); color: #9ff0bf; font-weight: 600; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font-family: var(--cond); font-weight: 500; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; padding: 13px 22px; border-radius: 999px; text-decoration: none; }
.btn--gold { background: var(--gold-grad); color: #141006; box-shadow: 0 8px 24px -10px rgba(201,163,90,.6); }
.btn--line { background: transparent; color: var(--gold-light); border: 1px solid rgba(201,163,90,.5); }
.btn--sm { padding: 9px 16px; font-size: 12px; }
.btn--block { width: 100%; }
.ghost-btn { background: transparent; color: var(--text); border: 1px solid var(--line-strong); border-radius: 99px; padding: 7px 13px; font: 600 13px var(--body); text-decoration: none; cursor: pointer; }
.icon-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); text-decoration: none; font-size: 24px; line-height: 1; }
.chip-btn { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 10px; font: 600 13px var(--body); text-decoration: none; cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); white-space: nowrap; }
.chip-btn--ok { background: rgba(111,207,142,.14); border-color: rgba(111,207,142,.45); color: var(--ok); }
.chip-btn--wa { background: rgba(37,211,102,.12); border-color: rgba(37,211,102,.4); color: #7ee3a5; }
.chip-btn--danger { color: var(--danger); border-color: rgba(226,103,92,.4); background: transparent; }
.chip-btn.is-current { background: var(--gold-grad); color: #141006; border-color: transparent; opacity: 1; }
.chip-btn:disabled { cursor: default; }
.link-btn { display: block; text-align: center; margin-top: 16px; color: var(--muted); font-size: 14px; }

/* Tarjetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.card__head h2 { font-family: var(--cond); font-weight: 500; text-transform: uppercase; letter-spacing: .12em; font-size: 15px; }
.card__head a { font-size: 13px; text-decoration: none; }
.grid2 { display: grid; gap: 0 14px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.empty { color: var(--muted); text-align: center; padding: 18px 0; margin: 0; }
.empty-state { text-align: center; display: grid; gap: 10px; justify-items: center; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0 14px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
.kpis--3 { grid-template-columns: repeat(3, 1fr); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--text); min-width: 0; }
.kpi strong { font: 500 26px var(--cond); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi--gold { background: radial-gradient(120% 140% at 100% 0%, rgba(201,163,90,.18), transparent 60%), var(--surface); border-color: rgba(201,163,90,.4); }
.kpi--gold strong { color: var(--gold-light); font-size: 34px; }

.mini { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); }
.card__head + .mini, .card__head + .empty + .mini { border-top: 0; }
.mini__time { flex: none; width: 64px; font: 500 14px var(--cond); color: var(--gold-light); line-height: 1.2; }
.mini__body { flex: 1; min-width: 0; display: flex; flex-direction: column; text-decoration: none; color: var(--text); }
.mini__body b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini__body small { color: var(--muted); font-size: 13px; }
.mini form { margin: 0; }

.badge { flex: none; font: 700 10.5px var(--body); letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 99px; white-space: nowrap; }
.badge--pendiente { background: rgba(233,169,91,.14); color: var(--warn); }
.badge--confirmada { background: rgba(127,179,232,.14); color: var(--info); }
.badge--completada { background: rgba(111,207,142,.14); color: var(--ok); }
.badge--cancelada { background: rgba(255,255,255,.06); color: var(--muted); }
.badge--no_asistio { background: rgba(226,103,92,.14); color: var(--danger); }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 6px; }
.bars__col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bars__col span { width: 100%; background: rgba(201,163,90,.55); border-radius: 3px 3px 0 0; }
.bars__col.is-today span { background: var(--gold-grad); }
.bars__col.is-future span { background: rgba(127,179,232,.4); }
.bars__axis { position: relative; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; height: 18px; }
.bars__axis .is-today { position: absolute; transform: translateX(-50%); color: var(--gold-light); }
.hbar { margin: 8px 0 12px; }
.hbar__lbl { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 5px; }
.hbar__lbl b { font-weight: 600; color: var(--muted); font-size: 13px; }
.hbar__track { height: 8px; background: rgba(255,255,255,.06); border-radius: 99px; overflow: hidden; }
.hbar__track span { display: block; height: 100%; background: var(--gold-grad); border-radius: 99px; }

/* Agenda */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.datenav { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 260px; }
.datenav__label { position: relative; flex: 1; text-align: center; font-weight: 700; padding: 9px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong); cursor: pointer; }
.datenav__label input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 3px; }
.seg a { padding: 7px 14px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg a.is-active { background: var(--gold-grad); color: #141006; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 4px; scrollbar-width: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13px; }
.chip.is-active { border-color: var(--gold); color: var(--gold-light); background: rgba(201,163,90,.1); }
.dayhead { font-family: var(--cond); font-weight: 500; letter-spacing: .08em; font-size: 15px; color: var(--gold-light); margin: 18px 0 8px; }
.timeline { display: grid; gap: 8px; }
.appt { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); }
.appt--pendiente { border-left-color: var(--warn); }
.appt--confirmada { border-left-color: var(--info); }
.appt--completada { border-left-color: var(--ok); opacity: .8; }
.appt--no_asistio { border-left-color: var(--danger); opacity: .7; }
.appt--cancelada { opacity: .45; }
.appt--block { background: repeating-linear-gradient(45deg, #161616 0 8px, #121212 8px 16px); border-left-color: var(--muted); }
.appt__time { flex: none; width: 62px; font: 500 15px var(--cond); color: var(--gold-light); display: flex; flex-direction: column; line-height: 1.25; }
.appt__time small { color: var(--muted); font-size: 12px; }
.appt__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.appt__body > small { color: var(--muted); font-size: 13px; }
.appt__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.appt__top a { color: var(--text); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt__note { font-style: italic; }
.appt__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.appt__actions form { margin: 0; }

/* Detalle cita */
.detail div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.detail div:last-child { border-bottom: 0; }
.detail span { color: var(--muted); flex: none; }
.detail b { text-align: right; font-weight: 600; }
.detail a { text-decoration: none; }
.estado-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.wa-row { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.wa-row div { display: flex; flex-wrap: wrap; gap: 6px; }

/* Formularios */
.form { display: block; }
.field { display: block; margin-bottom: 12px; min-width: 0; }
.field > span { display: block; font-family: var(--cond); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.field small { text-transform: none; letter-spacing: 0; }
.field input, .field select, .field textarea, .search input, .search select, .inline-form input, .hday input[type="time"] {
  width: 100%; padding: 12px 14px; background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; font: 500 16px var(--body); color-scheme: dark; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,163,90,.18); }
.row2 { display: grid; gap: 0 10px; grid-template-columns: 1fr 1fr; }
.row3 { display: grid; gap: 0 10px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 420px) { .row3 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.check--field { align-self: end; margin-bottom: 22px; }
.form-error { background: rgba(226,103,92,.1); border: 1px solid rgba(226,103,92,.35); color: #f2a59d; padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 0 0 12px; }
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search select { width: auto; }
.inline-form { display: flex; gap: 8px; }
.codebox { display: block; padding: 10px 12px; word-break: break-all; font-size: 13px; }

.horario .hday { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.hday__name { width: 120px; display: flex; align-items: center; gap: 8px; font-weight: 600; padding-top: 10px; }
.hday__name input { width: 18px; height: 18px; accent-color: var(--gold); }
.hday__times { flex: 1; min-width: 220px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; color: var(--muted); }
.hday__times details { grid-column: 1 / -1; }
.hday__times details[open] { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.hday__times summary { cursor: pointer; font-size: 13px; color: var(--gold-light); grid-column: 1 / -1; list-style: none; }
.hday:has(input[type=checkbox]:not(:checked)) .hday__times { opacity: .35; pointer-events: none; }

/* Listas */
.list { display: grid; gap: 8px; margin-bottom: 14px; }
.row-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.row-card.is-off { opacity: .5; }
.row-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-card__body small { color: var(--muted); font-size: 13px; }
.row-card__side { display: flex; flex-direction: column; align-items: flex-end; }
.row-card__side b { font: 500 20px var(--cond); color: var(--gold-light); }
.row-card__side small { color: var(--muted); font-size: 11px; }
.avatar-sm, .avatar-lg { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); border: 1px solid rgba(201,163,90,.4); color: var(--gold); font: 400 16px var(--display); }
.avatar-lg { width: 72px; height: 72px; font-size: 26px; }
.avatar-sm img, .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.photo-row { display: flex; gap: 14px; align-items: center; }
.photo-row .field { flex: 1; }
.acc summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.acc summary span { display: flex; flex-direction: column; }
.acc summary small { color: var(--muted); }
.acc summary strong { font: 500 20px var(--cond); color: var(--gold-light); }
.acc[open] summary { margin-bottom: 14px; }
.acc.is-off { opacity: .55; }

/* Login */
.login { max-width: 380px; margin: 8vh auto 0; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 30px 22px; }
.login__logo { width: 112px; height: 112px; margin: 0 auto 12px; }
.login h1 { font-family: var(--display); font-size: 32px; margin: 4px 0 20px; }
.login .field { text-align: left; }

.svc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.svc-row .check { margin: 0; }
.svc-row__dur { display: flex; align-items: center; gap: 8px; color: var(--muted); flex: none; }
.svc-row__dur input { width: 84px; padding: 10px 12px; background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; font: 600 16px var(--body); text-align: center; }
