/* Madre Gestão — consulta incorporável responsiva */
:root{color-scheme:light;--ink:#163b4b;--cyan:#22bbc5;--muted:#647d89;--line:#d9e7eb;--page:#f2f7f8;--soft:#eaf8f7}
*{box-sizing:border-box}
html{background:var(--page)}
body{margin:0;background:var(--page);color:var(--ink);font-family:Arial,Helvetica,sans-serif;font-size:14px}
[hidden]{display:none!important}
.page{width:100%;max-width:1240px;margin:0 auto;padding:14px}
.header{background:#fff;border:1px solid var(--line);border-radius:13px;overflow:hidden;box-shadow:0 2px 10px #123a4910}
.brand{padding:16px 18px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.brand img{width:190px;height:auto;max-height:68px;object-fit:contain}
.brand-info{text-align:right}
.brand-info .eyebrow{display:block;font-size:10px;letter-spacing:.12em;text-transform:uppercase;font-weight:800;color:#157d87;margin-bottom:5px}
.brand-info h1{margin:0;font-size:20px;line-height:1.2;font-weight:800}
.brand-info p{margin:5px 0 0;color:var(--muted);font-size:12px}
.headline{background:#154757;color:#fff;padding:12px 18px;display:flex;align-items:center;justify-content:space-between;gap:15px;flex-wrap:wrap}
.headline .date{font-size:15px;font-weight:800}
.headline .meta{display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-size:12px;color:#dceff3}
.headline .stat{display:inline-flex;background:#ffffff20;border:1px solid #ffffff35;color:#fff;padding:5px 9px;border-radius:999px;font-weight:800}
.headline button{border:1px solid #a7eaeb;background:#fff;color:#164757;border-radius:8px;font-weight:800;cursor:pointer;padding:7px 12px;font-size:12px}
.headline button:hover{background:#e6f9f8}
.headline button:disabled{opacity:.6;cursor:wait}
.error{margin:14px 0;background:#fff6ea;color:#81521b;border:1px solid #f1d6a8;padding:12px 14px;border-radius:9px;font-size:13px}
.loading{text-align:center;background:#fff;padding:42px 18px;border:1px solid var(--line);border-radius:12px;color:var(--muted)}
.sectors{display:grid;grid-template-columns:1fr;gap:12px;margin-top:13px}
.sector{background:white;border:1px solid var(--line);border-radius:12px;overflow:hidden;box-shadow:0 2px 10px #123a4908}
.sector-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 15px;background:#13566d;border-bottom:1px solid #0b4256}
.sector-head h2{margin:0;font-size:15px;font-weight:800;line-height:1.3;overflow-wrap:anywhere;color:#ffffff}
.sector-count{font-size:10px;color:#e0f7fb;white-space:nowrap;font-weight:700}
.period-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.period{min-width:0;border-right:1px solid #e1ebed}
.period:last-child{border-right:0}
.period-title{padding:9px 13px 7px;display:flex;justify-content:space-between;align-items:center;gap:8px;color:#126a79;border-bottom:1px solid #eef4f6}
.period-label{font-size:12px;font-weight:900;text-transform:uppercase}
.period-hour{font-size:11px;font-weight:800;color:#597b83}
.period-body{padding:9px 13px 12px;min-height:62px}
.doctor{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:2px 0 7px}
.doctor+.doctor{padding-top:10px;border-top:1px dashed #d3e4e6}
.doctor-name{font-size:14px;font-weight:800;line-height:1.25;overflow-wrap:anywhere}
.doctor-crm{font-size:11px;color:#506f7b}
.doctor-time{font-size:11px;color:#387887;font-weight:700}
.empty{font-size:12px;color:#8398a2;padding:8px 0}
.city-note{font-size:12px;font-weight:900;line-height:1.45;letter-spacing:.01em;color:#176778;background:#eef8f7;border-radius:7px;padding:10px;overflow-wrap:anywhere}
.footer{padding:13px 5px 2px;text-align:center;color:#6c8690;font-size:11px;line-height:1.5}
.footer strong{color:#2c6d78}
@media(max-width:720px){
 .page{padding:8px}
 .brand{padding:12px;align-items:flex-start;flex-wrap:wrap;gap:8px}
 .brand img{width:147px;max-height:48px}
 .brand-info{text-align:left;flex:1;min-width:170px}
 .brand-info h1{font-size:16px}
 .brand-info .eyebrow{font-size:9px}
 .brand-info p{font-size:11px}
 .headline{padding:11px 12px}
 .headline .date{font-size:14px}
 .period-grid{grid-template-columns:1fr}
 .period{border-right:0;border-bottom:1px solid #e8eff0}
 .period:last-child{border-bottom:0}
 .period-title{padding:10px 12px 7px}
 .period-body{padding:6px 12px 11px;min-height:auto}
 .doctor-name{font-size:15px}
 .doctor-crm{font-size:12px}
 .doctor-time{font-size:12px}
 .sector-head{padding:10px 12px}
 .sector-head h2{font-size:15px}
 .city-note{font-size:13px}
}
@media print{
 @page{size:A4 portrait;margin:7mm}
 html,body{background:#fff}
 .page{padding:0;max-width:none}
 .header,.sector{box-shadow:none}
 .headline button{display:none}
 .sector{break-inside:avoid;page-break-inside:avoid}
 .sectors{gap:7px;margin-top:7px}
 .sector-head{padding:6px 9px}
 .period-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .period{border-bottom:0;border-right:1px solid #e1ebed}
 .period-body{padding:5px 7px}
 .doctor-name{font-size:10px}
 .doctor-crm,.doctor-time{font-size:9px}
 .city-note{font-size:10px}
 .footer{font-size:9px}
}
/* Mantém o contraste dos títulos dos setores também nos impressos. */
@media print{.sector-head{-webkit-print-color-adjust:exact;print-color-adjust:exact}}
