/* EXOCREATOR Studio · lado del coach. Paleta v1 aprobada (rojo, negro, blanco, grises, naranja solo para dolor y avisos).
   Fuentes: las mismas de la app (Archivo e Inter, servidas desde /app/fonts). */
@font-face { font-family: "Archivo"; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(/app/fonts/archivo-latin-wdth-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url(/app/fonts/inter-latin-wght-normal.woff2) format("woff2"); }

:root { color-scheme: dark; }
/* Tema claro: lo elige el coach con el botón de arriba (se guarda en este navegador); sin elegir, sigue al sistema. */
:root[data-theme="light"] {
  color-scheme: light;
  --red-ink: #D90101; --red-tint: rgba(255,1,1,.08); --orange: #C24E00; --orange-tint: rgba(255,106,0,.14);
  --bg: #F3F3F3; --s-1: #FFFFFF; --s-2: #F1F1F1; --s-3: #E7E7E7; --line: #DCDCDC; --gray: #CFCFCF;
  --text: #0A0A0A; --text-2: #3E3E3E; --text-3: #6A6A6A;
  --on-text: #FFFFFF; --top-bg: rgba(243,243,243,.86); --shadow: 0 24px 60px rgba(0,0,0,.22);
}
:root {
  --red: #FF0101; --red-ink: #FF4D4D; --red-tint: rgba(255,1,1,.14); --orange: #FF6A00; --orange-tint: rgba(255,106,0,.16);
  --bg: #0A0A0A; --s-1: #131313; --s-2: #1B1B1B; --s-3: #262626; --line: #2C2C2C; --gray: #3E3E3E;
  --text: #FFFFFF; --text-2: #C9C9C9; --text-3: #9A9A9A; --ok: #FFFFFF;
  --on-text: #000000; --top-bg: rgba(10,10,10,.86); --shadow: 0 30px 80px rgba(0,0,0,.7);
  --r: 14px; --display: "Archivo", system-ui, sans-serif; --body: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.lay { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--s-1); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.logo { font: 800 19px/1 var(--display); font-stretch: 112%; letter-spacing: .02em; padding: 4px 10px 2px; }
.logo b { color: var(--red); }
.logo-sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 0 10px 18px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; color: var(--text-2); font-weight: 500; width: 100%; }
.nav:hover { background: var(--s-2); color: var(--text); }
.nav.is-on { background: var(--s-3); color: var(--text); }
.nav .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.side-foot { margin-top: auto; font-size: 12px; color: var(--text-3); padding: 10px; line-height: 1.45; }

.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 32px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--top-bg); backdrop-filter: blur(14px); z-index: 5; }
.tenant { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mono { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--red); display: grid; place-items: center; font: 800 13px/1 var(--display); background-size: cover; background-position: center; flex: none; }
.badge { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 5px 9px; border-radius: 99px; background: var(--s-3); color: var(--text-2); }
.badge.is-demo { background: var(--orange-tint); color: var(--orange); }
.top .sp { flex: 1; }
.tema { width: 32px; height: 32px; border-radius: 50%; background: var(--s-2); display: grid; place-items: center; color: var(--text-2); }
.tema:hover { background: var(--s-3); color: var(--text); }
.seg { display: inline-flex; background: var(--s-2); border-radius: 99px; padding: 3px; }
.seg button { padding: 5px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.seg button.is-on { background: var(--text); color: var(--on-text); }

.page { padding: 30px 32px 80px; max-width: 1180px; }
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--red-ink); font-weight: 700; }
.h1 { font: 800 34px/1.05 var(--display); font-stretch: 108%; letter-spacing: -.01em; margin: 6px 0 8px; text-wrap: balance; }
.lead { color: var(--text-2); max-width: 64ch; margin-bottom: 26px; }
.h2 { font: 700 13px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin: 30px 0 12px; }

.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g2 { grid-template-columns: 1fr 1fr; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.card { background: var(--s-1); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.tile .k { font-size: 12px; color: var(--text-3); }
.tile .v { font: 800 34px/1.1 var(--display); font-variant-numeric: tabular-nums; margin-top: 4px; }
.tile .v small { font: 500 14px var(--body); color: var(--text-3); }
.tile .n { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.tile.is-hot { border-color: var(--red); background: linear-gradient(160deg, var(--red-tint), transparent 70%), var(--s-1); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 99px; font-weight: 600; background: var(--s-3); color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--gray); }
.btn.is-red { background: var(--red); color: #fff; } .btn.is-red:hover { background: #D90101; }
.btn.is-sm { padding: 6px 12px; font-size: 13px; }
.btn.is-ghost { background: none; border: 1px solid var(--line); }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--s-3); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.is-ok { color: var(--text); } .pill.is-dolor { color: var(--orange); background: var(--orange-tint); }
.pill.is-riesgo { color: var(--red-ink); background: var(--red-tint); } .pill.is-inactivo { color: var(--text-3); } .pill.is-nuevo { color: var(--text-2); }

/* Formularios */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .field .lb { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field input, .field select, .field textarea { background: var(--s-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--text-3); outline: none; }
.field .hint { font-size: 12px; color: var(--text-3); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick { display: grid; gap: 8px; }
.pick button { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--s-2); color: var(--text-2); }
.pick button::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--gray); flex: none; }
.pick button.is-on { border-color: var(--red); color: var(--text); background: var(--red-tint); }
.pick button.is-on::before { border-color: var(--red); background: var(--red); box-shadow: inset 0 0 0 3px var(--s-1); }

/* Atención y tablas */
.queue { display: grid; gap: 10px; }
.q-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--s-1); border: 1px solid var(--line); border-radius: var(--r); }
.q-item b { font-weight: 600; } .q-item p { font-size: 13px; color: var(--text-2); }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--s-3); display: grid; place-items: center; font: 700 13px var(--display); flex: none; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; vertical-align: middle; }
tr.is-link { cursor: pointer; } tr.is-link:hover td { background: var(--s-1); }
.who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.bar { height: 6px; border-radius: 99px; background: var(--s-3); overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.muted { color: var(--text-3); } .small { font-size: 12.5px; }
.days { display: inline-flex; gap: 4px; }
.days i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--gray); }
.days i.is-done { background: var(--red); border-color: var(--red); } .days i.is-miss { border-color: var(--text-3); border-style: dashed; }

/* Panel lateral y ventanas */
.veil { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--s-1); border-left: 1px solid var(--line); z-index: 21; overflow: auto; padding: 24px; }
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; }
.modal .veil { z-index: 0; }
.modal .box { background: var(--s-1); border: 1px solid var(--line); border-radius: 20px; padding: 22px; width: min(520px, 100%); position: relative; z-index: 1; max-height: 94vh; overflow: auto; }
.modal .box.is-phone { width: auto; background: none; border: 0; padding: 0; }
.x { float: right; width: 34px; height: 34px; border-radius: 50%; background: var(--s-3); display: grid; place-items: center; font-size: 18px; }
.cells { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; margin: 6px 0 14px; }
.cells i { aspect-ratio: 1; border-radius: 3px; background: var(--s-3); }
.cells i.c { background: var(--text); } :root[data-theme="light"] .cells i { background: var(--s-3); } .cells i.p { background: var(--text-3); } .cells i.d { background: var(--orange); }
.list { display: grid; gap: 8px; }
.li { padding: 10px 12px; background: var(--s-2); border-radius: 10px; font-size: 13.5px; }
.li small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.draft { background: var(--s-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; width: 100%; min-height: 110px; resize: vertical; margin: 12px 0; }

/* Método */
.wk { position: relative; aspect-ratio: 4/5; border-radius: var(--r); overflow: hidden; background: var(--s-2) center/cover; border: 2px solid transparent; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; color: #fff; }
.wk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(0,0,0,.88)); }
.wk > * { position: relative; z-index: 1; }
.wk.is-on { border-color: var(--red); }
.wk .n { font: 800 11px var(--display); letter-spacing: .14em; color: #FF4D4D; }
.wk .t { font: 800 16px/1.1 var(--display); text-transform: uppercase; }
.wk .m { font-size: 11.5px; color: #D0D0D0; }
.g6 { grid-template-columns: repeat(6, 1fr); }
.ex { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
.ex img { width: 96px; height: 54px; object-fit: cover; border-radius: 8px; background: var(--s-2); }
.ex b { font-weight: 600; } .ex p { font-size: 12.5px; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ex .dose { font: 700 15px var(--display); text-align: right; white-space: nowrap; }
.tag { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--text-3); margin-left: 6px; }
.tag.is-cam { color: var(--red-ink); }

/* Teléfono */
.phone { width: 302px; height: 654px; border-radius: 44px; border: 9px solid #1d1d1d; background: #000; overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px #333; position: relative; flex: none; }
.phone iframe { width: 393px; height: 880px; border: 0; transform: scale(.7226); transform-origin: 0 0; background: #000; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.chip { padding: 7px 13px; border-radius: 99px; background: var(--s-2); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--text-2); }
.chip.is-on { background: var(--text); color: var(--on-text); border-color: var(--text); }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; } .sw.is-on { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--s-1); }
.sws { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sws input[type=color] { width: 34px; height: 34px; padding: 0; border-radius: 50%; overflow: hidden; border: 0; background: none; }

/* Alta */
.step { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; padding: 16px; background: var(--s-1); border: 1px solid var(--line); border-radius: var(--r); align-items: start; }
.step .num { width: 34px; height: 34px; border-radius: 50%; background: var(--s-3); display: grid; place-items: center; font: 800 14px var(--display); }
.step.is-listo .num { background: var(--red); color: #fff; } .step.is-recibido .num { background: var(--text); color: var(--on-text); }
.step p { font-size: 13px; color: var(--text-2); } .step p + p { color: var(--text-3); margin-top: 2px; }
.note { font-size: 12.5px; color: var(--text-3); margin-top: 14px; max-width: 70ch; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--on-text); padding: 10px 18px; border-radius: 99px; font-weight: 600; z-index: 50; font-size: 13.5px; }

.nav .tc, .solo-s { display: none; }
.split.is-app { grid-template-columns: minmax(0, 1fr) auto; }
.tenant > span:last-child { white-space: nowrap; }
.badge { white-space: nowrap; }
.nav svg { width: 18px; height: 18px; flex: none; color: var(--text-3); }
.nav.is-on svg { color: var(--red-ink); }

/* Tablet y ventanas angostas: las rejillas se apilan; el menú lateral se queda. */
@media (max-width: 980px) {
  .g4, .g3, .g6 { grid-template-columns: 1fr 1fr; } .split, .g2, .duo { grid-template-columns: 1fr; }
  .top { padding-left: 20px; padding-right: 20px; } .page { padding-left: 20px; padding-right: 20px; } .top .badge:not(.is-demo) { display: none; }
  .split.is-app { grid-template-columns: 1fr; justify-items: center; } .split.is-app > form { justify-self: stretch; }
}
/* Teléfono: el menú pasa a una barra abajo, como en una app. */
@media (max-width: 760px) {
  .lay { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; left: 0; right: 0; bottom: 0; height: auto; z-index: 10; flex-direction: row; gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: var(--top-bg); backdrop-filter: blur(14px); }
  .logo, .logo-sub, .side-foot { display: none; }
  .nav { flex: 1; flex-direction: column; gap: 3px; padding: 6px 0; font-size: 10.5px; min-width: 0; position: relative; }
  .nav.is-on { background: none; color: var(--text); } .nav .t { display: none; } .nav .tc { display: block; }
  .nav .dot { position: absolute; top: 4px; right: calc(50% - 16px); margin: 0; }
  .top { padding: 10px 14px calc(10px); padding-top: calc(10px + env(safe-area-inset-top)); gap: 8px; }
  .tenant { min-width: 0; flex: 1; } .tenant > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top .sp { display: none; } .solo-s { display: inline; }
  .page { padding: 20px 14px calc(96px + env(safe-area-inset-bottom)); }
  .h1 { font-size: 26px; } .lead { margin-bottom: 18px; }
  .g4, .g3 { grid-template-columns: 1fr 1fr; gap: 10px; } .g6 { grid-template-columns: 1fr 1fr; gap: 10px; } .wk { aspect-ratio: 5/4; }
  .tile .v { font-size: 26px; } .card { padding: 14px; }
  .hide-s { display: none; }
  .q-item { grid-template-columns: auto 1fr; } .q-item .row-btns { grid-column: 1 / -1; } .q-item .row-btns .btn { flex: 1; justify-content: center; }
  th, td { padding: 10px 8px; } .bar { min-width: 56px; }
  .ex { grid-template-columns: 72px 1fr; } .ex img { width: 72px; height: 44px; } .ex .dose { grid-column: 2; text-align: left; }
  .step { grid-template-columns: 34px 1fr; } .step > .btn { grid-column: 2; justify-self: start; }
  .drawer { width: 100vw; padding: 18px 14px calc(24px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: no-preference) { .drawer { animation: in .22s ease-out; } @keyframes in { from { transform: translateX(24px); opacity: 0; } } }
