/* DEXA Vet · estilos de la aplicación
   Marca DEXA: azul de acento, navy #060A1C para la estructura (como dexa.com.do), base blanca y gris claro.
   Estilo limpio tipo Apple: tipografía del sistema, esquinas suaves, vidrio esmerilado y transiciones con resorte.
   Layout: barra lateral navy + área de trabajo clara; en móvil, barra de pestañas inferior. */
:root {
  --blue: #3454D1; --blue-600: #2A44AE; --blue-2: #8EA6FF; --blue-soft: #EEF2FF; --blue-line: #D9E0FF;
  --ink: #0B1020; --ink-2: #3A4152; --muted: #6E7385; --line: #E6E8EE; --line-2: #F0F1F5;
  --bg: #F5F5F7; --surface: #FFFFFF; --hover: #FAFAFC;
  --ok: #138A5A; --ok-soft: #E5F6EE; --warn: #A15F00; --warn-soft: #FFF3DD;
  --bad: #D0342C; --bad-soft: #FDECEB; --violet: #6B45C6; --violet-soft: #F2EDFD;
  --side: #060A1C; --side-ink: #B9C0D4;
  --f-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --f-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --f-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --r: 18px; --r-sm: 12px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --shadow: 0 1px 1px rgba(6, 10, 28, .03), 0 6px 22px rgba(6, 10, 28, .05);
  --shadow-hover: 0 2px 4px rgba(6, 10, 28, .04), 0 14px 34px rgba(6, 10, 28, .09);
  --shadow-lg: 0 30px 80px rgba(6, 10, 28, .28);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 var(--f-body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 30px; font-weight: 700; line-height: 1.12; letter-spacing: -.025em; }
h2 { font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p { margin: 0; }
a { color: var(--blue); }
hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
[hidden] { display: none !important; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.cap::first-letter { text-transform: uppercase; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.wrap { white-space: normal !important; }
.t-ok { color: var(--ok); } .t-warn { color: var(--warn); } .t-bad { color: var(--bad); } .t-violet { color: var(--violet); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.i { display: inline-flex; width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.i svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.nowrap, .nowrap { flex-wrap: nowrap; white-space: nowrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.self-end { align-self: end; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.form-gap { display: flex; flex-direction: column; gap: 14px; }
.pad-x { padding: 0 16px 12px; } .pad-y { padding: 10px 0; }
.block { width: 100%; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100%; }
.side { background: radial-gradient(120% 60% at 0% 0%, rgba(52, 84, 209, .28), transparent 60%), var(--side); color: var(--side-ink); display: flex; flex-direction: column; gap: 18px; padding: 22px 12px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 2px 10px; }
.brand-mark { width: 30px; height: 30px; color: var(--blue); flex: none; }
.brand-text { font-family: var(--f-display); font-size: 18px; font-weight: 500; }
.brand-text b { font-weight: 700; letter-spacing: .06em; }
.nav { display: flex; flex-direction: column; gap: 14px; }
.nav-g { display: flex; flex-direction: column; gap: 1px; }
.nav-gl { font: 600 10.5px var(--f-body); text-transform: uppercase; letter-spacing: .12em; color: #6B7391; padding: 0 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 10px; color: var(--side-ink); text-decoration: none; font-weight: 500; transition: background .25s var(--ease), color .2s; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.nav a.on .i { color: var(--blue-2); }
.badge { margin-left: auto; background: var(--blue); color: #fff; font: 600 11px var(--f-body); padding: 1px 7px; border-radius: 99px; min-width: 20px; text-align: center; }
.badge.warn { background: #D98A12; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.clinic-chip { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .05); }
.clinic-name { color: #fff; font-weight: 600; font-size: 13px; }
.clinic-plan { font-size: 11.5px; color: #8E95A5; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; text-align: left; color: var(--side-ink); }
.me:hover { background: rgba(255, 255, 255, .06); }
.me-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-t b { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-t small { color: #8E95A5; font-size: 11.5px; }
.udot { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--c); color: #fff; font: 600 13px var(--f-display); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 32px; background: rgba(245, 245, 247, .72); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid rgba(6, 10, 28, .06); }
.brand-sm { display: none; }
.brand-sm svg { width: 32px; height: 32px; display: block; }
.search-btn { flex: 1; max-width: 480px; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid transparent; border-radius: 999px; background: rgba(6, 10, 28, .055); color: var(--muted); cursor: pointer; text-align: left; min-width: 0; transition: background .2s, box-shadow .2s; }
.search-btn:hover { background: rgba(6, 10, 28, .08); }
.search-btn:hover { border-color: #C9CFD9; }
.search-ph { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font: 500 11px var(--f-mono); padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--bg); color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.timer { font: 600 13px var(--f-mono); color: var(--blue); background: var(--blue-soft); padding: 7px 12px; border-radius: 99px; display: inline-flex; align-items: center; gap: 7px; }
.timer .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.bell { position: relative; }
.bell-n { position: absolute; top: -3px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font: 600 10.5px/17px var(--f-mono); text-align: center; border: 2px solid var(--bg); box-sizing: content-box; }
#view { padding: 30px 32px 80px; outline: none; display: flex; flex-direction: column; gap: 20px; max-width: 1340px; width: 100%; }
#view.enter > * { animation: viewIn .55s var(--ease) backwards; }
#view.enter > *:nth-child(2) { animation-delay: .04s; } #view.enter > *:nth-child(3) { animation-delay: .08s; } #view.enter > *:nth-child(4) { animation-delay: .12s; } #view.enter > *:nth-child(n+5) { animation-delay: .16s; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
.tabbar { display: none; }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .2s var(--ease), border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.btn:hover { border-color: #CDD1DB; background: var(--hover); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(52, 84, 209, .25); }
.btn.primary:hover { background: var(--blue-600); border-color: var(--blue-600); box-shadow: 0 8px 20px rgba(52, 84, 209, .32); }
.btn.violet { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn.violet:hover { background: #5935AE; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(20, 22, 28, .05); }
.btn.danger { color: var(--bad); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; gap: 5px; }
.btn.sm .i { width: 15px; height: 15px; vertical-align: -3px; }
.btn.lg { padding: 12px 18px; font-size: 15px; }
.btn.wa { color: var(--ok); border-color: #BFE3D2; background: var(--ok-soft); }
.btn.wa:hover { background: #D8EFE4; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.count { background: rgba(20, 22, 28, .1); border-radius: 99px; padding: 0 7px; font: 600 11.5px var(--f-mono); }
.btn.primary .count, .btn.violet .count { background: rgba(255, 255, 255, .22); }
.icon-btn { background: none; border: 0; padding: 5px; border-radius: 7px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: rgba(20, 22, 28, .06); color: var(--ink); }
.icon-btn.lg { padding: 8px; }
.icon-btn.lg .i { width: 20px; height: 20px; }
.link { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.link.left { align-self: flex-start; font-size: 12.5px; }
.as-link { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.as-link:hover b { color: var(--blue); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .lbl { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: inline-flex; align-items: center; gap: 6px; }
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); outline: none; transition: border-color .2s, box-shadow .2s; min-width: 0; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(52, 84, 209, .14); }
.input.sm { padding: 6px 9px; font-size: 13px; }
.input.lg { padding: 12px 13px; font-size: 18px; }
.input.num { text-align: right; }
.w-120 { width: 120px; }
textarea.input { resize: vertical; min-height: 66px; line-height: 1.45; }
select.input[size] { padding: 4px; }
select.input[size] option { padding: 6px 8px; border-radius: 6px; }
.search-in { position: relative; flex: 1; max-width: 420px; min-width: 200px; }
.search-in .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-in .input { padding-left: 36px; }
.check-in { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; font-size: 13.5px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.check-in input { width: 16px; height: 16px; accent-color: var(--blue); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.seg { display: inline-flex; border: 0; border-radius: 11px; overflow: hidden; background: rgba(6, 10, 28, .06); flex-wrap: nowrap; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 8px; transition: background .25s var(--ease), color .2s, box-shadow .25s; }
.seg button + button { border-left: 0; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(6, 10, 28, .08), 0 2px 8px rgba(6, 10, 28, .06); }
.seg.full { display: flex; } .seg.full button { flex: 1; justify-content: center; }
.seg .i { width: 15px; height: 15px; }
.seg.dark { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); }
.seg.dark button { color: #C9CEDA; } .seg.dark button + button { border-color: rgba(255, 255, 255, .14); }
.seg.dark button.on { background: #fff; color: var(--ink); }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; }
.eyebrow { font: 600 12px var(--f-body); color: var(--blue); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.crumb a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 13px; }
.crumb a:hover { color: var(--blue); }
.crumb + .page-head, .crumb + .card { margin-top: -8px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid rgba(6, 10, 28, .05); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; transition: box-shadow .35s var(--ease), transform .35s var(--ease), border-color .2s; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line-2); }
.card-h.wrap { flex-wrap: wrap; }
.card-b { padding: 16px 18px; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
a.kpi:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.kpi .val { font: 700 30px/1.1 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 16px; color: var(--muted); font-weight: 500; }
.kpi .sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi.alert .val { color: var(--warn); }
.meter { flex: none; width: 56px; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; display: inline-block; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.meter.big { width: 100%; height: 6px; } .meter.big i { background: var(--ok); transition: width .3s; }
.shortcuts { display: grid; gap: 8px; }
.shortcuts .btn { justify-content: flex-start; }

.speed { background: radial-gradient(120% 90% at 100% 0%, rgba(52, 84, 209, .45), transparent 55%), #060A1C; color: #fff; border: 0; }
.speed .card-b { display: flex; flex-direction: column; gap: 14px; }
.speed .lbl { color: #9AA3B5; }
.speed-big { font: 700 48px/1 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.speed-big small { font: 500 13px var(--f-mono); color: #9AA3B5; margin-left: 8px; letter-spacing: 0; }
.speed-p { color: #C9CEDA; } .speed-save { color: #fff; }
.speed-bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 62px; gap: 10px; align-items: center; font-size: 12.5px; color: #C9CEDA; }
.bar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: #5E6577; }
.bar i.dexa { background: var(--blue-2); transition: width .6s; }
.bar-row .num { text-align: right; color: #fff; }
.speed-note { font-size: 11.5px; color: #8E95A5; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line-2); min-width: 0; }
.li:first-child { border-top: 0; }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.li-main b { font-weight: 600; }
.li-main b .i { width: 15px; height: 15px; color: var(--bad); vertical-align: -2px; }
.li-main .muted { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.hour { font: 600 13px var(--f-mono); color: var(--ink-2); width: 50px; flex: none; display: flex; flex-direction: column; line-height: 1.2; }
.hour small { font: 500 11px var(--f-body); color: var(--muted); }
.empty { padding: 30px 18px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty > .i { width: 28px; height: 28px; color: #C3C8D3; }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 600 14px var(--f-display); color: var(--blue); background: var(--blue-soft); overflow: hidden; }
.avatar.felino { color: #7A4DB8; background: #F3ECFB; }
.avatar.otro { color: #0E8A7A; background: #E3F5F2; }
.avatar.warn { color: var(--warn); background: var(--warn-soft); }
.avatar.bad { color: var(--bad); background: var(--bad-soft); }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 52px; height: 52px; font-size: 21px; }
.avatar.xl { width: 84px; height: 84px; font-size: 32px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; border: 2px solid var(--surface); }
.avatar.xs { width: 20px; height: 20px; font-size: 10px; }
.pets-mini { display: flex; align-items: center; }
.pets-mini .avatar + .avatar { margin-left: -8px; }
.pets-mini .muted { margin-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.violet { background: var(--violet-soft); color: var(--violet); }
.pill.plain::before { display: none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FBFCFD; }
td { padding: 10px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--hover); }
td.r, th.r { text-align: right; }
.who { display: flex; align-items: center; gap: 10px; }
.who > span:not(.avatar):not(.udot) { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stockbar { width: 70px; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; display: inline-block; flex: none; }
.stockbar i { display: block; height: 100%; background: var(--ok); }
.stockbar i.low { background: #D98A12; } .stockbar i.out { background: var(--bad); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 13px 10px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .2s, border-color .3s var(--ease); }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-color: var(--blue); }
.tabs.boxed { padding: 0; }
.tab-body { min-height: 120px; }
.tab-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 6px 13px; border-radius: 99px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: all .2s var(--ease); }
.chip:hover { border-color: var(--blue-2); color: var(--blue); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.sm { padding: 4px 10px; font-size: 12.5px; }

/* ---------- Agenda ---------- */
.week { display: flex; align-items: center; gap: 6px; }
.wd { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
.wd small { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.wd b { font: 600 18px var(--f-display); }
.wd span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.wd.today b { color: var(--blue); }
.wd { transition: all .25s var(--ease); border-radius: 14px; }
.wd.on { background: #060A1C; border-color: #060A1C; color: #fff; }
.wd.on small, .wd.on span { color: #C9CEDA; } .wd.on b { color: #fff; }
.ag-card { overflow: hidden; }
.ag-scroll { overflow-x: auto; }
.ag { min-width: calc(64px + var(--cols) * 220px); }
.ag-head { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(0, 1fr)); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.ag-vh { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-left: 1px solid var(--line-2); }
.ag-vh span { display: flex; flex-direction: column; line-height: 1.25; } .ag-vh small { color: var(--muted); font-size: 12px; }
.ag-body { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(0, 1fr)); position: relative; }
.ag-times span { display: block; font: 500 11.5px var(--f-mono); color: var(--muted); text-align: right; padding: 0 10px; transform: translateY(-7px); }
.ag-times span:first-child { transform: translateY(3px); }
.ag-col { position: relative; border-left: 1px solid var(--line-2); }
.ag-slot { display: block; width: 100%; height: var(--rowh); border: 0; border-top: 1px dashed var(--line-2); background: none; cursor: pointer; text-align: left; padding: 4px 8px; }
.ag-slot.hr { border-top: 1px solid var(--line); }
.ag-slot span { opacity: 0; font: 500 11.5px var(--f-mono); color: var(--blue); }
.ag-slot:hover { background: var(--blue-soft); } .ag-slot:hover span, .ag-slot:focus-visible span { opacity: 1; }
.ag-ev { position: absolute; left: 6px; right: 6px; border-radius: 8px; padding: 5px 9px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 1px; overflow: hidden; font-size: 12.5px; line-height: 1.3; border: 1px solid; border-left-width: 4px; box-shadow: 0 1px 2px rgba(20, 22, 28, .06); transition: transform .1s, box-shadow .1s; }
.ag-ev:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(20, 22, 28, .12); z-index: 1; }
.ag-ev b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.ag-ev .ag-st { font-size: 11px; font-weight: 600; margin-top: auto; }
.st-plain { background: #fff; border-color: #D5DAE2; color: var(--ink); }
.st-blue { background: var(--blue-soft); border-color: var(--blue-line); border-left-color: var(--blue); color: #213A9E; }
.st-warn { background: var(--warn-soft); border-color: #F5DDB2; border-left-color: #D98A12; color: #7A4900; }
.st-violet { background: var(--violet-soft); border-color: #DDD2F6; border-left-color: var(--violet); color: #4B2C96; }
.st-ok { background: var(--ok-soft); border-color: #C6E7D7; border-left-color: var(--ok); color: #0F5E3F; }
.st-bad { background: var(--bad-soft); border-color: #F2CACA; border-left-color: var(--bad); color: #8E2424; text-decoration: line-through; }
.ag-now { position: absolute; left: 64px; right: 0; height: 2px; background: var(--bad); z-index: 1; pointer-events: none; }
.ag-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.ag-now span { position: absolute; left: -60px; top: -9px; font: 600 11px var(--f-mono); color: var(--bad); background: var(--surface); padding: 0 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Sala de espera ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.kb-col { background: rgba(6, 10, 28, .045); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.kb-h { display: flex; justify-content: space-between; align-items: center; font-weight: 600; padding: 2px 4px 4px; }
.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-card { background: var(--surface); border-radius: 10px; padding: 10px; box-shadow: var(--shadow); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.kb-who { display: flex; gap: 10px; align-items: flex-start; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; min-width: 0; }
.kb-who b .i { width: 14px; height: 14px; color: var(--bad); vertical-align: -2px; }
.kb-act .btn { width: 100%; }
.kb-empty { color: #A3A9B5; text-align: center; padding: 18px 0; }
.wait { font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 2px 8px; border-radius: 99px; font-size: 12px; }

/* ---------- Paciente ---------- */
.pet-head { display: flex; gap: 18px; align-items: center; padding: 20px; flex-wrap: wrap; }
.pet-head.compact { padding: 16px; gap: 12px; }
.pet-head .meta { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 5px; }
.pet-head.compact .meta { min-width: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink-2); font-size: 13px; align-items: center; }
.facts b { font-weight: 600; color: var(--ink); }
.facts .i { width: 15px; height: 15px; }
.pet-actions { justify-content: flex-end; }
.photo-pick { position: relative; cursor: pointer; border-radius: 50%; }
.photo-cam { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; border: 3px solid var(--surface); }
.photo-cam .i { width: 13px; height: 13px; }
.photo-pick:hover .avatar { filter: brightness(.95); }
.pet-notes { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 16px; }
.allergy { display: flex; gap: 8px; align-items: center; background: var(--bad-soft); color: var(--bad); padding: 8px 12px; border-radius: var(--r-sm); font-weight: 600; font-size: 13px; }
.note { background: var(--warn-soft); color: #6B4400; padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; }
.ficha-res { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; padding: 18px; }
.mini { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--bg); }
.mini .i { width: 16px; height: 16px; }
.mini.t-bad { background: var(--bad-soft); } .mini.t-warn { background: var(--warn-soft); }
.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line-2); }
.tl:first-child { border-top: 0; }
.tl .when { font: 500 12px var(--f-mono); color: var(--muted); padding-top: 2px; }
.tl .what { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tl .what p { color: var(--ink-2); font-size: 13px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; padding: 16px 18px; }
.file { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; min-width: 0; }
.file img, .file-ic { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; background: var(--bg); display: grid; place-items: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; align-items: center; }
.kv > span:nth-child(odd) { color: var(--muted); }
.kv > :nth-child(even) { justify-self: end; }

/* ---------- Consulta ---------- */
.cx { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.cx-side { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 12px; }
.tips .card-b { padding: 12px 14px; }
.stepn { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-grid; place-items: center; font: 600 12px var(--f-mono); }
.soap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.soap label span { font-family: var(--f-mono); color: var(--blue); }
.vh { font-size: 12px; color: var(--muted); min-height: 18px; }
.add-row > select { flex: 1; min-width: 200px; }
.lines { display: flex; flex-direction: column; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto 112px 30px; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px dashed var(--line); }
.line:first-child { border-top: 0; }
.line.danger { background: linear-gradient(90deg, var(--bad-soft), transparent 70%); margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.line-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dose { font: 500 12px var(--f-mono); color: var(--blue); display: flex; gap: 5px; align-items: center; }
.dose .i, .line-warn .i { width: 14px; height: 14px; }
.line-warn { font-size: 12.5px; color: var(--warn); display: flex; gap: 5px; align-items: center; font-weight: 600; }
.line-warn.bad { color: var(--bad); }
.indic { max-width: 420px; }
.qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; }
.qty .num { min-width: 28px; text-align: center; font-weight: 600; }
.qty .icon-btn { padding: 4px; } .qty .i { width: 14px; height: 14px; }
.line-amt { text-align: right; }
.totals { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; padding-top: 12px; border-top: 1px solid var(--line); }
.totals > div { display: flex; justify-content: space-between; gap: 10px; }
.totals .grand { font: 600 21px var(--f-display); padding-top: 4px; }
.next-box { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 10px; align-items: end; padding-top: 4px; }
.ai-box { background: var(--blue-soft); border: 1px solid var(--blue-line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-h { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--blue); }
.ai-box textarea { background: #fff; min-height: 150px; font-size: 13px; }
.ai-box textarea.typing { border-color: var(--blue-2); }
.save-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; background: rgba(6, 10, 28, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: #fff; border-radius: 20px; box-shadow: 0 14px 40px rgba(20, 22, 28, .25); }
.save-bar .sum { display: flex; flex-direction: column; }
.save-bar .sum small { color: #9AA3B5; font-size: 12px; }
.save-bar .sum b { font: 600 21px var(--f-display); }
.save-opts { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; justify-content: flex-end; }

/* ---------- Caja ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.pos-cart { position: sticky; top: 78px; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.pos-it { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; min-height: 104px; transition: border-color .12s, transform .1s; }
.pos-it:hover { border-color: var(--blue-2); }
.pos-it b { font-weight: 600; font-size: 13.5px; line-height: 1.3; flex: 1; }
.pos-it.out { opacity: .5; cursor: not-allowed; }
.pos-it.pop { animation: pop2 .25s; }
@keyframes pop2 { 50% { transform: scale(.96); border-color: var(--blue); } }
.pos-cat-l { font: 600 10.5px var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cart-lines { display: flex; flex-direction: column; }
.cart-l .line-amt { white-space: nowrap; }
.cart-l { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--line); }
.cart-l:first-child { border-top: 0; }
.mini-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; max-height: 320px; overflow-y: auto; }
.mt-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 12px; border: 0; border-top: 1px solid var(--line-2); background: var(--surface); text-align: left; cursor: pointer; font-size: 13px; }
.mt-row:first-child { border-top: 0; }
.mt-row:hover { background: var(--hover); }
.mt-row.static { cursor: default; grid-template-columns: auto minmax(0, 1fr) auto; }
.mt-row.static:has(input) { grid-template-columns: minmax(0, 1fr) 90px; }
.mt-row .ellipsis { max-width: none; }
.debt { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--violet-soft); flex-wrap: wrap; }
.debt > div { display: flex; flex-direction: column; } .debt b { font-size: 20px; color: var(--violet); }
.close-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.close-grid > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg); }
.close-grid b { font-size: 18px; }
.close-grid .hl { background: var(--ink); color: #fff; } .close-grid .hl .lbl, .close-grid .hl .muted { color: #9AA3B5; }
.change { font-size: 15px; color: var(--ok); }
.invoice { font-size: 13px; display: flex; flex-direction: column; gap: 14px; }
.inv-h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inv-n { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.disp { font-family: var(--f-display); font-size: 16px; }
.inv-t th, .inv-t td { padding: 7px 0; background: none; }
.inv-t th + th, .inv-t td + td { padding-left: 12px; }
.legal { font-size: 11.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }

/* ---------- Reportes ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font: 500 11px var(--f-mono); fill: var(--muted); }
.chart .v { fill: var(--ink); font-weight: 600; }
.chart .grid { stroke: var(--line); }
.chart .area { fill: var(--blue); fill-opacity: .08; }
.chart .line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; }
.chart .pt { fill: var(--surface); stroke: var(--blue); stroke-width: 2; } .chart .pt.end { fill: var(--blue); }
.chart .bar { fill: #C9D3F6; } .chart .bar:hover { fill: var(--blue-2); } .chart .bar-on { fill: var(--blue); }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hb { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hb .ellipsis { max-width: 70%; }
.hb-bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.hb-bar i { display: block; height: 100%; border-radius: 99px; background: var(--blue); }

/* ---------- Ajustes ---------- */
.preview { display: flex; flex-direction: column; gap: 6px; }
.bubble { background: #DCF8C6; color: #111; padding: 10px 12px; border-radius: 10px 10px 10px 2px; max-width: 520px; font-size: 13.5px; white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.import-ok { display: flex; gap: 8px; align-items: center; color: var(--ok); }
.plan-card .card-b { gap: 16px; }
.disp-lg { font-size: 28px; }
.plan-price b { font: 600 30px var(--f-display); } .plan-price span { color: var(--muted); }

/* ---------- Ventanas ---------- */
#modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding: 7vh 16px 16px; overflow-y: auto; }
.backdrop { position: fixed; inset: 0; background: rgba(6, 10, 28, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.dialog { position: relative; width: 100%; max-width: 560px; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop .45s var(--ease); }
.dialog.wide { max-width: 760px; }
@keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.dialog-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 14px; }
.dialog-h h2 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.dialog-b { padding: 6px 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.dialog-f { padding: 14px 24px 18px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; align-items: center; }
.hint-ok { font-size: 12.5px; color: var(--ok); font-weight: 600; min-height: 18px; }
.wrap-btns .btn { flex: 1; }
.done-list { display: flex; flex-direction: column; gap: 10px; }
.done-list > div { display: flex; gap: 10px; align-items: flex-start; animation: rise .3s backwards; }
.done-list > div:nth-child(2) { animation-delay: .06s; } .done-list > div:nth-child(3) { animation-delay: .12s; } .done-list > div:nth-child(4) { animation-delay: .18s; } .done-list > div:nth-child(5) { animation-delay: .24s; } .done-list > div:nth-child(6) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.done-list .i { color: var(--ok); margin-top: 1px; }
.done-time { text-align: center; padding: 4px 0 2px; }
.done-time .num { font-size: 44px; font-weight: 600; color: var(--blue); line-height: 1; }
.palette .dialog-b { padding: 0; gap: 0; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pal-in input { border: 0; padding: 18px 0; font-size: 16px; flex: 1; outline: none; min-width: 0; background: none; }
.pal-list { max-height: 56vh; overflow-y: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.pal-item.on, .pal-item:hover { background: var(--blue-soft); }
.pal-item .avatar .i { width: 16px; height: 16px; }
.pal-group { font: 600 11px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px 4px; }
.menu { position: fixed; z-index: 150; min-width: 260px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .12s; }
.menu-h { font: 600 11px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 6px; }
.menu-it { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; text-decoration: none; color: var(--ink); font-size: 13.5px; }
.menu-it:hover, .menu-it.on { background: var(--bg); }
.menu-it .udot { width: 24px; height: 24px; font-size: 11px; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-empty { padding: 16px 12px; color: var(--muted); text-align: center; }
.ni { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--bg); }
.ni .i { width: 16px; height: 16px; }
.ni.bad { background: var(--bad-soft); color: var(--bad); } .ni.warn { background: var(--warn-soft); color: var(--warn); } .ni.violet { background: var(--violet-soft); color: var(--violet); } .ni.blue { background: var(--blue-soft); color: var(--blue); }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.more-it { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 10px; background: var(--bg); color: var(--ink); text-decoration: none; font-size: 12.5px; font-weight: 600; text-align: center; }
.more-it .i { width: 22px; height: 22px; color: var(--blue); }

.welcome { padding: 28px 24px 22px; display: flex; flex-direction: column; gap: 14px; text-align: center; align-items: center; }
.welcome-art { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, #3454D1, #060A1C); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 30px rgba(52, 84, 209, .35); }
.welcome-art .i { width: 32px; height: 32px; }
.welcome h2 { font-size: 22px; }
.welcome p { color: var(--muted); max-width: 420px; }
.welcome-roles { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 360px; text-align: left; }
.role { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; text-align: left; transition: all .25s var(--ease); }
.role > span:not(.udot) { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3; } .role small { color: var(--muted); }
.role.on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }

#tour { position: fixed; inset: 0; z-index: 300; animation: fade .3s var(--ease); }
#tour.closing { opacity: 0; transition: opacity .25s var(--ease); }
.tour-hole { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(6, 10, 28, .58), 0 0 0 3px rgba(142, 166, 255, .9); transition: top .55s var(--ease), left .55s var(--ease), width .55s var(--ease), height .55s var(--ease); pointer-events: none; }
.tour-hole::after { content: ""; position: absolute; inset: -3px; border-radius: 18px; box-shadow: 0 0 0 0 rgba(142, 166, 255, .6); animation: ring 1.8s var(--ease) infinite .6s; }
@keyframes ring { 70% { box-shadow: 0 0 0 14px rgba(142, 166, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(142, 166, 255, 0); } }
.tour-pop { position: fixed; background: var(--surface); border-radius: 22px; padding: 0 18px 16px; box-shadow: 0 30px 80px rgba(6, 10, 28, .4); display: flex; flex-direction: column; gap: 8px; overflow: hidden; animation: tourIn .5s var(--ease); }
@keyframes tourIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.tour-pop.sheet { left: 10px !important; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); top: auto !important; width: auto !important; animation-name: sheetIn; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(30px); } }
.tour-bar { height: 4px; margin: 0 -18px 6px; background: var(--line-2); } .tour-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3454D1, #8EA6FF); transition: width .6s var(--ease); }
.tour-top { display: flex; align-items: center; gap: 10px; }
.tour-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.tour-pop h3 { font: 700 19px/1.2 var(--f-display); text-transform: none; letter-spacing: -.02em; color: var(--ink); margin-top: 2px; }
.tour-pop p { color: var(--ink-2); font-size: 14px; }
.tour-n { flex: 1; font-size: 12px; color: var(--muted); font-weight: 600; }
.tour-f { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.tour-dots { display: flex; gap: 4px; } .tour-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--line); transition: all .4s var(--ease); } .tour-dots i.done { background: var(--blue-2); } .tour-dots i.on { width: 18px; background: var(--blue); }

#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: rgba(6, 10, 28, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #fff; padding: 12px 14px 12px 16px; border-radius: 16px; box-shadow: 0 10px 30px rgba(20, 22, 28, .25); display: flex; gap: 10px; align-items: center; animation: pop .18s ease-out; max-width: min(420px, calc(100vw - 32px)); transition: opacity .3s; }
.toast.out { opacity: 0; }
.toast .i { color: var(--blue-2); }
.toast-btn { background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 6px; padding: 5px 10px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.toast-btn:hover { background: rgba(255, 255, 255, .2); }

/* ---------- Impresión ---------- */
#print { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .app, .tabbar, #modal, #toasts, #tour { display: none !important; }
  #print { display: block !important; }
}
.doc { font: 12.5px/1.5 var(--f-body); color: #111; display: flex; flex-direction: column; gap: 14px; }
.doc-h { border-bottom: 2px solid #3454D1; padding-bottom: 10px; }
.doc-brand { display: flex; gap: 12px; align-items: center; }
.doc-brand div { display: flex; flex-direction: column; } .doc-brand b { font: 600 17px var(--f-display); } .doc-brand span { font-size: 11px; color: #555; }
.doc-t { font: 600 18px var(--f-display); }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
.doc-grid span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #777; }
.rx { font: 700 30px var(--f-display); color: #3454D1; }
.doc-list { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.doc-table { width: 100%; border-collapse: collapse; }
.doc-table th, .doc-table td { border-bottom: 1px solid #ddd; padding: 6px 8px; background: none; text-align: left; } .doc-table .r { text-align: right; }
.sign { margin-top: 40px; align-self: flex-end; text-align: center; width: 240px; }
.sign span { display: block; border-top: 1px solid #333; margin-bottom: 4px; }


/* ---------- Detalles Apple: hover de tarjetas y vidrio ---------- */
.card.hosp-card:hover, .card.tool:hover { box-shadow: var(--shadow-hover); }
.portal-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: linear-gradient(135deg, rgba(52, 84, 209, .35), rgba(52, 84, 209, .12)); color: #fff; text-decoration: none; font-weight: 600; font-size: 13px; border: 1px solid rgba(255, 255, 255, .08); transition: transform .3s var(--ease), background .3s; }
.portal-chip:hover { transform: translateY(-1px); background: linear-gradient(135deg, rgba(52, 84, 209, .5), rgba(52, 84, 209, .2)); }
.portal-chip > span:nth-child(2) { flex: 1; }
.portal-chip .i { width: 16px; height: 16px; }

/* Especie: campo que aparece al elegir "Otra especie" */
.reveal-field { max-height: 0; opacity: 0; overflow: hidden; margin: -14px -4px 0; padding: 0 4px; transition: max-height .5s var(--ease), opacity .3s, margin .5s var(--ease), padding .5s var(--ease); }
.reveal-field.open { max-height: 220px; opacity: 1; margin-top: 0; padding: 2px 4px 4px; }
.reveal-field .chips { margin-top: 2px; }

/* Carnet */
.carnet-dialog { max-width: 720px; }
.card-stage { perspective: 1600px; padding: 6px 0 0; }
.card-flip { position: relative; width: 100%; aspect-ratio: 856 / 540; transform-style: preserve-3d; transition: transform .9s var(--ease); }
.card-flip.flipped { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 4.2%/6.7%; box-shadow: 0 30px 60px rgba(6, 10, 28, .28), 0 4px 10px rgba(6, 10, 28, .12); overflow: hidden; }
.card-face svg { display: block; width: 100%; height: 100%; }
.card-face.back { transform: rotateY(180deg); }
.card-flip:not(.flipped) .front { animation: cardIn .9s var(--ease); }
@keyframes cardIn { from { transform: rotateX(18deg) translateY(16px) scale(.96); opacity: 0; } }
.card-print { display: flex; flex-direction: column; gap: 8mm; align-items: center; }
.card-print > div { width: 85.6mm; height: 54mm; }
.card-print svg { width: 85.6mm; height: 54mm; display: block; }
.card-print p { font-size: 10px; color: #777; }

/* Documentos */
.doc-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.doc-opt input { position: absolute; opacity: 0; pointer-events: none; }
.doc-opt span { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: all .25s var(--ease); min-height: 64px; }
.doc-opt span .i { color: var(--blue); }
.doc-opt input:checked + span { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 8px 20px rgba(52, 84, 209, .12); background: var(--blue-soft); }
.doc-opt input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.sign-row { display: flex; justify-content: space-between; gap: 40px; margin-top: 50px; }
.sign-row .sign { margin-top: 0; align-self: auto; }
.poster { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 20px; }
.poster h1 { font: 700 34px var(--f-display); letter-spacing: -.02em; }
.poster-k { font-size: 14px; text-transform: uppercase; letter-spacing: .14em; color: #3454D1; font-weight: 700; }
.poster-qr { padding: 18px; border: 2px solid #060A1C; border-radius: 24px; }

/* Hospitalización */
.hosp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 18px; }
.hosp-h { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px 12px; }
.hosp-n { font: 700 19px var(--f-display); letter-spacing: -.02em; }
.tx-list { display: flex; flex-direction: column; padding: 0 12px; }
.tx { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-top: 1px solid var(--line-2); border-radius: 10px; transition: background .3s; }
.tx:first-child { border-top: 0; }
.tx.bad { background: linear-gradient(90deg, var(--bad-soft), transparent 80%); }
.tx.warn { background: linear-gradient(90deg, var(--warn-soft), transparent 80%); }
.hosp-notes { display: flex; flex-direction: column; gap: 6px; padding: 10px 20px 0; font-size: 12.5px; color: var(--ink-2); }
.hosp-notes span { display: flex; gap: 6px; align-items: center; } .hosp-notes .i { width: 14px; height: 14px; color: var(--muted); }
.hosp-f { display: flex; flex-direction: column; gap: 10px; padding: 14px 20px 16px; margin-top: 10px; border-top: 1px solid var(--line-2); }
.hosp-f > span .i { width: 14px; height: 14px; color: var(--bad); vertical-align: -2px; }

/* Calculadoras */
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.result { min-height: 64px; }
.res-big { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, #060A1C, #1B2A6B); color: #fff; }
.res-big b { font: 700 34px/1 var(--f-display); letter-spacing: -.03em; }
.res-big span { color: #B9C0D4; font-weight: 500; }
.res-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 12px 4px 0; font-size: 13px; }
.res-grid span { color: var(--muted); } .res-grid b { text-align: right; font-weight: 600; }

/* Portal (configuración) */
.portal-link .card-b { display: flex; gap: 20px; align-items: center; }
.pl-qr { padding: 12px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(6, 10, 28, .08); flex: none; }
.pl-qr svg { display: block; }
.pl-url { word-break: break-all; font-size: 13px; }
.slug-in { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.switches { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-top: 1px solid var(--line-2); cursor: pointer; }
.switch-row:first-child { border-top: 0; }
.switch-row span { display: flex; flex-direction: column; } .switch-row small { color: var(--muted); font-size: 12px; }
.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 99px; background: #D9DCE3; position: relative; cursor: pointer; flex: none; transition: background .3s var(--ease); margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .35s var(--ease); }
.switch:checked { background: #34C759; } .switch:checked::after { transform: translateX(18px); }
.modal-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mod-opt { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; transition: all .25s var(--ease); }
.mod-opt span { color: var(--muted); font-size: 13px; }
.mod-opt.on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 10px 26px rgba(52, 84, 209, .14); }
.day-chk input { position: absolute; opacity: 0; }
.day-chk span { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); font-weight: 600; font-size: 12.5px; cursor: pointer; transition: all .2s var(--ease); }
.day-chk input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }


/* Iniciales siempre centradas en los círculos de mascotas y usuarios */
.avatar, .udot { display: inline-grid !important; place-items: center !important; line-height: 1; text-align: center; padding: 0; }

/* ---------- Recordatorios automáticos ---------- */
.auto-hero { background: radial-gradient(120% 90% at 100% 0%, rgba(52, 84, 209, .45), transparent 55%), #060A1C; color: #fff; border: 0; }
.auto-hero .lbl { color: #9AA3B5; }
.auto-t { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.auto-s { color: #B9C0D4; font-size: 13px; margin-top: 2px; }
.auto-hero .btn:not(.primary) { background: rgba(255, 255, 255, .1); color: #fff; border-color: transparent; }
.auto-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.auto-kpis > div { background: rgba(255, 255, 255, .06); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; }
.auto-kpis b { font-size: 26px; font-weight: 700; letter-spacing: -.03em; } .auto-kpis span { font-size: 12px; color: #B9C0D4; }
.ob-list { display: flex; flex-direction: column; }
.ob { display: flex; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line-2); align-items: flex-start; }
.ob:first-child { border-top: 0; }
.ob.attn { background: linear-gradient(90deg, var(--blue-soft), transparent 80%); }
.ob-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ob-main .row { flex-wrap: wrap; }
.ob-txt { font-size: 13px; color: var(--ink-2); background: #E7F7DD; border-radius: 4px 14px 14px 14px; padding: 8px 11px; max-width: 560px; overflow-wrap: anywhere; }
.ob-resp { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px 4px 14px 14px; padding: 8px 11px; font-size: 13px; display: flex; flex-direction: column; animation: pop .45s var(--ease); }
.ob-resp small { color: var(--muted); font-size: 11px; }
.ob-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.ob-st { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tk { font-weight: 700; color: #8E95A5; letter-spacing: -.12em; } .tk.read { color: #34B7F1; } .tk.q .i { width: 14px; height: 14px; }
.note.small { display: flex; gap: 8px; align-items: flex-start; } .note .i { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.note.memorial { background: #F2F2F5; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.ai-box textarea.flash { animation: flash 1s var(--ease); }
@keyframes flash { 0% { background: var(--blue-soft); } }

/* ---------- Laboratorio y plan de vacunas ---------- */
.lab-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 14px; padding: 16px 18px; }
.lab-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.lab-t { font-size: 13px; } .lab-t td { padding: 6px 4px; border-color: var(--line-2); }
.lab-t tr.alto td, .lab-t tr.bajo td { background: #FFF8EC; }
.flag { font-size: 11.5px; font-weight: 700; } .flag.up { color: var(--bad); } .flag.down { color: #2F6FD6; }
.lab-in { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lab-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px 24px; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line-2); }
.lab-row:first-child { border-top: 0; }
.lab-flag { font-style: normal; font-weight: 700; text-align: center; } .lab-flag.up { color: var(--bad); } .lab-flag.down { color: #2F6FD6; } .lab-flag.ok { color: var(--ok); }
.plan-v { margin: 16px 18px 4px; padding: 14px 16px; border-radius: 16px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px; }
.pv { display: flex; flex-direction: column; gap: 6px; background: #fff; border-radius: 12px; padding: 10px 12px; align-items: flex-start; }
.pv-n { font-weight: 600; font-size: 13.5px; }
.pv-d { display: flex; gap: 4px; } .pv-d i { width: 18px; height: 6px; border-radius: 99px; background: var(--line); } .pv-d i.on { background: var(--blue); }
.w-80 { width: 80px; }

/* ---------- Cirugías ---------- */
.cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 18px; }
.cx-steps { display: flex; margin: 0 20px; border-radius: 12px; overflow: hidden; background: var(--bg); }
.cx-steps span { flex: 1; text-align: center; font-size: 12px; font-weight: 600; padding: 8px 4px; color: var(--muted); transition: background .4s var(--ease), color .3s; }
.cx-steps span.done { color: var(--ok); } .cx-steps span.on { background: var(--violet); color: #fff; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px 0; }
.chk-b { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; border: 1px dashed #C9CEDA; background: #fff; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .25s var(--ease); }
.chk-b .i { width: 14px; height: 14px; opacity: .3; }
.chk-b.on { border-style: solid; border-color: #BFE3D2; background: var(--ok-soft); color: var(--ok); } .chk-b.on .i { opacity: 1; }
.mon td, .mon th { padding: 6px 8px; } .mon .input.sm { width: 64px; padding: 5px 6px; } .mon td:last-child .input.sm { width: 100%; min-width: 110px; }
.ag-ev.cx { background: repeating-linear-gradient(135deg, var(--violet-soft), var(--violet-soft) 8px, #fff 8px, #fff 16px); }
.ag-block { position: absolute; left: 0; right: 0; border: 0; z-index: 1; background: repeating-linear-gradient(135deg, rgba(6, 10, 28, .06), rgba(6, 10, 28, .06) 6px, rgba(6, 10, 28, .02) 6px, rgba(6, 10, 28, .02) 12px); cursor: pointer; display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; }
.ag-block span { font-size: 12px; font-weight: 600; color: var(--muted); background: #fff; padding: 3px 9px; border-radius: 99px; display: inline-flex; gap: 4px; align-items: center; box-shadow: var(--shadow); }
.ag-block .i { width: 12px; height: 12px; }

/* ---------- Peluquería / controlados / ticket ---------- */
.kanban.gr { grid-template-columns: repeat(6, minmax(190px, 1fr)); }
.ctl-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding: 14px 18px; }
.ctl-sum > div { background: var(--bg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; } .ctl-sum b { font-size: 22px; }
.ticket80 { width: 72mm; font: 11px/1.35 ui-monospace, Menlo, monospace; color: #000; display: flex; flex-direction: column; gap: 2px; }
.ticket80 .t-c { text-align: center; display: block; } .ticket80 hr { border: 0; border-top: 1px dashed #000; margin: 4px 0; }
.ticket80 .t-l { display: flex; justify-content: space-between; gap: 8px; } .ticket80 .t-big { font-weight: 700; font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .cols.even { grid-template-columns: minmax(0, 1fr); }
  .cx { grid-template-columns: minmax(0, 1fr); }
  .cx-side { position: static; }
  .pos { grid-template-columns: minmax(0, 1fr); }
  .pos-cart { position: static; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .brand-sm { display: block; }
  .top { padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); gap: 8px; }
  #view { padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px)); gap: 14px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; border: 0; background: none; cursor: pointer; }
  .tabbar .i { width: 22px; height: 22px; }
  .tabbar .on { color: var(--blue); }
  .tabbar .dot { position: absolute; top: 3px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: #D98A12; }
  #toasts { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); right: 12px; left: 12px; align-items: stretch; }
  .hide-sm { display: none; }
  .top kbd, .card-h kbd { display: none; }
  h1 { font-size: 24px; }
  .soap, .grid-3, .tools, .doc-pick, .modal-pick { grid-template-columns: minmax(0, 1fr); }
  .auto-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ob { flex-wrap: wrap; } .ob-side { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; padding-left: 48px; }
  .lab-row { grid-template-columns: minmax(0, 1fr) 90px 24px; } .lab-row small { display: none; }
  .kanban.gr { grid-template-columns: repeat(6, 78vw); }
  .cx-steps span { font-size: 10.5px; }
  .portal-link .card-b { flex-direction: column; align-items: flex-start; }
  .sign-row { gap: 20px; }
  .line { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .line-main { grid-column: 1 / -1; }
  .line .line-amt { justify-self: end; }
  .line > .icon-btn { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; }
  .line-main { grid-column: 1; }
  .li { flex-wrap: wrap; padding: 12px 14px; }
  .li-actions { width: 100%; justify-content: flex-start; padding-left: 62px; }
  th, td { padding-left: 12px; padding-right: 12px; }
  .ficha-res { grid-template-columns: minmax(0, 1fr); }
  .week .wd .wd-n { display: none; }
  .week .icon-btn { display: none; }
  .kanban { grid-template-columns: repeat(5, 78vw); scroll-snap-type: x mandatory; }
  .kb-col { scroll-snap-align: start; }
  .save-bar { position: static; }
  .save-bar .btn.lg { width: 100%; }
  .save-opts { justify-content: flex-start; }
  .pet-actions { width: 100%; justify-content: flex-start; }
  .next-box { grid-template-columns: minmax(0, 1fr) 150px; }
  .next-box > .self-end:last-child { grid-column: 1 / -1; }
  #modal { padding: 16px 10px; }
  #modal.as-sheet { place-items: end center; padding: 0; }
  #modal.as-sheet .dialog { border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .dialog-f .btn { flex: 1 1 auto; }
  .dialog-f .spacer { display: none; }
}
@media (max-width: 520px) {
  .kpis { gap: 10px; }
  .kpi { padding: 13px; }
  .kpi .val { font-size: 21px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .next-box { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: 96px minmax(0, 1fr) 54px; }
  .speed-big { font-size: 36px; }
  .close-grid { grid-template-columns: minmax(0, 1fr); }
  .tl { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .search-in { min-width: 0; max-width: none; flex-basis: 100%; }
  .page-head > .row { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Móvil: controles segmentados con scroll y textos largos que bajan de línea */
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.hosp-h .li-main .muted, .cx-card .li-main .muted { white-space: normal; overflow-wrap: anywhere; }
.li-main b, .kb-who b { overflow-wrap: anywhere; }
.tx .li-main .muted, .kb-who .muted, .ob-main .muted { white-space: normal; }

/* ---------- Ventanas: salida suave ---------- */
#modal.closing .backdrop { opacity: 0; transition: opacity .2s var(--ease); }
#modal.closing .dialog { opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .2s var(--ease), transform .2s var(--ease); }
/* Indicador del menú lateral que se desliza */
.nav { position: relative; }
#nav-ind { position: absolute; left: 0; right: 0; top: 0; border-radius: 10px; background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); transition: transform .45s var(--ease), height .3s var(--ease); pointer-events: none; z-index: 0; }
.nav a { position: relative; z-index: 1; }
.nav a.on { background: transparent; box-shadow: none; }
/* Bienvenida */
.welcome-d { max-width: 460px; }
.welcome { padding: 34px 28px 26px; gap: 16px; }
.welcome h2 { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.welcome-art { width: 72px; height: 72px; border-radius: 22px; animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-4px); } }
.done-art { background: linear-gradient(135deg, #18865B, #5BE3A2); box-shadow: 0 12px 30px rgba(24, 134, 91, .35); }
.welcome-roles { gap: 8px; max-width: 380px; } .welcome-roles .lbl { margin-bottom: 2px; }
.role .i { margin-left: auto; color: var(--blue); }
.role:hover { border-color: #CDD1DB; transform: translateY(-1px); }
.welcome-cta { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 380px; }
.welcome-cta .btn { width: 100%; }
/* Acciones rápidas del inicio */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.qa { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; border: 1px solid rgba(6, 10, 28, .05); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; text-align: left; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.qa:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); } .qa:active { transform: scale(.98); }
.qa > span:last-child { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; } .qa small { color: var(--muted); font-size: 12.5px; }
.qa-i { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.qa-i.b { background: var(--blue-soft); color: var(--blue); } .qa-i.g { background: #E3F5F2; color: #0E8A7A; } .qa-i.v { background: var(--violet-soft); color: var(--violet); } .qa-i.o { background: #FFF1E6; color: #C25A12; }
/* Primeros pasos */
.onb-list { display: flex; flex-direction: column; padding: 6px; }
.onb-i { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 500; transition: background .2s; }
.onb-i:hover { background: var(--bg); }
.onb-i > span:nth-child(2) { flex: 1; }
.onb-i > .i { color: var(--muted); width: 16px; height: 16px; }
.onb-c { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--blue); flex: none; }
.onb-c .i { width: 15px; height: 15px; }
.onb-i.ok { color: var(--muted); } .onb-i.ok > span:nth-child(2) { text-decoration: line-through; } .onb-i.ok .onb-c { background: var(--ok); color: #fff; animation: pop .4s var(--ease); }
.ring { --p: 0; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: conic-gradient(var(--blue) calc(var(--p) * 360deg), var(--line-2) 0); }
.ring span { width: 26px; height: 26px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; }
.switches.mods { margin-top: 4px; }
@media (max-width: 1180px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .qa { padding: 12px; gap: 10px; } .qa-i { width: 34px; height: 34px; } .qa small { display: none; } }

/* ================= Agenda v2 · clara y sin subir/bajar ================= */
.ag-tools { flex-wrap: wrap; justify-content: flex-end; }
.ag-rel { color: var(--blue); }
.wd { gap: 3px; padding: 9px 4px 8px; }
.wd.past:not(.on) { opacity: .6; }
.wd-dots { display: flex; gap: 3px; height: 5px; }
.wd-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.wd.on .wd-dots i { background: #8EA6FF; }
.wd .wd-n { font-size: 11px; }
.ag-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin: 2px 0 -4px; }
.ag-chips, .ag-vets { display: flex; gap: 6px; flex-wrap: wrap; }
.ag-chip, .ag-vchip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font: 500 13px var(--f-body); color: var(--ink-2); cursor: pointer; transition: all .2s var(--ease); white-space: nowrap; }
.ag-chip b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.ag-chip i { width: 8px; height: 8px; border-radius: 50%; background: #A9AFBD; }
.ag-chip:hover, .ag-vchip:hover { border-color: #C9CEDA; }
.ag-chip.on, .ag-vchip.on { background: #060A1C; border-color: #060A1C; color: #fff; }
.ag-chip.on b { color: #fff; }
.ag-vchip .udot { width: 22px; height: 22px; font-size: 10px; }
.g-conf i, .tl-row.g-conf .tl-dot i { background: var(--blue); }
.g-clin i, .tl-row.g-clin .tl-dot i { background: #D98A12; }
.g-cobrar i, .tl-row.g-cobrar .tl-dot i { background: var(--violet); }
.g-ok i, .tl-row.g-ok .tl-dot i { background: var(--ok); }
.g-no i, .tl-row.g-no .tl-dot i { background: var(--bad); }
.ag-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.ag-main { min-width: 0; }
/* Calendario */
.ag-card { overflow: hidden; }
.ag-scroll { overflow: auto; max-height: calc(100vh - 230px); overscroll-behavior: contain; }
.ag-head { top: 0; }
.ag-vh { padding: 9px 12px; }
.ag-times span { font-size: 11px; }
.ag-times span.half { opacity: .45; font-size: 10px; }
.ag-slot { position: relative; }
.ag-slot span { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 4px; font: 600 11.5px var(--f-body); white-space: nowrap; }
.ag-slot span .i { width: 12px; height: 12px; }
.ag-past { position: absolute; left: 0; right: 0; top: 0; background: repeating-linear-gradient(0deg, rgba(6,10,28,.025), rgba(6,10,28,.025) 1px, transparent 1px, transparent 4px), rgba(6,10,28,.025); pointer-events: none; }
.ag-ev { padding: 4px 9px; gap: 0; justify-content: flex-start; }
.ag-ev .ag-ev-l { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.ag-ev .ag-ev-l b { font: 600 11.5px var(--f-mono); opacity: .8; flex: none; }
.ag-ev .ag-ev-l strong { font-weight: 700; flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.ag-ev .ag-ev-l em, .ag-ev > em { font-style: normal; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ag-ev > small { font-size: 11.5px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev .ag-st { margin-left: auto; flex: none; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,.75); }
.ag-ev.one { flex-direction: row; align-items: center; padding-top: 0; padding-bottom: 0; }
.ag-ev.one .ag-ev-l { width: 100%; align-items: center; }
.ag-ev.dim { opacity: .28; filter: grayscale(.6); }
.ag-ev.st-bad .ag-ev-l strong { text-decoration: line-through; }
.ag-ev.st-bad { text-decoration: none; }
.ag-hint { display: flex; align-items: center; gap: 6px; margin: 10px 4px 0; font-size: 12.5px; color: var(--muted); }
.ag-hint .i { width: 14px; height: 14px; }
/* Panel lateral */
.ag-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 84px; }
.ag-next { background: #060A1C; color: #fff; border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.ag-next-k { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #B9C0D4; }
.ag-next-k b { color: #8EA6FF; }
.ag-next-k .i { width: 15px; height: 15px; }
.ag-next-main { display: flex; gap: 12px; align-items: center; background: none; border: 0; color: inherit; text-align: left; padding: 0; cursor: pointer; min-width: 0; }
.ag-next-main > span { display: flex; flex-direction: column; min-width: 0; }
.ag-next-main b { font: 700 20px var(--f-display); letter-spacing: -.01em; }
.ag-next-main small { color: #C9CEDA; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-next .row { gap: 8px; flex-wrap: nowrap; }
.ag-next-acts .btn { flex: 1; justify-content: center; }
.ag-next-k .pill { font-size: 11px; }
.ag-next .btn:not(.primary):not(.wa) { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); color: #fff; }
.ag-next.empty-next { background: var(--surface); color: var(--ink); }
.ag-next.empty-next .ag-next-k { color: var(--ok); font-weight: 600; }
.ag-next.empty-next p { margin: 0; font-size: 13px; }
.ag-box { background: var(--surface); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.ag-box h3 { display: flex; align-items: center; gap: 6px; }
.ag-box h3 .i { width: 14px; height: 14px; }
.ag-box p { margin: 0; font-size: 13px; }
.ag-box .btn { align-self: flex-start; }
.ag-box.warnbox { background: var(--warn-soft); }
.ag-box.warnbox h3 { color: var(--warn); }
.ag-mini { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px; margin: -4px; border-radius: 10px; text-align: left; cursor: pointer; min-width: 0; }
.ag-mini:hover { background: var(--hover); }
.ag-mini > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ag-mini small { color: var(--muted); font-size: 12px; }
.ag-free { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.ag-freeb { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 7px 4px; border-radius: 10px; border: 1px dashed var(--blue-line); background: var(--blue-soft); color: var(--blue); cursor: pointer; transition: all .2s var(--ease); }
.ag-freeb b { font: 600 14px var(--f-mono); }
.ag-freeb small { font-size: 11px; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-freeb:hover { background: var(--blue); color: #fff; border-style: solid; }
.ag-freeb:hover small { color: #DDE3F5; }
/* Lista tipo línea de tiempo */
.ag-tl { padding: 8px 0; }
.tl-row { display: grid; grid-template-columns: 62px 22px minmax(0, 1fr); align-items: stretch; padding: 0 16px 0 10px; }
.tl-row.past { opacity: .55; }
.tl-time { display: flex; flex-direction: column; align-items: flex-end; padding: 14px 4px 0 0; line-height: 1.2; }
.tl-time b { font: 700 14px var(--f-mono); }
.tl-time small { font: 500 11px var(--f-mono); color: var(--muted); }
.tl-dot { position: relative; display: flex; justify-content: center; }
.tl-dot::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-dot i { position: relative; margin-top: 18px; width: 12px; height: 12px; border-radius: 50%; background: #A9AFBD; box-shadow: 0 0 0 3px var(--surface); }
.tl-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; padding: 10px 0 10px 8px; border-bottom: 1px solid var(--line-2); min-width: 0; }
.tl-main { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; min-width: 0; flex: 1 1 260px; color: inherit; }
.tl-main > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.tl-main b { font-size: 15px; display: flex; align-items: center; gap: 4px; }
.tl-main small { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-alert { color: var(--bad); display: inline-flex; } .tl-alert .i { width: 14px; height: 14px; }
.tl-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tl-now { position: relative; height: 26px; margin: 2px 16px 2px 10px; display: flex; align-items: center; }
.tl-now::before { content: ""; position: absolute; left: 62px; right: 0; height: 2px; background: var(--bad); }
.tl-now::after { content: ""; position: absolute; left: 67px; width: 12px; height: 12px; border-radius: 50%; background: var(--bad); }
.tl-now span { position: relative; z-index: 1; margin-left: 88px; background: var(--bad); color: #fff; font: 700 11.5px var(--f-body); padding: 2px 9px; border-radius: 99px; }
.tl-gap { display: grid; grid-template-columns: 62px 22px minmax(0, 1fr) auto; align-items: center; width: 100%; border: 0; background: none; padding: 0 16px 0 10px; cursor: pointer; text-align: left; font: inherit; color: var(--muted); border-radius: 12px; transition: background .2s var(--ease); }
.tl-gt { text-align: right; padding-right: 4px; font: 500 11px var(--f-mono); }
.tl-gl { align-self: stretch; justify-self: center; width: 2px; min-height: 52px; background: repeating-linear-gradient(180deg, var(--line) 0 4px, transparent 4px 8px); }
.tl-gb { display: flex; flex-direction: column; padding: 10px 0 10px 8px; line-height: 1.3; min-width: 0; }
.tl-gb b { font-weight: 600; font-size: 13px; color: var(--ok); }
.tl-gb small { font: 500 11.5px var(--f-mono); }
.tl-gap em { font-style: normal; display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 99px; background: var(--blue-soft); opacity: 0; transition: opacity .2s var(--ease); }
.tl-gap em .i { width: 13px; height: 13px; }
.tl-gap:hover { background: var(--hover); } .tl-gap:hover em, .tl-gap:focus-visible em { opacity: 1; }
@media (hover: none) { .tl-gap em { opacity: 1; } }
@media (max-width: 1100px) {
  .ag-wrap { grid-template-columns: minmax(0, 1fr); }
  .ag-side { position: static; order: -1; }
  .ag-side .ag-box { display: none; }
  .ag-side .ag-box.warnbox { display: none; }
}
@media (max-width: 760px) {
  .ag-tools { width: 100%; justify-content: flex-start; flex-wrap: nowrap; }
  .ag-tools .agl { display: none; }
  .ag-tools .btn.primary { margin-left: auto; }
  .ag-bar { margin: 0; }
  .ag-chips, .ag-vets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); }
  .ag-chips::-webkit-scrollbar, .ag-vets::-webkit-scrollbar { display: none; }
  .week .wd .wd-dots { display: flex; }
  .ag-next { padding: 14px; }
  .tl-row { grid-template-columns: 50px 18px minmax(0, 1fr); padding: 0 12px 0 4px; }
  .tl-gap { grid-template-columns: 50px 18px minmax(0, 1fr) auto; padding: 0 12px 0 4px; }
  .tl-now::before { left: 50px; } .tl-now::after { left: 53px; } .tl-now span { margin-left: 74px; }
  .tl-body { padding-left: 6px; }
  .tl-main { flex-basis: 100%; }
  .tl-main small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
  .ag-scroll { max-height: calc(100vh - 260px); scroll-snap-type: x mandatory; }
  .ag-head, .ag-body { grid-template-columns: 52px repeat(var(--cols), minmax(240px, 1fr)); }
  .ag-col, .ag-vh { scroll-snap-align: start; scroll-margin-left: 52px; }
  .ag-times { position: sticky; left: 0; z-index: 2; background: var(--surface); }
  .ag-head > div:first-child { position: sticky; left: 0; background: var(--surface); z-index: 3; }
  .ag-now { left: 52px; }
  .ag-ev .ag-st { display: none; }
  .ag-hint { font-size: 12px; }
}
