*{box-sizing:border-box;margin:0;padding:0}
body{font:14px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:#f1f5f9;color:#0f172a;min-height:100vh;display:flex;flex-direction:column}
button{font:inherit;cursor:pointer;border:0;background:none;color:inherit}
svg.i{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.row{display:flex;align-items:center;gap:8px}
.between{display:flex;align-items:center;justify-content:space-between;gap:12px}
.muted{color:#64748b}.faint{color:#94a3b8}.small{font-size:12px}.bold{font-weight:700}.semi{font-weight:600}
.mono{font-family:ui-monospace,Menlo,Consolas,monospace}

/* header */
header{background:linear-gradient(90deg,#0f172a,#1e293b,#0f172a);color:#fff;padding:8px 16px;display:flex;align-items:center;gap:24px;box-shadow:0 4px 16px rgba(0,0,0,.2)}
.ibtn{padding:8px;border-radius:8px;position:relative}.ibtn:hover{background:#334155}
.logo{width:40px;height:40px;border-radius:10px;background:linear-gradient(135deg,#f97316,#dc2626);display:grid;place-items:center;position:relative;box-shadow:0 4px 10px rgba(0,0,0,.3)}
.logo .ring{width:24px;height:24px;border:2px solid #fff;border-radius:50%;display:grid;place-items:center}
.logo .ring i{width:8px;height:8px;background:#fff;border-radius:50%}
.logo .heart{position:absolute;right:-4px;bottom:-4px;width:16px;height:16px;border-radius:50%;background:#10b981;display:grid;place-items:center}
.logo .heart svg{width:10px;height:10px}
.brand b{font-size:20px;letter-spacing:-.02em}.brand b span{color:#fb923c}
.brand p{font-size:10px;color:#94a3b8;margin-top:-2px}
.search{flex:1;max-width:680px;position:relative}
.search input{width:100%;padding:10px 52px 10px 40px;border-radius:12px;background:rgba(51,65,85,.5);border:1px solid #475569;color:#fff;font:inherit;outline:none}
.search input::placeholder{color:#94a3b8}
.search input:focus{border-color:rgba(249,115,22,.6);box-shadow:0 0 0 3px rgba(249,115,22,.2);background:#334155}
.search>span:first-child{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#94a3b8;display:flex}
.mic{display:flex}
.mic{position:absolute;right:6px;top:50%;transform:translateY(-50%);padding:8px;border-radius:8px;background:rgba(249,115,22,.2);color:#fb923c}
.mic.on{background:#ef4444;color:#fff;animation:pulse 1.2s infinite}
@keyframes pulse{50%{opacity:.6}}
.assist{position:absolute;top:calc(100% + 8px);left:0;right:0;background:#1e293b;border:1px solid #334155;border-radius:12px;padding:16px;z-index:50;box-shadow:0 20px 40px rgba(0,0,0,.4);display:none}
.assist.show{display:block}
.assist .grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:10px}
.assist .grid button{display:flex;gap:8px;align-items:center;padding:8px 12px;border-radius:8px;text-align:left}
.assist .grid button:hover{background:#334155}
.assist .foot{margin-top:12px;padding-top:12px;border-top:1px solid #334155;font-size:12px;color:#64748b}
kbd{background:#334155;color:#cbd5e1;padding:1px 6px;border-radius:4px;font-size:11px}
.pill-int{display:flex;align-items:center;gap:6px;padding:6px 12px;background:rgba(51,65,85,.5);border-radius:8px;font-size:12px;color:#cbd5e1}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block;flex:none}
.g{background:#34d399}.o{background:#f97316}.a{background:#f59e0b}.b{background:#3b82f6}.e{background:#10b981}
.user{display:flex;align-items:center;gap:8px;padding-left:12px;border-left:1px solid #334155}
.avatar{width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,#f97316,#dc2626);display:grid;place-items:center;font-weight:600;font-size:13px}

/* patient banner */
.banner{background:#fff;border-bottom:1px solid #e2e8f0;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.bwrap{padding:12px 16px;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.pav{width:64px;height:64px;border-radius:16px;background:linear-gradient(135deg,#fb7185,#e11d48);color:#fff;font-size:20px;font-weight:700;display:grid;place-items:center;position:relative;box-shadow:0 6px 14px rgba(225,29,72,.3)}
.pav .ok{position:absolute;right:-4px;bottom:-4px;width:20px;height:20px;border-radius:50%;background:#10b981;border:2px solid #fff;display:grid;place-items:center}
.pav .ok svg{width:11px;height:11px}
h1{font-size:20px}
.tag{padding:3px 10px;border-radius:8px;font-size:13px;font-weight:500}
.t-rose{background:#ffe4e6;color:#be123c}.t-slate{background:#f1f5f9;color:#334155}.t-red{background:#fee2e2;color:#b91c1c}
.meta{display:flex;gap:14px;flex-wrap:wrap;margin-top:6px;color:#475569;font-size:13px}
.meta b{color:#334155;margin-right:4px}.meta .sep{color:#cbd5e1}
.allergy{display:flex;align-items:center;gap:12px;padding:10px 16px;border-radius:12px;background:linear-gradient(90deg,#fef2f2,#fff7ed);border:1px solid #fecaca}
.allergy .ic{padding:8px;background:#fee2e2;border-radius:8px;color:#dc2626}
.allergy .ic svg{width:20px;height:20px}
.allergy small{display:block;font-size:11px;font-weight:700;color:#dc2626;text-transform:uppercase;letter-spacing:.04em}
.allergy span{font-weight:600;color:#991b1b}
.btn{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border-radius:12px;font-weight:500}
.btn-pri{background:linear-gradient(90deg,#f97316,#ef4444);color:#fff;box-shadow:0 6px 14px rgba(249,115,22,.25)}
.btn-pri:hover{filter:brightness(.95)}
.btn-sec{background:#f1f5f9;color:#334155}.btn-sec:hover{background:#e2e8f0}
.btn-sec.on{background:#ef4444;color:#fff;animation:pulse 1.2s infinite}
.tabs{display:flex;gap:4px;padding:0 16px;border-top:1px solid #f1f5f9;overflow-x:auto}
.tab{display:flex;align-items:center;gap:8px;padding:14px 20px;border-bottom:2px solid transparent;color:#64748b;font-weight:500;white-space:nowrap}
.tab:hover{color:#1e293b;background:#f8fafc}
.tab.act{border-color:#f97316;color:#ea580c;background:rgba(255,247,237,.6)}

/* main */
main{flex:1;padding:16px}
.cols{display:grid;grid-template-columns:3fr 6fr 3fr;gap:16px;align-items:start}
.stack{display:flex;flex-direction:column;gap:16px}
.card{background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:20px;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.card h3{font-size:15px;font-weight:600;display:flex;align-items:center;gap:12px}
.hic{padding:8px;border-radius:8px;display:grid;place-items:center}
.c-blue{background:#dbeafe;color:#2563eb}.c-em{background:#d1fae5;color:#059669}.c-pur{background:#f3e8ff;color:#9333ea}
.c-teal{background:#ccfbf1;color:#0d9488}.c-ind{background:#e0e7ff;color:#4f46e5}.c-amb{background:#fef3c7;color:#d97706}
.head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.chip{font-size:12px;color:#94a3b8;background:#f1f5f9;padding:3px 10px;border-radius:999px;display:inline-flex;gap:4px;align-items:center}
.chip svg{width:12px;height:12px}
.dx{padding:16px;border-radius:12px;background:linear-gradient(90deg,#fffbeb,#fff7ed);border:1px solid #fde68a}
.dx p{font-weight:600;color:#78350f}.dx small{display:block;color:#b45309;margin-top:4px}
.kv{display:flex;justify-content:space-between;font-size:13px;margin-top:8px}.kv span:first-child{color:#64748b}.kv span:last-child{font-weight:500;color:#334155}
.item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px;background:#f8fafc;border-radius:12px;margin-top:8px}
.item:hover{background:#f1f5f9}
.vic{padding:6px;background:#fff;border-radius:8px;box-shadow:0 1px 2px rgba(0,0,0,.08);color:#64748b}
.val{font-weight:700;font-variant-numeric:tabular-nums}.unit{font-size:12px;color:#94a3b8;margin-left:4px}
.outline{width:100%;margin-top:16px;padding:10px;border:1px solid #fed7aa;border-radius:12px;color:#ea580c;font-weight:500}
.outline:hover{background:#fff7ed}
.link{color:#ea580c;font-weight:500;display:inline-flex;align-items:center;gap:2px}
.med{padding:16px;cursor:pointer}
.route{padding:1px 8px;border-radius:999px;font-size:11px;font-weight:700}
.r-active{background:#d1fae5;color:#047857}.r-scheduled{background:#dbeafe;color:#1d4ed8}.r-prn{background:#e2e8f0;color:#475569}
table{width:100%;border-collapse:collapse;font-size:13px}
.tbl{border:1px solid #e2e8f0;border-radius:12px;overflow:hidden}
th{background:#f8fafc;color:#475569;font-weight:600;padding:12px 16px;text-align:left}
td{padding:12px 16px;border-top:1px solid #f1f5f9}
tr:hover td{background:#f8fafc}
.r{text-align:right}.c{text-align:center}
.low{color:#dc2626}
.st{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;border-radius:999px;font-size:12px;font-weight:500}
.st svg{width:13px;height:13px}
.st-ok{background:#d1fae5;color:#047857}.st-low{background:#fee2e2;color:#b91c1c}
.note{display:block;padding:12px;background:#f8fafc;border-radius:12px;margin-top:10px;cursor:pointer}
.note:hover{background:#f1f5f9}
.note .type{font-size:12px;font-weight:700;color:#4f46e5}
.ia{display:inline-flex;align-items:center;gap:2px;font-size:11px;color:#f97316;background:#ffedd5;padding:1px 6px;border-radius:4px}
.ia svg{width:11px;height:11px}
.note p.sum{font-size:12px;color:#64748b;margin-top:4px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.full{width:100%;justify-content:center;margin-top:16px}
.order{display:flex;justify-content:space-between;align-items:center;padding:12px;border:1px solid #e2e8f0;border-radius:12px;margin-top:8px;cursor:pointer}
.order:hover{border-color:#fed7aa;background:rgba(255,247,237,.5)}
.order .otype{font-size:11px;font-weight:700;color:#64748b;text-transform:uppercase}
.dark{background:linear-gradient(135deg,#1e293b,#0f172a);color:#fff;border:0}
.dark .hic{background:rgba(249,115,22,.2);color:#fb923c}
.svc{display:flex;justify-content:space-between;font-size:13px;margin-top:8px}
.svc span:first-child{color:#cbd5e1;display:flex;gap:8px;align-items:center}
.svc .dot{animation:pulse 2s infinite}
.dark .foot{margin-top:16px;padding-top:16px;border-top:1px solid #334155;display:flex;justify-content:space-between;font-size:12px}
.empty{text-align:center;padding:56px 24px}
.empty .big{width:80px;height:80px;border-radius:16px;background:linear-gradient(135deg,#ffedd5,#fee2e2);color:#f97316;display:grid;place-items:center;margin:0 auto 24px}
.empty .big svg{width:40px;height:40px}
.empty h3{display:block;font-size:20px;font-weight:700;margin-bottom:8px}
.empty p{color:#64748b;max-width:440px;margin:0 auto}

footer{background:#0f172a;color:#fff;padding:8px 16px;display:flex;justify-content:space-between;align-items:center;gap:16px;font-size:12px;flex-wrap:wrap}
footer .mini{width:20px;height:20px;border-radius:4px;background:linear-gradient(135deg,#f97316,#dc2626);display:grid;place-items:center}
footer .mini i{width:10px;height:10px;border:1px solid #fff;border-radius:50%}
footer .sep{color:#475569}

@media(max-width:1100px){.cols{grid-template-columns:1fr 1fr}.cols>.stack:nth-child(2){grid-column:1/-1;order:-1}}
@media(max-width:720px){
  header{flex-wrap:wrap;gap:10px}.search{order:3;flex-basis:100%;max-width:none}
  .pill-int,.user div{display:none}
  .cols{grid-template-columns:1fr}
  .allergy{width:100%}
  table{font-size:12px}th,td{padding:10px}
}

/* ---- OxideHealth: piezas de la aplicación (sobre el diseño base) ---- */
[hidden]{display:none!important}
.nav{display:flex;gap:4px}
.nav button{padding:8px 12px;border-radius:8px;color:#cbd5e1;font-weight:500;display:flex;gap:6px;align-items:center}
.nav button:hover{background:#334155;color:#fff}
.nav button.act{background:rgba(249,115,22,.18);color:#fb923c}
.results{position:absolute;top:calc(100% + 8px);left:0;right:0;background:#1e293b;border:1px solid #334155;border-radius:12px;padding:8px;z-index:60;box-shadow:0 20px 40px rgba(0,0,0,.4);max-height:420px;overflow:auto}
.results button{display:flex;justify-content:space-between;width:100%;padding:10px 12px;border-radius:8px;color:#e2e8f0;text-align:left}
.results button:hover,.results button.sel{background:#334155}
.results .hint{padding:10px 12px;color:#94a3b8;font-size:12px}
.results .new{color:#fb923c;font-weight:500}

.login{flex:1;display:grid;place-items:center;padding:24px;background:linear-gradient(135deg,#0f172a,#1e293b)}
.login .card{width:100%;max-width:420px}
.login .brandrow{display:flex;align-items:center;gap:12px;margin-bottom:20px}
.login .brand b{color:#0f172a}

label.f{display:block;font-size:12px;font-weight:600;color:#475569;margin-top:12px}
label.f input,label.f select,label.f textarea{display:block;width:100%;margin-top:4px;padding:9px 12px;border:1px solid #cbd5e1;border-radius:10px;font:inherit;color:#0f172a;background:#fff;outline:none}
label.f textarea{min-height:84px;resize:vertical}
label.f input:focus,label.f select:focus,label.f textarea:focus{border-color:#fb923c;box-shadow:0 0 0 3px rgba(249,115,22,.15)}
label.chk{display:flex;align-items:center;gap:8px;margin-top:12px;font-size:13px;color:#334155}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:0 12px}
.grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:0 12px}
.actions{display:flex;gap:8px;justify-content:flex-end;margin-top:16px;flex-wrap:wrap}
.btn-sm{padding:6px 10px;border-radius:8px;font-size:12px;font-weight:500}
.btn-ghost{background:#fff;border:1px solid #e2e8f0;color:#334155}.btn-ghost:hover{background:#f8fafc}
.btn-danger{background:#fee2e2;color:#b91c1c}.btn-danger:hover{background:#fecaca}
.btn-ok{background:#d1fae5;color:#047857}.btn-ok:hover{background:#a7f3d0}
.btn:disabled,.btn-sm:disabled{opacity:.5;cursor:not-allowed}
.err{margin-top:12px;padding:10px 12px;border-radius:10px;background:#fef2f2;border:1px solid #fecaca;color:#991b1b;font-size:13px}

.modal-bg{position:fixed;inset:0;background:rgba(15,23,42,.55);display:grid;place-items:center;z-index:100;padding:16px}
.modal{background:#fff;border-radius:16px;padding:24px;width:100%;max-width:560px;max-height:90vh;overflow:auto;box-shadow:0 30px 60px rgba(0,0,0,.35)}
.modal.wide{max-width:860px}
.modal h2{font-size:18px;margin-bottom:4px}

.toast{position:fixed;right:16px;bottom:56px;z-index:120;padding:12px 16px;border-radius:12px;background:#0f172a;color:#fff;box-shadow:0 10px 30px rgba(0,0,0,.3);max-width:420px}
.toast.bad{background:#991b1b}

.toolbar{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap;margin-bottom:16px}
.toolbar label.f{margin-top:0;min-width:180px}
.slot{display:grid;grid-template-columns:90px 1fr auto;gap:12px;align-items:center;padding:12px;border-radius:12px;background:#f8fafc;margin-top:8px}
.slot.free{background:#fff;border:1px dashed #cbd5e1}
.slot .hora{font-weight:700;font-variant-numeric:tabular-nums;color:#334155}
.slot .hora small{display:block;font-weight:400;color:#94a3b8;font-size:11px}
.slot .who b{display:block}
.estado{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.03em}
.e-agendada{background:#dbeafe;color:#1d4ed8}.e-confirmada{background:#e0e7ff;color:#4338ca}
.e-recepcionada{background:#fef3c7;color:#b45309}.e-atendida{background:#d1fae5;color:#047857}
.e-anulada,.e-no_asistio{background:#f1f5f9;color:#64748b}
.e-ingresado{background:#fef3c7;color:#b45309}.e-alta{background:#d1fae5;color:#047857}.e-preingreso{background:#dbeafe;color:#1d4ed8}
.e-generada{background:#dbeafe;color:#1d4ed8}.e-pagada{background:#d1fae5;color:#047857}.e-copago,.e-enviada_financiador{background:#fef3c7;color:#b45309}
.e-final{background:#d1fae5;color:#047857}.e-preliminar{background:#fef3c7;color:#b45309}.e-enmendado{background:#e0e7ff;color:#4338ca}
.st-high{background:#ffedd5;color:#c2410c}.st-crit{background:#dc2626;color:#fff}
.high{color:#c2410c}
.kpi{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:16px}
.kpi .card{padding:14px 16px}
.kpi b{display:block;font-size:22px;font-variant-numeric:tabular-nums}
.kpi span{font-size:12px;color:#64748b}
.cols2{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}
.sections p{white-space:pre-wrap;margin-top:4px;color:#334155}
.sections h4{font-size:12px;text-transform:uppercase;color:#64748b;letter-spacing:.04em;margin-top:12px}
.vers{border-left:3px solid #e2e8f0;padding-left:12px;margin-top:16px}
.vers.final,.vers.enmendado{border-color:#10b981}
.mt{margin-top:16px}.mt8{margin-top:8px}
.num{font-variant-numeric:tabular-nums}
.none{padding:16px;text-align:center;color:#94a3b8;font-size:13px}
.lines td input{width:80px;padding:6px 8px;border:1px solid #cbd5e1;border-radius:8px;font:inherit}
.tag-sm{font-size:11px;padding:1px 6px;border-radius:6px;background:#f1f5f9;color:#475569}
@media(max-width:900px){.cols2,.grid3,.grid4{grid-template-columns:1fr 1fr}}
@media(max-width:720px){.cols2,.grid2,.grid3,.grid4{grid-template-columns:1fr}.nav span{display:none}.slot{grid-template-columns:64px 1fr}.slot .acts{grid-column:1/-1}}
#app{flex:1;display:flex;flex-direction:column}#vista{flex:1;display:flex;flex-direction:column}#vista>main{flex:1}
