
:root{color-scheme:light;--bg:#FAF8F3;--ink:#0F2D3D;--green:#2E7D66;--teal:#6CB7A7;--stone:#E7E3DA;--panel:#fffefa;--muted:#536775;--soft:#eaf2ec;--border:#e6e3dc;--amber-bg:#fff0d5;--amber-text:#78500c;--shadow:0 3px 16px #182c3810;--nav:#fffdf8}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,'Segoe UI',sans-serif;font-size:16px;line-height:1.5}html[data-theme=dark]{color-scheme:dark;--bg:#10232e;--ink:#f1f5f4;--panel:#172f3b;--muted:#b4c9d2;--soft:#1b3d45;--border:#304854;--stone:#304854;--green:#6CB7A7;--amber-bg:#443923;--amber-text:#f4ce7f;--shadow:0 3px 16px #0002;--nav:#132934}button,input,select,textarea{font:inherit}button,a,input,select,textarea{touch-action:manipulation}button{cursor:pointer;border:1px solid var(--border);border-radius:12px;min-height:44px;padding:10px 17px;background:var(--panel);color:var(--ink);font-weight:600}button:hover{filter:brightness(.96)}button:disabled{opacity:.35;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid var(--teal);outline-offset:3px}a{color:var(--green)}h1,h2,h3,p{margin-top:0}h1{font-size:34px;line-height:1.2;letter-spacing:-1px;margin-bottom:8px}h2{font-size:22px;line-height:1.3;margin-bottom:16px}h3{font-size:17px;margin-bottom:12px}p{margin-bottom:14px}small,.muted{color:var(--muted)}small{font-size:14px}header{max-width:1180px;margin:auto;padding:24px 36px;display:flex;justify-content:space-between;align-items:center}.brand{text-decoration:none;font-weight:750;font-size:29px;color:var(--ink);letter-spacing:-1.2px;display:flex;gap:10px;align-items:center}.brand-mark{display:inline-grid;place-items:center;background:var(--green);color:var(--bg);width:34px;height:32px;border-radius:9px;position:relative;font-size:24px}.brand-mark:before{content:'';position:absolute;top:-9px;border:3px solid var(--green);border-bottom:0;width:14px;height:13px;border-radius:9px 9px 0 0}.header-actions{display:flex;align-items:center;gap:10px}.local-label{font-size:14px;color:var(--muted);margin-right:12px}main{max-width:1180px;margin:auto;padding:22px 36px 120px}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:26px}.page-heading p{color:var(--muted);margin-bottom:0}.date-label:first-letter,.capitalize:first-letter{text-transform:uppercase}.date-control{display:flex;gap:5px;align-items:center}.date-control input{width:auto;max-width:180px;background:var(--panel);padding:8px 10px}.icon{padding:6px;min-width:44px;font-size:23px;background:transparent;border-color:transparent}.text{background:transparent;border-color:transparent;color:var(--green);font-size:15px;padding:8px 10px}.primary{background:var(--green);border-color:var(--green);color:#fff}.secondary{background:var(--soft);color:var(--ink)}html[data-theme=dark] .primary{color:#102b35}.full{width:100%;margin-top:8px}.dashboard{display:grid;grid-template-columns:340px 1fr;gap:34px;align-items:start}.progress-card{background:var(--soft);border:1px solid var(--border);border-radius:22px;padding:20px;margin-bottom:24px}.progress-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.progress-top .text{font-size:14px;padding-right:0}.progress-body{display:flex;align-items:center;gap:17px;margin:15px 0}.progress-body>div:not(.ring){display:flex;flex-direction:column;gap:3px}.progress-body strong{font-size:17px}.progress-body span{font-size:14px}.ring{width:78px;height:78px;border-radius:50%;background:conic-gradient(var(--green) var(--progress),var(--stone) 0);display:grid;place-items:center;flex-shrink:0}.ring>span{border-radius:50%;width:62px;height:62px;background:var(--soft);display:grid;place-content:center;grid-auto-flow:column;align-items:baseline;font-weight:700;font-size:23px}.ring small{font-size:12px;color:var(--ink)}.portfolio-total{margin-left:auto;padding-left:13px;border-left:1px solid var(--border);max-width:110px}.portfolio-total strong{font-size:24px}.progress-card p{font-size:13px;color:var(--muted);margin:0}.aside-note{padding:5px 6px}.aside-note p{color:var(--muted);margin-top:10px}.tabs{display:flex;border:1px solid var(--border);border-radius:30px;margin-bottom:25px;padding:4px;background:var(--panel)}.tabs button{flex:1;border:0;border-radius:25px;background:transparent;font-size:15px}.tabs button.active{background:var(--green);color:#fff}html[data-theme=dark] .tabs button.active{color:#102b35}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:15px}.section-heading h2{margin:0}.section-heading small,.place-group h3 small{margin-left:6px;font-weight:400}.place-group{margin-bottom:24px}.place-group h3{font-size:17px;margin-bottom:10px}.pin{color:var(--green);font-size:23px}.doctor-card{border:1px solid var(--border);border-radius:18px;background:var(--panel);box-shadow:var(--shadow);margin-bottom:12px;overflow:hidden}.card-main{display:flex;align-items:center;text-align:left;border:0;border-radius:0;background:transparent;width:100%;padding:17px 17px 10px;gap:13px;font-weight:400}.avatar{background:var(--soft);color:var(--green);border-radius:50%;width:44px;height:44px;flex-shrink:0;display:grid;place-items:center;font-size:15px;font-weight:650}.card-copy{min-width:0;display:flex;flex-direction:column;gap:4px}.card-copy strong{text-transform:capitalize;font-size:17px;line-height:1.35;font-weight:650}.card-copy>span{font-size:14px;line-height:1.4;color:var(--muted);overflow-wrap:anywhere}.card-copy .place-line{color:var(--ink);font-weight:600}.card-copy .address-line{color:var(--muted)}.card-copy .hours{font-size:15px;color:var(--ink)}.chevron{margin-left:auto;font-size:24px;color:var(--muted)}.card-bottom{margin:0 17px 8px 74px;display:flex;align-items:center;justify-content:space-between;gap:5px}.badge{display:inline-block;font-size:12px;padding:4px 9px;border-radius:8px;background:var(--soft);color:var(--ink);font-weight:500}.badge.amber{background:var(--amber-bg);color:var(--amber-text)}.badge.green{background:var(--soft);color:var(--green)}.done .avatar{background:var(--stone)}.doctor-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 20px}.search-row{display:flex;gap:15px}.search{flex:1}.search-row input{padding:14px 18px}input,textarea,select{display:block;width:100%;border:1px solid var(--border);border-radius:10px;padding:11px 13px;background:var(--panel);color:var(--ink);min-height:46px}textarea{resize:vertical}label{display:block;font-size:15px;font-weight:500;margin-bottom:14px}label input,label textarea,label select{margin-top:6px}.date-control label{margin:0}.date-control input{margin:0}.panel{padding:23px;background:var(--panel);border:1px solid var(--border);border-radius:19px;box-shadow:var(--shadow);margin-bottom:20px}.panel p:last-child{margin-bottom:0}.detail-layout,.route-layout,.calendar-layout{display:grid;grid-template-columns:1.3fr 1fr;gap:28px;align-items:start}.identity{display:flex;gap:20px;align-items:center}.identity h2{text-transform:capitalize;margin-bottom:6px}.identity p{margin-bottom:8px}.large{width:66px;height:66px;font-size:23px}.history-row{border-top:1px solid var(--border);padding:14px 0 0;margin-top:14px}.history-row .badge{float:right}.history-row p{margin:8px 0}.history-row small{display:block}.preserve{white-space:pre-wrap;overflow-wrap:anywhere}.back{padding-left:0;margin-bottom:12px}.route-summary{display:flex;align-items:center;justify-content:space-between;gap:20px;background:var(--soft);padding:18px 22px;border-radius:17px;margin-bottom:27px}.route-summary strong{font-size:24px}.route-summary>span{font-size:14px;color:var(--muted)}.route-item{display:flex;gap:13px;align-items:flex-start}.route-item>.doctor-card{flex:1;min-width:0}.number{background:var(--green);color:var(--bg);width:30px;height:30px;border-radius:50%;display:grid;place-items:center;margin-top:24px;flex-shrink:0}.route-controls{display:flex;gap:0;align-items:center}.suggestion{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid var(--border);padding:13px 0;text-transform:capitalize}.suggestion small{display:block}.route-layout aside h3{margin-top:25px}.calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}.calendar button{padding:7px 2px;border:0;background:transparent;min-width:0;font-weight:500}.calendar button small{display:block;line-height:12px;color:var(--green);height:13px}.calendar .selected{background:var(--green);color:var(--bg)}.calendar .selected small{color:inherit}.weekday{text-align:center;font-size:13px;color:var(--muted);padding:8px}.calendar-layout .panel>p{font-size:13px;margin-top:16px}.empty{border:1px dashed var(--border);border-radius:20px;padding:34px 24px;text-align:center;margin-bottom:22px}.empty>span{font-size:34px;color:var(--green)}.empty h3{margin-top:8px}.empty p{color:var(--muted);max-width:440px;margin:0 auto}.callout{background:var(--amber-bg);color:var(--amber-text);border-radius:15px;padding:15px}.callout .text{color:inherit}nav{position:fixed;bottom:0;left:0;right:0;display:flex;justify-content:center;gap:40px;background:var(--nav);border-top:1px solid var(--border);padding:10px 20px max(12px,env(safe-area-inset-bottom));z-index:10}nav a{font-size:13px;min-width:100px;min-height:50px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-decoration:none;color:var(--muted);gap:1px;border-radius:12px}nav a>span{font-size:23px;line-height:28px}nav a[aria-current]{color:var(--green);background:var(--soft);font-weight:650}dialog{width:min(560px,calc(100% - 24px));max-height:90dvh;overflow:auto;border:1px solid var(--border);border-radius:22px;padding:26px;color:var(--ink);background:var(--bg);box-shadow:0 20px 80px #0004}dialog::backdrop{background:#071c2b88;backdrop-filter:blur(3px)}.dialog-head{display:flex;justify-content:flex-end;margin:-12px -10px -6px}.checkbox{display:flex;align-items:center;gap:12px;margin:20px 0}.checkbox input{width:22px;min-height:22px;margin:0}.scroll-list{max-height:280px;overflow:auto;background:var(--panel);border-radius:12px;padding:8px 15px;margin:20px 0}summary{cursor:pointer;font-weight:650;min-height:44px;padding:9px 0}details pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px}.issue{border-top:1px solid var(--border);padding:15px 0}.issue p{font-size:14px;margin:5px 0}.file-label input{font-size:14px}hr{border:0;border-top:1px solid var(--border);margin:24px 0}#notice{position:fixed;left:50%;bottom:100px;transform:translateX(-50%);max-width:calc(100% - 24px);background:var(--ink);color:var(--bg);padding:12px 20px;border-radius:13px;box-shadow:var(--shadow);z-index:100;opacity:0;pointer-events:none}#notice.show{opacity:1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.loading{padding:40px}.panel ul{padding-left:20px}button+button.full{margin-top:12px}@media(max-width:800px){header{padding:24px 20px 15px}main{padding:15px 20px 110px}.brand{font-size:25px}.dashboard,.detail-layout,.route-layout,.calendar-layout{grid-template-columns:1fr;gap:6px}.dashboard .aside-note{display:none}.page-heading{align-items:flex-start;flex-direction:column;gap:14px;margin-bottom:20px}h1{font-size:29px}.date-label{font-size:14px}.date-control{width:100%;justify-content:space-between}.date-control input{max-width:190px}.progress-card{padding:15px 18px;margin-bottom:20px}.progress-body{margin:8px 0 14px;gap:20px}.progress-body span{font-size:15px}.portfolio-total{max-width:none}.ring{width:72px;height:72px}.ring>span{width:58px;height:58px}.tabs{margin-bottom:20px}.doctor-grid{grid-template-columns:1fr}.local-label{display:none}.header-actions{gap:0}.search-row{flex-direction:column;gap:0}.search-row label{margin-bottom:9px}.route-summary{flex-wrap:wrap;gap:10px;font-size:15px}.route-summary>span{width:100%;order:3}.route-summary button{font-size:14px;padding:8px}.panel{padding:20px}.calendar-layout{gap:20px}nav{gap:0;padding:7px 8px max(9px,env(safe-area-inset-bottom))}nav a{min-width:0;flex:1;font-size:12px}.card-main{padding:15px 13px 8px;gap:11px}.card-bottom{margin-left:68px;margin-right:12px}.card-copy strong{font-size:16px}.avatar{width:42px;height:42px}.card-bottom .text{font-size:13px;padding:8px 4px}.card-bottom .badge{font-size:11px}.route-item{gap:7px}.route-item .avatar{display:none}.route-item .card-bottom{margin-left:12px}.number{width:25px;height:25px;font-size:14px}.section-heading h2{font-size:20px}.identity{gap:14px}.identity .large{width:58px;height:58px}.identity h2{font-size:22px}dialog{padding:20px}.calendar{gap:3px}.portfolio-total strong{font-size:23px}}@media(prefers-reduced-motion:no-preference){button,a{transition:background .15s,color .15s}#notice{transition:opacity .15s}}

/* Keep the portfolio summary legible at narrow widths. */
.progress-body{display:grid;grid-template-columns:72px 1fr;gap:12px 18px}.progress-body .portfolio-total{grid-column:1 / -1;max-width:none;margin:0;padding:10px 0 0;border-left:0;border-top:1px solid var(--border);flex-direction:row!important;align-items:baseline;gap:7px!important}.progress-body .portfolio-total strong{font-size:16px}.progress-body .portfolio-total span{font-size:14px}.progress-body>div:nth-child(2){gap:5px}.progress-body>div:nth-child(2) strong{white-space:nowrap}.progress-body .ring{width:72px;height:72px}.progress-body .ring>span{width:58px;height:58px}
.status-stack{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.note-badge{display:inline-block;background:var(--amber-bg);color:var(--amber-text);border-radius:8px;padding:4px 9px;font-size:12px;font-weight:650}.has-note{border-color:#f4b94288}.note-alert{background:var(--amber-bg);border-color:#f4b94288;color:var(--ink)}.note-alert h3{color:var(--amber-text)}.note-alert p{font-size:17px;margin-bottom:0}
.cadence-line{display:block;color:var(--muted);font-size:14px;margin-top:5px}.tracking-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.tracking-grid div{background:var(--soft);border-radius:12px;padding:13px}.tracking-grid small{display:block;margin-bottom:4px}.tracking-grid strong{display:block}@media(max-width:520px){.tracking-grid{grid-template-columns:1fr}}
:root{--auth-width:420px}
.auth-page{min-height:80vh;display:grid;place-items:center;padding:2rem}.auth-card{width:min(100%,var(--auth-width));padding:2rem}.auth-card h1{margin-top:0}.auth-card form{display:grid;gap:.85rem;margin:1rem 0}.auth-card details{margin-top:1.5rem}.auth-card .callout:empty{display:none}
.danger-panel{border-color:#d5a09c}.danger-panel h3{color:#a84945}.danger-panel p{color:var(--muted)}button.danger{background:#a84945;border-color:#a84945;color:#fff}html[data-theme=dark] .danger-panel{border-color:#986761}html[data-theme=dark] .danger-panel h3{color:#eab3ad}html[data-theme=dark] button.danger{background:#a14f4a;border-color:#a14f4a;color:#fff}

.card-note{margin:0 14px 12px;padding:12px;border-radius:12px;overflow-wrap:anywhere}.card-note p{white-space:pre-wrap;margin:5px 0 0}.reminder-note{background:var(--amber-bg);color:var(--amber-text)}.fixed-note{background:var(--soft);border:1px solid var(--teal);color:var(--ink)}

.absence-note{background:#fbe5e1;color:#7b3630;border:1px solid #d7a29b;border-radius:12px;padding:12px}.doctor-card.is-absent{background:#fff5f3;border:2px solid #d7a29b}.doctor-card.is-absent.done{opacity:1}html[data-theme=dark] .absence-note{background:#432b2a;color:#f2ccc5;border-color:#a96f67}html[data-theme=dark] .doctor-card.is-absent{background:#302323;border-color:#a96f67}
.proximity-switch{flex-wrap:wrap;gap:10px;font-weight:700}
.location-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0}
.location-map{height:270px;width:100%;isolation:isolate;border-radius:12px;border:1px solid #9aa9b2;margin:12px 0;color:#172e3b;background:#e9edf0}
.location-map[hidden]{display:none}
.location-map .leaflet-control-attribution{font-size:11px;background:#ffffffe8;color:#333}
.location-map .leaflet-control-attribution a{color:#165c88}
.consultorio-marker{display:grid;place-items:center;border:3px solid white;border-radius:50%;background:#176d7d;color:white;box-shadow:0 1px 6px #0008;font-size:14px}
.location-form details{margin:12px 0}.location-form summary,.route-locations summary{cursor:pointer;font-weight:600}
.location-form .checkbox{margin:16px 0}.geo-results button,.route-locations button{margin-top:8px;white-space:normal;text-align:left}
.location-editor h3{margin-top:16px}.map-error:empty,.location-feedback:empty{display:none}
.map-error,.location-feedback{font-size:14px}.proximity-status{font-weight:600}
@media(max-width:600px){.location-fields{grid-template-columns:1fr}.location-map{height:240px}}
.route-card-wrap{flex:1;min-width:0}.route-card-wrap>.doctor-card{width:100%}
.schedule-fields{border:1px solid var(--border);border-radius:14px;padding:14px;margin:18px 0}.schedule-fields legend{font-weight:700;padding:0 6px}.schedule-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.schedule-day{background:var(--panel);border:1px solid var(--border);border-radius:10px;padding:10px}.schedule-day .checkbox{margin:0 0 8px}.schedule-day label:last-child{margin:0}.schedule-day textarea{margin-top:4px}.schedule-day textarea:disabled{opacity:.45}.schedule-detail{display:flex;gap:14px;align-items:flex-start;border-top:1px solid var(--border);padding:10px 0;margin:0}.schedule-detail strong{min-width:95px}.schedule-detail span{overflow-wrap:anywhere}@media(max-width:540px){.schedule-grid{grid-template-columns:1fr}}
.cycle-alert{display:grid;gap:3px;margin-top:14px;padding:12px 14px;border:1px solid var(--amber-text);border-radius:12px;background:var(--amber-bg);color:var(--amber-text);font-size:14px;line-height:1.4}.cycle-alert strong{font-size:15px}.cycle-alert span{color:var(--ink)}
.boot-screen{min-height:100vh;min-height:100dvh;display:grid;place-items:center;background:#10232e;color:#f1f5f4;padding:32px}.boot-content{display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center}.boot-brand{display:flex;align-items:center;gap:15px;font-size:clamp(30px,6vw,42px);font-weight:750;letter-spacing:-.04em}.boot-brand .brand-mark{--green:#6cb7a7;--bg:#10232e;width:48px;height:46px;font-size:32px;letter-spacing:0}.boot-brand .brand-mark:before{width:20px;height:16px;top:-12px}.boot-subtitle{color:#a7c7c8;font-size:14px;letter-spacing:.07em}.boot-progress{display:block;width:136px;height:3px;margin-top:24px;overflow:hidden;border-radius:99px;background:#34535c}.boot-progress span{display:block;width:40%;height:100%;border-radius:inherit;background:#6cb7a7;animation:boot-move 1.4s ease-in-out infinite alternate}@keyframes boot-move{from{transform:translateX(0)}to{transform:translateX(150%)}}@media(prefers-reduced-motion:reduce){.boot-progress span{animation:none;width:100%}}
.calendar-route-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.calendar-route-actions button{margin:0}
.schedule-fields summary{display:list-item;list-style:disclosure-closed;margin:0;font-weight:700}.schedule-fields[open] summary{list-style:disclosure-open;margin-bottom:12px}.schedule-fields summary small{font-weight:400;margin-left:8px}.schedule-fields>label{margin-top:12px}
.save-status{min-width:82px;color:var(--muted);font-size:13px;text-align:right}.save-status.saving{color:var(--amber-text)}.save-status.saved{color:var(--teal)}.save-status.error{color:#c96058}.is-saving button[data-action],.is-saving form button{pointer-events:none;opacity:.65}.route-summary-actions,.route-quick-actions,.map-options{display:flex;gap:8px;flex-wrap:wrap}.route-quick-actions{margin:8px 0 14px}.route-quick-actions button{margin:0}.map-options{display:grid;margin:16px 0}.map-options a{display:grid;place-items:center;min-height:44px;padding:10px 17px;border:1px solid var(--border);border-radius:12px;text-align:center;text-decoration:none;font-weight:600}.map-options a.primary{border-color:var(--green)}.doctor-filters{grid-template-columns:minmax(220px,1fr) auto auto}.move-list{display:grid;gap:8px;margin:14px 0}.move-list .checkbox{margin:0;padding:8px;border-bottom:1px solid var(--border)}@media(max-width:760px){.doctor-filters{grid-template-columns:1fr}.route-summary-actions{width:100%}.route-summary-actions button{flex:1}.save-status{position:absolute;top:66px;right:18px;background:var(--bg);padding:3px 7px;border-radius:8px}.route-quick-actions button{flex:1}}
.visit-fixed-note{margin:16px 0;padding:14px;border:1px solid var(--border);border-radius:12px;background:var(--panel)}.visit-fixed-note .checkbox{margin:0 0 10px}.visit-fixed-note textarea:disabled{opacity:.72;background:var(--soft)}
.today-unscheduled{margin:0 0 22px;padding:12px 14px;border:1px solid var(--border);border-radius:12px;background:var(--soft)}.unscheduled-today{margin-top:32px;padding-top:24px;border-top:1px solid var(--border)}
button.visit-edit{background:var(--amber-bg);border-color:var(--amber-text);color:var(--amber-text)}
.sector-line{display:block;color:var(--muted);font-size:14px}.sector-line strong{color:var(--ink)}
