
:root{--bg:#f4efe3;--card:#fffdf8;--line:#ddd6c7;--ink:#24302a;--muted:#727970;--blue:#1f6ea5;--green:#5f7d49}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,system-ui,Segoe UI,Arial,sans-serif}
button,input{font:inherit}.topbar{position:sticky;top:0;z-index:30;background:linear-gradient(135deg,#173f63,#2276aa);color:#fff;padding:15px max(14px,calc((100vw - 1180px)/2));display:flex;justify-content:space-between;gap:20px;align-items:center;box-shadow:0 8px 24px rgba(23,63,99,.18)}
.brand{display:flex;align-items:center;gap:13px}.logo{width:66px;height:66px;object-fit:contain;background:#fff;border-radius:15px;padding:5px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:.12em;opacity:.8}.topbar h1{margin:1px 0 2px;font-size:27px}.topbar p{margin:0;font-size:13px;opacity:.85}
.statusbox{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;font-size:13px}.dot{width:10px;height:10px;border-radius:50%;background:#ebb439}.dot.online{background:#32d086}.dot.offline{background:#ebb439}#pendingBadge{background:rgba(255,255,255,.14);padding:7px 10px;border-radius:999px}
.shell{max-width:1180px;margin:auto;padding:18px 16px 90px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:11px;margin-bottom:14px}.stats article,.card{background:var(--card);border:1px solid var(--line);border-radius:15px;box-shadow:0 8px 24px rgba(43,51,43,.05)}
.stats article{padding:14px 16px;border-left:5px solid #668057}.stats span{font-size:12px;color:var(--muted)}.stats b{display:block;font-size:27px;margin-top:4px}
.card{padding:18px;margin-bottom:14px}.head{margin-bottom:14px}.head h2{margin:0 0 4px;font-size:18px}.head p{margin:0;color:var(--muted);font-size:13px;line-height:1.45}.split{display:flex;justify-content:space-between;gap:15px;align-items:flex-start}
.searchrow{display:flex;gap:10px;align-items:end}.grow{flex:1}label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:720}input{min-height:44px;border:1px solid #cfd6cc;border-radius:10px;padding:11px 12px;background:#fff;outline:none}input:focus{border-color:#2b79ad;box-shadow:0 0 0 3px rgba(43,121,173,.12)}
.btn{border:0;border-radius:10px;padding:11px 16px;min-height:44px;font-weight:850;cursor:pointer}.primary{background:var(--blue);color:#fff}.soft{background:#e9efea;color:#35513d}.save{background:#567442;color:#fff;min-width:310px}.small{min-height:36px;padding:8px 11px;font-size:12px}
.patienthead{display:flex;justify-content:space-between;gap:15px;align-items:flex-start}.patienthead h2{margin:2px 0;font-size:25px}.muted{font-size:12px;color:var(--muted)}.band{padding:9px 14px;border-radius:999px;background:#eef1eb;border:1px solid #d8ded5;font-size:13px;font-weight:850}.band.blue{background:#eaf5fd;border-color:#a7d1eb;color:#145e8f}.band.yellow{background:#fff8d9;border-color:#ead581;color:#7a5a00}.band.green{background:#edf7e8;border-color:#b9d4aa;color:#3f6a2d}
.info{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-top:14px}.info div{background:#f6f7f3;border:1px solid #e0e4dc;border-radius:10px;padding:10px}.info span{display:block;font-size:11px;color:var(--muted);margin-bottom:3px}.info b{font-size:14px}.twocol{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.servicegrid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.service{position:relative;display:flex;flex-direction:row;align-items:center;gap:9px;border:1px solid #d7ded3;border-radius:12px;padding:14px;background:#fbfcf9;cursor:pointer;min-height:58px}.service input{width:19px;height:19px;min-height:0;accent-color:#587944}.service:has(input:checked){background:#eef5e9;border-color:#789262}.service.existing{background:#edf0eb;opacity:.75}.service.existing::after{content:'YA DIRECCIONADO';position:absolute;right:7px;top:5px;font-size:8px;font-weight:900;color:#68805a}
.chips{display:flex;gap:7px;flex-wrap:wrap}.chip{padding:7px 10px;border-radius:999px;background:#edf2ea;border:1px solid #d8e0d2;font-size:12px}.emptychip{color:var(--muted)}.empty{text-align:center;padding:8px}.empty h2{margin:0 0 5px}.empty p{color:var(--muted)}
.msg{padding:10px 12px;border-radius:10px;margin-top:12px;font-size:13px}.msg.info{background:#eaf3f9;color:#285d7c;border:1px solid #c8deec}.msg.success{background:#e8f5ee;color:#245e49;border:1px solid #c9e4d6}.msg.warning{background:#fff5dc;color:#795a18;border:1px solid #edd79d}.msg.error{background:#fff0f0;color:#873737;border:1px solid #e8c4c4}.hidden{display:none!important}
.sticky{position:sticky;bottom:0;z-index:20;background:rgba(244,239,227,.95);backdrop-filter:blur(10px);border-top:1px solid rgba(115,120,105,.15);padding:12px 0;display:flex;align-items:center;justify-content:flex-end;gap:12px}.sticky .msg{margin:0;flex:1}
#toasts{position:fixed;right:16px;bottom:16px;z-index:60}.toast{background:#1e2e25;color:#fff;padding:11px 13px;border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.18)}
@media(max-width:850px){.stats{grid-template-columns:1fr 1fr}.servicegrid{grid-template-columns:1fr 1fr}.info{grid-template-columns:1fr 1fr}}
@media(max-width:620px){.topbar{align-items:flex-start}.logo{width:51px;height:51px}.topbar h1{font-size:23px}.statusbox{max-width:145px}.stats{gap:8px}.stats article{padding:11px}.stats b{font-size:22px}.searchrow,.twocol,.servicegrid{display:grid;grid-template-columns:1fr}.patienthead{display:block}.band{display:inline-block;margin-top:8px}.split{display:block}.split .btn{width:100%;margin-top:10px}.sticky{display:block}.save{width:100%;min-width:0}.sticky .msg{margin-bottom:8px}}
