:root{--blue:#164e9b;--navy:#12335c;--ink:#192b43;--muted:#61738a;--line:#dce4ed;--bg:#f3f6fa;--white:#fff;--green:#176445;--red:#a92e3d}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.55 system-ui,-apple-system,Segoe UI,sans-serif}button,input,select,textarea{font:inherit}button,a,input,select,textarea{touch-action:manipulation}button{border:0;border-radius:9px;padding:12px 19px;background:var(--blue);color:white;font-weight:650;cursor:pointer;min-height:46px}button:hover{filter:brightness(.94)}button:disabled{opacity:.5;cursor:wait}button.secondary{background:#eaf0f8;color:var(--blue)}button.danger{background:#fff0f1;color:var(--red)}button.quiet{background:transparent;color:inherit;border:1px solid #ffffff50}input,select,textarea{width:100%;min-height:48px;border:1px solid #c4d1df;border-radius:8px;background:white;padding:10px 12px;color:var(--ink)}input:focus,select:focus,textarea:focus,button:focus-visible{outline:3px solid #82b5fd;outline-offset:2px}input[type=checkbox],input[type=radio]{width:20px;min-height:20px;vertical-align:middle}label{display:block;font-weight:600;margin:12px 0}label small{display:block;font-weight:400;color:var(--muted)}h1{font-size:32px;line-height:1.2;letter-spacing:-.8px;margin:10px 0 12px}h2{font-size:20px;line-height:1.3;margin:0 0 12px}h3{font-size:16px;margin:0 0 5px}p{margin:8px 0 16px}.top{min-height:86px;background:var(--navy);color:white;padding:18px 30px;display:flex;justify-content:space-between;align-items:center;gap:20px}.brand{display:flex;align-items:center;gap:12px;font-size:20px;letter-spacing:1px;font-weight:750}.brandmark{border:1px solid #819cbd;border-radius:8px;padding:7px;font-size:18px}.brand small{display:block;font-size:10px;letter-spacing:1.7px;font-weight:500;color:#c0d0e5}.top-right{display:flex;align-items:center;gap:16px;font-size:13px}.pill,.badge{display:inline-block;border-radius:30px;padding:5px 10px;font-size:11px;font-weight:750;letter-spacing:.6px;background:#e7eef9;color:#194a8e}.top .pill{background:#ffffff14;color:#e3edff;border:1px solid #ffffff35}.shell{display:flex;max-width:1500px;margin:auto;min-height:calc(100vh - 155px)}nav{width:216px;flex-shrink:0;padding:32px 18px;border-right:1px solid var(--line)}nav button{width:100%;text-align:left;background:transparent;color:var(--muted);margin:4px 0}nav button.active{background:#e1ebfa;color:var(--blue)}main{width:100%;min-width:0;padding:32px;max-width:1250px}.eyebrow{font-size:11px;color:var(--blue);letter-spacing:1.5px;font-weight:750}.subtitle{color:var(--muted);max-width:760px}.card{background:white;border:1px solid var(--line);border-radius:14px;padding:24px;margin:18px 0;box-shadow:0 2px 3px #17314e03}.grid{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(0,1fr);gap:24px;align-items:start}.grid .card{margin-top:0}.row{display:flex;gap:14px;align-items:end;flex-wrap:wrap}.row>*{flex:1;min-width:160px}.row .fit{flex:0 0 auto;min-width:auto}.step{display:flex;align-items:center;gap:10px;margin:10px 0 16px}.step span{display:inline-grid;place-items:center;width:27px;height:27px;border-radius:50%;background:#e8f0ff;color:var(--blue);font-weight:700}.step h2{margin:0;font-size:17px}.step.disabled{opacity:.5}.muted{color:var(--muted);font-size:13px}.empty{padding:28px 12px;text-align:center;background:#f6f8fb;border:1px dashed #c9d5e5;border-radius:10px;color:var(--muted)}.visit{padding:16px 0;border-bottom:1px solid var(--line)}.visit:last-child{border:0}.visit-head{display:flex;justify-content:space-between;gap:10px}.visit select{max-width:145px;min-height:40px;padding:6px}.visit button{min-height:40px;padding:7px 10px;font-size:12px}.actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}.actions button{flex:1}.status-confirmed,.status-none,.status-simulated{background:#e6f5ed;color:#176445}.status-draft,.status-pending{background:#fff3d9;color:#815410}.status-blocked,.status-cancelled{background:#ffecef;color:#a12c3c}.success,.error,.info{padding:13px 16px;border-radius:8px;margin:0 0 18px}.success{background:#e5f4ec;color:#176445}.error{background:#ffedef;color:#a12c3c}.info{background:#eaf1fc;color:#234d88}table{border-collapse:collapse;width:100%;font-size:13px}td,th{text-align:left;border-bottom:1px solid var(--line);padding:13px 10px;vertical-align:top}th{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.5px}.tablewrap{overflow:auto}.stats{display:flex;gap:16px;margin:20px 0}.stat{background:white;border:1px solid var(--line);border-radius:12px;padding:16px 22px;flex:1}.stat strong{display:block;font-size:27px;color:var(--navy)}.login{max-width:420px;margin:60px auto}.login button{width:100%;margin-top:12px}.hidden{display:none!important}footer{font-size:12px;padding:16px 30px;color:var(--muted);border-top:1px solid var(--line)}.checkgroup{display:flex;flex-wrap:wrap;gap:0 15px}.checkgroup label{font-size:13px}.setup{max-width:760px;margin:auto}.tabs{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.tabs button{background:#e6edf7;color:var(--blue)}pre{white-space:pre-wrap;word-break:break-word;font-size:12px}details{margin:12px 0}summary{cursor:pointer;color:var(--blue)}.full{width:100%}.notice-line{border-left:3px solid #9ab7df;padding-left:12px;font-size:13px;color:var(--muted)}@media(max-width:900px){.top{padding:16px 20px}.top-right{gap:8px}.top .pill{display:none}nav{width:175px;padding:24px 10px}main{padding:24px}.grid{grid-template-columns:1fr;gap:0}}@media(max-width:600px){.top{align-items:flex-start;padding:15px}.brand{font-size:17px}.brand small{font-size:8px}.brandmark{display:none}.top-right{flex-direction:column;align-items:flex-end;font-size:11px}.top-right button{min-height:32px;padding:4px 12px}.shell{display:block}nav{width:100%;display:flex;overflow:auto;gap:4px;border-right:0;border-bottom:1px solid var(--line);padding:8px}nav button{width:auto;white-space:nowrap;padding:8px 12px;min-height:42px;font-size:12px}main{padding:20px 15px}h1{font-size:27px}.card{padding:18px}.stats{gap:8px}.stat{padding:12px}.stat strong{font-size:24px}.stat span{font-size:11px}.row{gap:0}.row>*{min-width:100%}.actions{flex-direction:column}.visit-head{flex-direction:column;gap:5px}.login{margin:25px auto}footer{padding:16px;font-size:11px}.pill{font-size:10px}}
dialog{border:1px solid var(--line);border-radius:14px;max-width:min(500px,94vw);color:var(--ink);padding:24px}dialog::backdrop{background:#102b4dcc}#reauth-error{color:var(--red)}

/* RC6: keep the native date picker inside its card on narrow screens. */
@media(max-width:600px){
 #date{display:block;box-sizing:border-box;width:240px;max-width:100%;min-width:0;min-inline-size:0;-webkit-appearance:none;appearance:none;font-size:16px;min-height:48px;}
 #date::-webkit-date-and-time-value{text-align:left;min-width:0;}
}

/* Mobile: programação com leitura clara e sem alargar a página. */
.schedule-summary{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:16px;align-items:center}
.schedule-summary>*,.grid>*,.visit-head>*{min-width:0}
.schedule-summary label{margin:0}
.schedule-summary #schedule-alert{grid-column:1/-1}
.schedule-summary #schedule-alert:empty{display:none}
#schedule-status{max-width:100%}
.schedule-warning{margin:0;white-space:normal;overflow-wrap:anywhere}
.schedule-technician h3{margin:3px 0 0}
.schedule-help{border-top:1px solid var(--line);margin-top:20px;padding-top:14px;font-size:13px;color:var(--muted)}
.schedule-help summary{font-weight:600;font-size:13px}
.schedule-help p{margin:12px 0 0;white-space:normal;overflow-wrap:anywhere}
.schedule-history{margin-top:4px}
@media(max-width:600px){
 body{-webkit-text-size-adjust:100%}
 .top{padding:16px;gap:12px;align-items:center;min-height:82px}
 .brand{min-width:0;font-size:15px;letter-spacing:.65px;line-height:1.35}
 .brand small{font-size:9px;letter-spacing:1.3px;margin-top:5px}
 .top-right{flex-shrink:0;font-size:11px;gap:5px;max-width:38%;text-align:right}
 .top-right button{min-height:36px;padding:6px 12px}
 nav{padding:8px 12px;gap:6px;background:#fff}
 nav button{font-size:13px;padding:10px 13px;margin:0;min-height:44px}
 main{padding:24px 16px;max-width:100%}
 #content,.card,.grid,.row,.row>*,.row .fit{min-width:0;max-width:100%}
 h1{font-size:26px;line-height:1.2;letter-spacing:-.6px;margin:8px 0 10px;overflow-wrap:anywhere}
 .eyebrow{font-size:10px;letter-spacing:1.3px}
 .subtitle{font-size:14px;line-height:1.55;margin-bottom:20px}
 .card{padding:20px 18px;border-radius:16px;margin:16px 0;box-shadow:0 3px 12px #17314e05}
 .schedule-summary{grid-template-columns:minmax(0,1fr) auto;gap:15px 12px;align-items:center}
 .schedule-summary>label{grid-column:1/-1;font-size:16px}
 .schedule-summary .schedule-technician{grid-column:1}
 .schedule-summary #schedule-status{grid-column:2;text-align:right}
 .schedule-summary #tech{font-size:17px}
 .schedule-technician .muted{font-size:11px;letter-spacing:.7px}
 .schedule-technician h3{font-size:16px;line-height:1.35}
 .badge{font-size:11px;letter-spacing:.35px;padding:6px 10px}
 input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px;min-height:50px;min-width:0;max-width:100%;border-radius:10px}
 #date{width:100%;max-width:100%;font-size:18px;font-weight:650;min-height:54px;padding:12px;line-height:1.35}
 #date::-webkit-date-and-time-value{min-width:0;text-align:left}
 #picker label{font-size:16px;margin:14px 0}
 #route,#building,#period{font-size:17px;min-height:52px}
 .step{gap:10px;margin:0 0 16px}
 .step h2{font-size:19px}
 .step span{width:30px;height:30px;flex-shrink:0;font-size:14px}
 #building-step .step,#period-step .step{margin-top:23px}
 #address,.visit p{font-size:13px;line-height:1.55;overflow-wrap:anywhere}
 .visit{padding:18px 0}
 .visit-head{gap:4px}
 .visit-head h3{font-size:17px;line-height:1.4;overflow-wrap:anywhere}
 .visit .row{display:flex;flex-wrap:nowrap;gap:10px;align-items:center}
 .visit .row>select{flex:1;min-width:0;max-width:none;width:auto;min-height:46px;font-size:16px}
 .visit .row>button{flex:0 0 auto;min-width:0;min-height:46px;font-size:13px;padding:9px 12px}
 .actions{margin-top:12px;gap:10px}
 .actions button{font-size:15px;min-height:50px;border-radius:11px}
 #confirm{background:var(--blue);box-shadow:0 3px 8px #164e9b18}
 #save-state{font-size:12px;line-height:1.5;margin:14px 0;overflow-wrap:anywhere}
 .schedule-history{width:100%;font-size:13px;min-height:44px}
 .schedule-help{margin-top:18px;padding-top:14px}
 .schedule-help summary{font-size:13px;line-height:1.5;min-height:32px}
 .info,.error,.success{max-width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere}
 footer{padding:20px 16px;font-size:10px;line-height:1.6}
}
@media(max-width:360px){.top{gap:8px;padding:14px 12px}.brand{font-size:13px}.brand small{font-size:8px}.top-right{font-size:10px}main{padding:22px 12px}.card{padding:18px 15px}h1{font-size:24px}}

/* Caixa de entrada administrativa. */
.inbox-layout{display:grid;grid-template-columns:minmax(0, .8fr) minmax(0, 1.4fr);gap:20px;align-items:start}
.inbox-layout>*{min-width:0}.inbox-toolbar{align-items:center}.inbox-thread{display:block;width:100%;text-align:left;margin-bottom:10px;white-space:normal;overflow-wrap:anywhere}
.inbox-thread>span{display:block;font-weight:400;font-size:13px;margin-top:5px}.inbox-thread strong{display:block}.inbox-message{border:1px solid var(--line);border-radius:12px;padding:16px;margin:14px 0;overflow-wrap:anywhere}.inbox-unread{border-left:4px solid var(--blue);background:#f6f9ff}.inbox-body{white-space:pre-wrap;overflow-wrap:anywhere}.inbox-read{font-size:13px;padding:8px 12px}.inbox-message time{font-size:12px;color:var(--muted)}
@media(max-width:800px){.inbox-layout{grid-template-columns:minmax(0,1fr);gap:0}}
