:root { --ink:#183448; --blue:#0a6ea8; --pale:#eef6fa; --line:#c9d9e1; --warn:#8b4d00; --bg:#f6f9fb; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
.inline-section:has(#nao-realizado-ativo:checked) #nao-realizado-motivo { display:block !important; }
body { margin:0; color:var(--ink); background:var(--bg); font-family:Arial, sans-serif; line-height:1.4; }
button, input, select, textarea { font:inherit; }
button { cursor:pointer; border:0; border-radius:6px; padding:.65rem .9rem; color:white; background:var(--blue); }
button.secondary { color:var(--ink); background:#dbeaf1; }
label { display:block; font-weight:600; }
input, select, textarea { width:100%; display:block; margin-top:.25rem; padding:.55rem; border:1px solid var(--line); border-radius:5px; background:white; color:var(--ink); font-weight:400; }
textarea { resize:vertical; }
h1 { margin:0; font-size:1.45rem; } h2 { margin:1.35rem 0 .55rem; font-size:1.05rem; } p { margin:.25rem 0; }
.app-header { min-height:64px; display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:.8rem max(1rem, calc((100% - 1200px)/2)); background:var(--ink); color:white; }.app-brand{display:flex;align-items:center;gap:.7rem}.app-logo{display:block;width:64px;height:38px;object-fit:contain;background:white;border-radius:3px}
.app-header strong { font-size:1.2rem; } .muted { color:#c7dbe6; margin-left:.5rem; font-size:.9rem; } .user-area { display:flex; gap:.5rem; align-items:center; } .user-area label{font-size:.85rem}.user-area select{margin:0;min-width:130px}
.connection-status{padding:.25rem .5rem;border:1px solid #6a8798;border-radius:999px;font-size:.78rem;white-space:nowrap;background:#24475d}.connection-status[data-state="ready"]{background:#145d43;border-color:#74caa3}.connection-status[data-state="syncing"]{background:#735a11;border-color:#e6c864}.connection-status[data-state="offline-ready"]{background:#7b4d13;border-color:#efb85a}.connection-status[data-state="offline-warning"]{background:#7d2727;border-color:#eea2a2}
.offline-dialog{width:min(100% - 2rem,480px);border:1px solid var(--line);border-radius:9px;color:var(--ink);padding:0;background:#fff;box-shadow:0 1rem 3rem #0004}.offline-dialog::backdrop{background:#102d3e99}.offline-dialog form{padding:1.25rem}.offline-dialog h2{margin:0 0 .6rem;color:var(--blue);font-size:1.2rem}.offline-dialog label{margin:1rem 0}.offline-dialog .actions{margin-bottom:0}
.app-shell { max-width:1200px; margin:auto; display:grid; grid-template-columns:190px 1fr; gap:1.5rem; padding:1.25rem; }
.login-screen { min-height:calc(100vh - 64px); display:grid; place-items:center; padding:1rem; }
.login-card { width:min(100%, 390px); padding:1.25rem; border:1px solid var(--line); border-radius:8px; background:white; }
.app-copyright{max-width:1440px;margin:0 auto;padding:0 1.25rem 1.25rem;color:#476275;text-align:center;font-size:.78rem}.app-copyright a,.login-privacy a{color:var(--blue);font-weight:700;text-decoration:underline}.login-privacy{margin:1rem 0 0;text-align:center;font-size:.86rem}
@media screen and (min-width:801px) and (max-width:1450px){.dashboard-hero{grid-template-columns:repeat(2,minmax(0,1fr))!important}.dashboard-hero-card{aspect-ratio:16/9;min-height:9.2rem}}
.statistic-card li.has-percentage{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(4.75rem,auto);align-items:center}.statistic-card li.has-percentage em,.traffic-total em{min-width:4.75rem;padding:.12rem .35rem;border:1px solid #c5d9e5;border-radius:999px;background:#e8f2f7;color:#245b78;font-size:.84em;font-style:normal;font-weight:700;text-align:center;white-space:nowrap}.detailed-statistic-card li.statistic-detail{padding-left:1.05rem;background:#f5f9fb}.detailed-statistic-card li.statistic-detail span{font-style:italic;color:#476275}.traffic-statistic-card{border-color:#d3c08f}.traffic-total{display:flex;align-items:baseline;gap:.45rem;flex-wrap:wrap;margin:.1rem 0 .65rem;padding:.55rem .65rem;border-radius:7px;background:#fff4d8}.traffic-total b{font-size:1.45rem;color:#765008}.traffic-total span{font-weight:700}.traffic-total em{margin-left:auto}
.login-card label { margin:1rem 0; }.login-card button { width:100%; }.login-error { min-height:1.4rem; color:#9b1c1c; }
.nav { display:flex; flex-direction:column; gap:.4rem; } .nav-item { display:flex; align-items:center; justify-content:center; text-align:center; color:var(--ink); background:transparent; } .nav-item.active { background:var(--blue); color:white; }
.content { min-width:0; }.notice { padding:.75rem; border-left:4px solid var(--warn); background:#fff6e6; color:#583500; font-size:.92rem; }
.view-heading { display:flex; justify-content:space-between; gap:1rem; margin:1.25rem 0; align-items:start; }.view-heading-actions{display:flex;gap:.6rem;flex-wrap:wrap;justify-content:flex-end}.status { background:#dceaf2; padding:.35rem .6rem; border-radius:20px; }
fieldset { margin:1.1rem 0; border:1px solid var(--line); border-radius:8px; padding:1rem; background:white; } legend { padding:0 .35rem; font-weight:700; color:var(--blue); }
.grid { display:grid; gap:.85rem; }.grid.two{grid-template-columns:repeat(2, minmax(0,1fr))}.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.glasgow-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.top-times{margin-bottom:1rem}.wide{margin-top:1rem}
.conditional,.inline-section { margin-top:1rem; padding-top:.3rem; }.occurrence-add-section{padding:.85rem;border:1px solid var(--blue);border-radius:8px;background:var(--pale)}.occurrence-add-section h2{margin-top:0}.checks-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.55rem 1rem; }.check { font-weight:400; }.check input { width:auto; display:inline; margin:0 .3rem 0 0; }.detail { grid-column:1/-1; padding:.6rem; background:var(--pale); border-radius:6px; }
.glicemia-detail>strong{display:block;margin-bottom:.55rem}.glicemia-readings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.65rem}.glicemia-reading{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.4rem;align-items:end}.glicemia-reading input{margin:0}.glicemia-unit,.glicemia-hour{padding:.55rem 0;white-space:nowrap;font-weight:400}.occurrence-tabs{display:flex;gap:.55rem;flex-wrap:wrap;margin:-.4rem 0 1rem;padding:.65rem;border:1px solid var(--line);border-radius:8px;background:var(--pale)}.occurrence-tabs button{color:var(--ink);background:#dbeaf1}.occurrence-tabs button.active{color:#fff;background:var(--blue)}
.actions { display:flex; justify-content:flex-end; gap:.6rem; margin:1rem 0; flex-wrap:wrap; }.metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem;margin-bottom:1rem}.metric{background:white;border:1px solid var(--line);border-radius:8px;padding:.8rem}.metric b{display:block;font-size:1.4rem;color:var(--blue)}.statistics-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;margin-bottom:1rem}.statistic-card{background:#fff;border:1px solid var(--line);border-radius:8px;padding:.85rem}.statistic-card h2{font-size:1rem;color:var(--blue);margin:0 0 .6rem}.statistic-card ul{list-style:none;margin:0;padding:0}.statistic-card li{display:flex;justify-content:space-between;gap:.7rem;padding:.25rem 0;border-bottom:1px solid #edf2f5}.statistic-card li:last-child{border-bottom:0}.edition-note,.history-panel{margin-top:1rem;padding:1rem;border:1px solid var(--line);border-radius:8px;background:var(--pale)}.edition-note label{margin-top:.7rem}.table-action{display:block;margin:.2rem 0;padding:.35rem .5rem;font-size:.8rem}.danger-action{color:#8a1c1c;border-color:#c98d8d}.history-entry{padding:.7rem 0;border-bottom:1px solid var(--line)}.history-entry p{margin:.4rem 0}.history-entry ul{margin:.4rem 0;padding-left:1.2rem}
.table-wrap{overflow:auto;background:white;border:1px solid var(--line);border-radius:8px}table{border-collapse:collapse;width:100%}th,td{text-align:left;padding:.7rem;border-bottom:1px solid var(--line);font-size:.9rem}.config-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.config-grid .actions{grid-column:1/-1}
.config-wide{grid-column:1/-1}.professional-config-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;padding:1rem;border:1px solid var(--line);border-radius:8px;background:white}.professional-config-grid h2{grid-column:1/-1;margin:0;color:var(--blue);font-size:1rem}.field-help{margin:0 0 .9rem;color:#476275;font-size:.9rem}.team-guidance{margin:.25rem 0 .8rem;padding:.65rem .8rem;border-radius:6px;background:var(--pale);color:#476275}.team-section{margin-top:.75rem}.team-grid{display:grid;gap:.7rem}.moto-team{grid-template-columns:minmax(0,420px)}.usb-team{grid-template-columns:repeat(4,minmax(0,1fr))}.usa-team{grid-template-columns:repeat(5,minmax(0,1fr))}.team-card{padding:.75rem;border:1px solid var(--line);border-radius:7px;background:#fbfdfe}.team-card h2{margin:0 0 .6rem;font-size:.9rem;min-height:2.6em}.team-card label+label{margin-top:.5rem}
.config-wide{grid-column:1/-1}.professional-config-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;padding:1rem;border:1px solid var(--line);border-radius:8px;background:white}.professional-config-grid h2{grid-column:1/-1;margin:0;color:var(--blue);font-size:1rem}.field-help{margin:0 0 .9rem;color:#476275;font-size:.9rem}.team-guidance{margin:.25rem 0 .8rem;padding:.65rem .8rem;border-radius:6px;background:var(--pale);color:#476275}.team-section{margin-top:.75rem}.team-grid{display:grid;gap:.7rem}.moto-team{grid-template-columns:minmax(0,420px)}.usb-team{grid-template-columns:repeat(4,minmax(0,1fr))}.usa-team{grid-template-columns:repeat(5,minmax(0,1fr))}.team-card{padding:.75rem;border:1px solid var(--line);border-radius:7px;background:#fbfdfe}.team-card h2{margin:0 0 .6rem;font-size:.9rem;min-height:2.6em}.team-card label+label{margin-top:.5rem}.report-controls{display:grid;grid-template-columns:repeat(2,minmax(0,260px));gap:1rem;padding:1rem;background:white;border:1px solid var(--line);border-radius:8px}.report-page{margin-top:1rem;padding:1.25rem;background:white;border:1px solid var(--line);border-radius:8px}.report-title{border-bottom:2px solid var(--blue);padding-bottom:.65rem;margin-bottom:1rem}.report-title h1{color:var(--blue)}.report-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.report-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.7rem;margin-bottom:1rem}.report-cards>div{padding:.75rem;border:1px solid var(--line);border-radius:7px;background:var(--pale)}.report-cards span{display:block;font-size:.82rem}.report-cards b{display:block;font-size:1.35rem;color:var(--blue)}.report-block{break-inside:avoid;margin:1rem 0}.report-block h2{margin:.25rem 0 .5rem;color:var(--blue);font-size:1rem}.report-table{width:100%;border-collapse:collapse}.report-table th,.report-table td{padding:.45rem .55rem;border:1px solid var(--line);font-size:.88rem}.report-table th{background:#e7f1f6}.report-table td:last-child{font-weight:700;text-align:right}.wide-table td:not(:first-child),.wide-table th:not(:first-child){text-align:right}.report-note{padding:.65rem;background:#fff6e6;border-left:4px solid var(--warn);font-size:.9rem}#print-sheet,#report-print-sheet{display:none}
.report-horizontal-table th,.report-horizontal-table td{padding:.35rem .4rem;font-size:.78rem;text-align:center;white-space:nowrap}.report-horizontal-table th:first-child{text-align:left}.report-horizontal-table td:last-child{font-weight:400}
.statistics-tabs{display:flex;gap:.45rem;flex-wrap:wrap;margin:-.3rem 0 1.25rem;padding:.45rem;border:1px solid var(--line);border-radius:10px;background:#fff}.statistics-tab{background:#e8f1f5;color:var(--ink);font-weight:700}.statistics-tab.active{background:var(--blue);color:#fff}.statistics-subview{min-width:0}.production-content{display:grid;gap:1rem}.production-section{padding:1rem;border:1px solid var(--line);border-radius:10px;background:#fff;box-shadow:0 2px 8px rgba(23,69,94,.035)}.production-section h3{margin:0 0 .7rem;color:var(--blue);font-size:1rem}.production-section .table-wrap{margin:0}.production-table td:last-child,.production-table th:last-child{text-align:right}.chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.chart-card{padding:1rem;border:1px solid var(--line);border-radius:10px;background:#fff;box-shadow:0 2px 8px rgba(23,69,94,.035)}.chart-card h3{margin:0 0 .15rem;color:var(--blue);font-size:1rem}.chart-card p{margin:.15rem 0 .8rem;color:#476275;font-size:.86rem}.chart-card svg{width:100%;height:auto;display:block}.chart-empty{padding:1rem;border:1px dashed var(--line);border-radius:8px;color:#476275}.dashboard-content{display:grid;gap:1rem}.dashboard-hero{display:grid;grid-template-columns:1.2fr repeat(3,minmax(0,1fr));gap:1rem}.dashboard-hero-card{min-height:8.2rem;padding:1rem;border-radius:14px;color:#fff;background:linear-gradient(135deg,#123b57,#1879ae);box-shadow:0 8px 20px rgba(17,57,84,.18)}.dashboard-hero-card.alert{background:linear-gradient(135deg,#9d331c,#e45c24)}.dashboard-hero-card.warning{background:linear-gradient(135deg,#8a5705,#cf9216)}.dashboard-hero-card.good{background:linear-gradient(135deg,#176346,#219369)}.dashboard-hero-card span{display:block;font-size:.84rem;opacity:.9}.dashboard-hero-card b{display:block;margin:.35rem 0;font-size:clamp(1.8rem,4vw,3.1rem);line-height:1}.dashboard-hero-card small{display:block;line-height:1.2;opacity:.92}.dashboard-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.dashboard-chart{min-height:18rem}.dashboard-actions{margin:0;padding:0;border:0}.dashboard-fullscreen{background:#fff;border-radius:0;padding:1rem}.dashboard-fullscreen .app-header,.dashboard-fullscreen .nav,.dashboard-fullscreen .notice,.dashboard-fullscreen .view-heading,.dashboard-fullscreen .statistics-tabs,.dashboard-fullscreen #statistics-production,.dashboard-fullscreen #statistics-summary,.dashboard-fullscreen #statistics-presentation,.dashboard-fullscreen #statistics-history,.dashboard-fullscreen .app-copyright{display:none!important}.dashboard-fullscreen .app-shell{display:block;max-width:none;padding:0}.dashboard-fullscreen #view-gestao{display:block!important}.dashboard-fullscreen #statistics-dashboards{display:block!important;padding:1rem}.dashboard-fullscreen .dashboard-hero-card{min-height:10rem}
.profile-tabs{display:flex;gap:.45rem;flex-wrap:wrap;margin:-.3rem 0 1.25rem;padding:.45rem;border:1px solid var(--line);border-radius:10px;background:#fff}.profile-tab{background:#e8f1f5;color:var(--ink);font-weight:700}.profile-tab.active{background:var(--blue);color:#fff}.profile-subview{min-width:0}.feedback-form{max-width:760px;margin-top:0}.feedback-form h2{margin-top:0;color:var(--blue)}.feedback-form label{margin-top:1rem}.feedback-admin-panel{margin-top:1.5rem}.feedback-actions{margin:0;padding:0;border:0}.feedback-list{display:grid;gap:.65rem}.feedback-entry{padding:.8rem .9rem;border:1px solid var(--line);border-radius:8px;background:#fff}.feedback-entry header{display:flex;justify-content:flex-start;gap:.7rem;align-items:flex-start}.feedback-entry header>div{display:grid;gap:.1rem}.feedback-entry header span{color:#476275;font-size:.82rem}.feedback-entry p{margin:.55rem 0 0;overflow-wrap:anywhere}.feedback-select{margin:0;padding-top:.1rem}.feedback-select input{width:1.1rem;height:1.1rem;margin:0}.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}
.training-statistics-controls{margin:1.25rem 0 1.5rem;position:relative;z-index:1}.training-statistics-tabs{margin:0 0 1.25rem;position:relative;z-index:0}
.admin-base-switcher{display:flex;justify-content:space-between;gap:1rem;align-items:center;margin:1rem 0;padding:1rem;border:1px solid var(--line);border-radius:8px;background:white}.admin-base-switcher h2{margin:0;color:var(--blue);font-size:1rem}.admin-base-switcher p{margin:.25rem 0 0;color:#476275;font-size:.9rem}.admin-base-switcher-controls{display:flex;gap:.75rem;align-items:center;justify-content:flex-end;flex-wrap:wrap}.admin-base-tabs{display:flex;gap:.45rem;flex-wrap:wrap}.admin-base-tabs button{background:#dbeaf1;color:var(--ink);white-space:nowrap}.admin-base-tabs button.active{background:var(--blue);color:white}.admin-base-actions{display:flex;gap:.45rem;flex-wrap:wrap}
.team-autocomplete{position:relative}.team-suggestions{position:absolute;z-index:35;top:calc(100% + .2rem);left:0;right:0;max-height:13rem;overflow:auto;padding:.25rem;background:#fff;border:1px solid var(--blue);border-radius:7px;box-shadow:0 8px 18px rgba(17,48,68,.18)}.team-suggestion{display:flex;width:100%;min-height:0;padding:.55rem .6rem;border:0;border-radius:5px;background:transparent;color:var(--ink);text-align:left;flex-direction:column;gap:.15rem}.team-suggestion:hover,.team-suggestion:focus{background:var(--pale);outline:none}.team-suggestion strong{font-size:.9rem}.team-suggestion span{font-size:.78rem;font-weight:400;color:#476275;overflow-wrap:anywhere}
@media (max-width:1000px){.usa-team{grid-template-columns:repeat(3,minmax(0,1fr))}.usb-team,.professional-config-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.professional-config-grid h2{grid-column:1/-1}}
@media (max-width:800px){.app-shell{display:block;padding:.8rem}.nav{flex-direction:row;overflow:auto;margin-bottom:1rem}.nav-item{white-space:nowrap}.grid.three,.checks-grid,.config-grid,.metrics,.statistics-grid,.usb-team,.usa-team,.professional-config-grid,.report-controls,.report-grid,.report-cards,.glicemia-readings{grid-template-columns:1fr}.glicemia-reading{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto}.professional-config-grid h2{grid-column:1}.app-header,.admin-base-switcher{align-items:flex-start;flex-direction:column}.view-heading{flex-direction:column}.user-area{width:100%}.user-area select{flex:1}.admin-base-switcher-controls{justify-content:flex-start}}
@media (max-width:800px){.traffic-total em{margin-left:0}}
.reports-panel{margin-top:2.75rem;padding:1.25rem;border:1px solid var(--line);border-top:4px solid var(--blue);border-radius:8px;background:#fff;box-shadow:0 -1px 0 rgba(23,69,94,.04)}.reports-panel summary{cursor:pointer;color:var(--blue);display:flex;justify-content:space-between;gap:1rem;align-items:center}.reports-panel summary span{font-size:.9rem;color:#476275;font-weight:400}.reports-panel-content{margin-top:1rem}.reports-panel h2{margin:0;color:var(--blue)}
.attendance-history-panel{margin-top:1.75rem;padding:1.25rem;border:1px solid var(--line);border-top:4px solid #6f8797;border-radius:8px;background:#fff}.attendance-history-panel summary{cursor:pointer;color:var(--blue);display:flex;justify-content:space-between;gap:1rem;align-items:center}.attendance-history-panel summary span{font-size:.9rem;color:#476275;font-weight:400}.attendance-history-panel .table-wrap{margin-top:1rem}
.base-data-panel,.professional-access-panel{margin:0;padding:1.1rem;border:1px solid var(--line);border-radius:10px;background:#fff}.base-data-panel h2,.professional-access-panel h2{margin:0;color:var(--blue)}.base-data-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-top:1rem}.base-data-grid .wide{grid-column:1/-1;margin:0}.section-heading{display:flex;justify-content:space-between;gap:1rem;align-items:end;margin-bottom:1rem}.section-heading p{color:#476275}.professional-access-panel{margin-top:1.5rem}.professional-access-table{max-height:34rem}.professional-access-table table{min-width:1120px}.professional-access-table th{vertical-align:bottom;white-space:normal}.professional-access-table td{vertical-align:top;min-width:8.5rem}.professional-access-table td:first-child{min-width:13rem}.professional-access-table td:nth-child(3){min-width:8rem}.professional-access-table td:nth-child(4){min-width:8rem}.professional-access-table td:nth-child(5),.professional-access-table td:nth-child(6){min-width:9rem}.professional-access-table input,.professional-access-table select{min-width:100%;margin:0}.professional-access-table tfoot td{background:#f4f9fc;border-top:2px solid var(--line)}.professional-access-table code{white-space:nowrap}
.ficha-status-stack{display:flex;flex-direction:column;align-items:flex-end;gap:.3rem}.autosave-status{font-size:.78rem;color:#476275;max-width:22rem;text-align:right}.autosave-status[data-state="pending"],.autosave-status[data-state="saving"]{color:#8b4d00}.autosave-status[data-state="error"]{color:#9b1c1c}.autosave-status[data-state="saved"]{color:#286443}.critical-action{background:#9a5a00;color:#fff;font-weight:700;box-shadow:inset 0 0 0 1px rgba(70,35,0,.2)}.danger-action{background:#fff0f0;color:#8a1c1c;border:1px solid #c98d8d;font-weight:700}.professional-filters{display:flex;gap:.65rem;align-items:end;flex-wrap:wrap}.professional-filters label{font-size:.82rem;min-width:11rem}.professional-filters input,.professional-filters select{min-width:12rem}.history-summary{display:flex;align-items:center;gap:.65rem;margin-bottom:.75rem;padding:.75rem;border:1px solid var(--line);border-radius:8px;background:#fff}.history-summary strong{display:grid;place-items:center;width:2rem;height:2rem;border-radius:50%;background:var(--blue);color:#fff}.history-entry{padding:1rem 0}.history-entry header{display:flex;justify-content:space-between;gap:1rem;align-items:start}.history-entry header>div{display:flex;flex-direction:column;gap:.1rem}.history-entry header span{font-size:.82rem;color:#476275}.history-entry header p{display:grid;gap:.15rem;max-width:22rem;padding:.55rem .65rem;border-radius:6px;background:#fff6e6;color:#583500}.history-changes{display:grid;gap:.65rem;margin-top:.75rem}.history-change{display:grid;grid-template-columns:minmax(8rem,.7fr) 1fr 1fr;gap:.65rem;padding:.75rem;border:1px solid var(--line);border-radius:7px;background:#fff}.history-change h3{margin:0;color:var(--blue);font-size:.92rem}.history-change div{min-width:0}.history-change span{display:block;font-size:.76rem;font-weight:700;color:#476275;text-transform:uppercase;letter-spacing:.02em}.history-change p{margin:.2rem 0 0;overflow-wrap:anywhere}
@media screen{
  body{background:linear-gradient(180deg,#edf5f9 0,#f6f9fb 18rem)}
  button{min-height:2.7rem;display:inline-flex;align-items:center;justify-content:center;gap:.35rem;transition:filter .15s ease,transform .15s ease}
  button:hover{filter:brightness(.96)}button:active{transform:translateY(1px)}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid rgba(10,110,168,.28);outline-offset:2px}
  input,select,textarea{min-height:2.7rem;padding:.62rem .7rem;border-radius:7px;box-shadow:0 1px 1px rgba(23,69,94,.03)}textarea{min-height:5.4rem}
  h1{font-size:clamp(1.45rem,2vw,1.85rem)}h2{font-size:1.08rem}.app-header{position:sticky;top:0;z-index:30;min-height:4.6rem;padding:.8rem max(1.25rem,calc((100% - 1400px)/2));box-shadow:0 2px 10px rgba(17,48,68,.16)}.app-logo{width:74px;height:42px}.app-header strong{font-size:1.3rem}
  .app-shell{max-width:1440px;grid-template-columns:220px minmax(0,1fr);gap:1.75rem;padding:clamp(1rem,2vw,1.75rem)}.content{min-width:0}.nav{align-self:start;padding:.55rem;border:1px solid var(--line);border-radius:10px;background:#fff;box-shadow:0 4px 14px rgba(23,69,94,.06)}.nav-item{min-height:2.75rem;border-radius:7px;padding:.7rem .8rem;font-weight:600}.nav-item:not(.active):hover{background:var(--pale)}
  .notice{margin:0 0 1.25rem;border-radius:7px;box-shadow:0 1px 2px rgba(23,69,94,.04)}.view-heading{margin:0 0 1.35rem;padding-bottom:1rem;border-bottom:1px solid var(--line)}.view-heading-actions{align-items:end}.status{font-weight:700}
  fieldset{margin:1.25rem 0;padding:1.2rem;border-radius:10px;box-shadow:0 2px 8px rgba(23,69,94,.035)}fieldset legend{font-size:1.02rem}.grid{gap:1rem}.checks-grid{gap:.7rem 1.1rem}.check{padding:.15rem 0}.detail{padding:.85rem;border-radius:8px}.actions{padding-top:.45rem;border-top:1px solid #e5edf1}.table-wrap{box-shadow:0 2px 8px rgba(23,69,94,.04)}.table-wrap thead th{position:sticky;top:0;z-index:1;background:#e7f1f6}
  .team-card{padding:.9rem;border-radius:8px}.team-card label+label{margin-top:.7rem}.team-card h2{line-height:1.25}.metrics,.statistics-grid{gap:1rem}.metric,.statistic-card{border-radius:10px;box-shadow:0 2px 8px rgba(23,69,94,.035)}.report-page{border-radius:10px}.report-controls{border-radius:10px}.reports-panel,.attendance-history-panel{border-radius:10px}.config-grid{gap:1.15rem}
}
/* Ficha responsiva: evita que rótulos e campos de horário comprimam ou invadam a coluna vizinha. */
#ficha-form .grid > *,#linhas-destino > *{min-width:0}
#ficha-form input,#ficha-form select,#ficha-form textarea{min-width:0}
#linhas-destino{display:grid;gap:1rem}
#linhas-destino .destination-row{gap:1rem}
@media screen and (max-width:1099px){
  #ficha-form .occurrence-times-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
  #ficha-form .closing-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
  #ficha-form .top-times{gap:1rem}
}
@media screen and (max-width:640px){
  #ficha-form .occurrence-times-grid,#ficha-form .closing-grid{grid-template-columns:minmax(0,1fr)}
  #ficha-form fieldset{overflow:visible}
}
@media screen and (min-width:1100px){.nav{position:sticky;top:5.6rem}.view-heading-actions{max-width:45rem}}
@media screen and (min-width:641px) and (max-width:1099px){
  html{scroll-padding-top:9.5rem}.app-header{align-items:center;flex-direction:row}.user-area{width:auto}.app-shell{display:block;max-width:1180px;padding:1rem 1.25rem max(3rem,env(safe-area-inset-bottom))}.nav{position:sticky;top:4.6rem;z-index:20;display:flex;flex-direction:row;gap:.35rem;overflow:auto;margin:0 0 1.25rem;padding:.45rem}.nav-item{flex:0 0 auto;white-space:nowrap}.grid.three,.checks-grid,.config-grid,.professional-config-grid,.usb-team,.usa-team{grid-template-columns:repeat(2,minmax(0,1fr))}.professional-config-grid h2{grid-column:1/-1}.report-cards{grid-template-columns:repeat(3,minmax(0,1fr))}.moto-team{grid-template-columns:minmax(0,500px)}.view-heading{align-items:end}input,select,textarea{font-size:16px;scroll-margin-block:9.5rem 2.5rem}
}
@media screen and (min-width:900px) and (max-width:1099px) and (orientation:landscape){
  .grid.three,.checks-grid,.config-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.professional-config-grid,.usb-team,.usa-team{grid-template-columns:repeat(3,minmax(0,1fr))}.report-cards{grid-template-columns:repeat(4,minmax(0,1fr))}.top-times{margin-bottom:.65rem}.app-shell{padding-bottom:2rem}
}
@media screen and (max-width:640px){
  .app-header{position:static;padding:.75rem 1rem}.app-brand{gap:.5rem}.app-logo{width:62px;height:36px}.app-header strong{font-size:1.15rem}.muted{display:block;margin:.1rem 0 0}.user-area{width:100%;justify-content:space-between;flex-wrap:wrap}.app-shell{padding:.75rem}.nav{margin-bottom:1rem}.view-heading{padding-bottom:.75rem}.view-heading-actions{width:100%;justify-content:flex-start}.view-heading-actions label{min-width:10rem;flex:1}.grid.two,.grid.three,.checks-grid,.config-grid,.metrics,.statistics-grid,.usb-team,.usa-team,.professional-config-grid,.report-controls,.report-grid,.report-cards,.glicemia-readings,.base-data-grid{grid-template-columns:1fr}.team-card h2{min-height:0}.actions{justify-content:stretch}.actions button{flex:1}.reports-panel,.attendance-history-panel,.base-data-panel,.professional-access-panel{padding:1rem}.reports-panel summary,.attendance-history-panel summary{align-items:flex-start;flex-direction:column}.table-wrap th,.table-wrap td{padding:.6rem;font-size:.84rem}
}
@media screen and (max-width:640px){.ficha-status-stack{align-items:flex-start}.autosave-status{text-align:left}.professional-filters{width:100%;display:grid;grid-template-columns:1fr}.professional-filters label{min-width:0}.history-entry header{flex-direction:column}.history-entry header p{max-width:none;width:100%}.history-change{grid-template-columns:1fr;gap:.4rem}.history-change h3{margin-bottom:.25rem}}
/* Ambiente de treinamento: identidade visual própria, sem alterar os dados ou regras assistenciais. */
body.training-mode{--ink:#17432b;--blue:#21824d;--pale:#edf8f0;--line:#bddcc8;--bg:#f4faf5;background:linear-gradient(180deg,#e7f5ea 0,#f6fbf7 18rem)!important}
body.training-mode .app-header{background:#174d31}
body.training-mode .nav{background:#fbfffc;border-color:#b9d8c3}
body.training-mode .nav-item:not(.active):hover{background:#e7f5ea}
body.training-mode .statistics-tab:not(.active),body.training-mode .profile-tab:not(.active){background:#e2f1e7}
body.training-mode .history-panel,body.training-mode .training-subview{background:#eff8f1;border-color:#b9d8c3}
body.training-mode .table-wrap thead th{background:#e1f0e6}
body.training-mode .training-kicker{margin:0 0 .35rem;color:#1d7243;font-size:.78rem;font-weight:800;letter-spacing:.09em}
body.training-mode .training-shift-banner{background:linear-gradient(135deg,#174d31,#27935a)}
body.training-mode .occurrence-add-section{border-color:#21824d;background:#edf8f0}
body.training-mode .team-suggestions{border-color:#21824d}
@media print{.print-service-municipality{font-size:7.2pt;font-weight:700;text-transform:uppercase;letter-spacing:.15pt}}
@page{size:A4 portrait;margin:10mm 10mm 10mm 12mm}
@media print{
  body{background:#fff;font-size:7.5pt;line-height:1.18}
  body>*{display:none !important;visibility:hidden}
  #print-sheet,#print-sheet *{visibility:visible}
  #print-sheet{display:block !important;position:absolute;left:0;top:0;width:188mm;color:#000}
  .print-record+.print-record{break-before:page;page-break-before:always}
  body.printing-report #print-sheet{display:none !important}
  body.printing-report #report-print-sheet,body.printing-report #report-print-sheet *{visibility:visible}
  body.printing-report #report-print-sheet{display:block !important;position:absolute;left:0;top:0;width:188mm;color:#000}
  .print-title{display:grid;grid-template-columns:31mm 1fr 39mm;gap:3mm;align-items:center;border-top:.8px solid #000;border-bottom:1.5px solid #000;padding:1.5mm 0 2mm;margin-bottom:2mm}.print-logo{display:block;max-width:29mm;max-height:16mm;width:auto;height:auto}.print-service-info{min-width:0}.print-title h1{font-size:10.5pt;line-height:1.12;margin:.25mm 0;font-weight:700}.print-title p{margin:0}.print-service-owner{font-size:7.2pt;font-weight:700;text-transform:uppercase;letter-spacing:.15pt}.print-service-cnpj{font-size:6.6pt}.print-document{display:flex;min-height:15mm;flex-direction:column;justify-content:center;align-items:flex-end;border-left:.5px solid #777;padding-left:2mm;text-align:right}.print-document strong{font-size:8pt;letter-spacing:.2pt}.print-document span{font-size:6.7pt;line-height:1.25}
  .print-section{margin-top:2mm;break-inside:avoid}.print-section h2{margin:0 0 1mm;font-size:8pt;text-transform:uppercase;border-bottom:.4px solid #777;padding-bottom:.5mm}.print-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:1mm 2mm}.print-grid.three{grid-template-columns:repeat(3,1fr)}.print-grid.two{grid-template-columns:repeat(2,1fr)}.print-grid.four{grid-template-columns:repeat(4,1fr)}.print-time-line{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:1mm 2mm;margin-top:1mm}.print-vitals{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1mm 2mm;margin-top:1mm}.print-unit-heading{margin:0 0 1.6mm;padding:1.1mm 2mm;border:.7px solid #000;background:#f2f2f2;text-align:center;font-size:8.6pt;font-weight:700;letter-spacing:.45pt}.print-field{min-width:0}.print-field b{display:block;font-size:6.3pt;text-transform:uppercase;color:#333}.print-field span{display:block;min-height:3mm;overflow-wrap:anywhere}.print-text{white-space:pre-wrap;border:.4px solid #999;padding:1mm;min-height:5mm}.print-list{margin:0;padding-left:3mm;columns:2;column-gap:5mm}.print-list li{break-inside:avoid;margin:0 0 .5mm}.print-team{width:100%;border-collapse:collapse}.print-team th,.print-team td{border:.4px solid #777;padding:1mm;vertical-align:top;font-size:6.7pt}.print-team th{background:#eee;text-align:left}.print-team td{height:13mm}.print-team .signature-cell{width:46mm}.print-foot{margin-top:2mm;display:flex;justify-content:flex-end;font-size:6.5pt;color:#444}
  .print-section{margin-top:2mm;break-inside:avoid}.print-section h2{margin:0 0 1mm;font-size:8pt;text-transform:uppercase;border-bottom:.4px solid #777;padding-bottom:.5mm}.print-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:1mm 2mm}.print-grid.three{grid-template-columns:repeat(3,1fr)}.print-grid.two{grid-template-columns:repeat(2,1fr)}.print-grid.four{grid-template-columns:repeat(4,1fr)}.print-time-line,.print-vitals{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1mm 2mm;margin-top:1mm}.print-field{min-width:0}.print-field b{display:block;font-size:6.3pt;text-transform:uppercase;color:#333}.print-field span{display:block;min-height:3mm;overflow-wrap:anywhere}.print-text{white-space:pre-wrap;border:.4px solid #999;padding:1mm;min-height:5mm}.print-list{margin:0;padding-left:3mm;columns:2;column-gap:5mm}.print-list li{break-inside:avoid;margin:0 0 .5mm}.print-team{width:100%;border-collapse:collapse}.print-team th,.print-team td{border:.4px solid #777;padding:1mm;vertical-align:top;font-size:6.7pt}.print-team th{background:#eee;text-align:left}.print-team td{height:13mm}.print-team .signature-cell{width:46mm}.print-foot{margin-top:2mm;display:flex;justify-content:flex-end;font-size:6.5pt;color:#444}body.printing-report .report-title{border-bottom:1px solid #000;padding-bottom:1mm;margin-bottom:2mm}body.printing-report .report-title h1{font-size:12pt;color:#000}body.printing-report .report-title p{font-size:7pt}.report-cards{gap:2mm;margin-bottom:2mm}.report-cards>div{padding:1.2mm;border:.4px solid #777;background:#fff}.report-cards b{font-size:10pt;color:#000}.report-cards span{font-size:6.5pt}.report-grid{gap:2mm}.report-block{margin:2mm 0}.report-block h2{font-size:8pt;color:#000}.report-table th,.report-table td{padding:1mm;border:.4px solid #777;font-size:6.8pt}.report-table th{background:#eee}.report-note{font-size:6.5pt;padding:1mm}.print-team td{height:8mm}.print-team .signature-cell{width:38mm}
  /* Fichas de atendimento: texto ligeiramente maior, sem aumentar a altura total da página. */
  .print-record:not(.print-sae){font-size:7.8pt;line-height:1.13}
  .print-record:not(.print-sae) .print-section{margin-top:2.3mm}
  .print-record:not(.print-sae) .print-section h2{margin-bottom:1.1mm;font-size:8.15pt;padding-bottom:.5mm}
  .print-record:not(.print-sae) .print-grid,.print-record:not(.print-sae) .print-time-line,.print-record:not(.print-sae) .print-vitals{gap:1mm 2mm}
  .print-record:not(.print-sae) .print-field b{font-size:6.5pt}
  .print-record:not(.print-sae) .print-field span{min-height:3mm;font-size:7.8pt;line-height:1.13}
  .print-record:not(.print-sae) .print-text{padding:1.1mm;min-height:5.5mm;line-height:1.16}
  .print-record:not(.print-sae) .print-list li{margin-bottom:.5mm}
  .print-record:not(.print-sae) .print-team-member,.print-record:not(.print-sae) .print-team-signature{padding:1.1mm}
  .print-record:not(.print-sae) .print-team-member b{font-size:6.9pt}
  .print-record:not(.print-sae) .print-team-name{font-size:6.7pt}.print-record:not(.print-sae) .print-team-document{font-size:6.4pt}
  .print-time-line{grid-template-columns:repeat(6,minmax(0,1fr))}
  .report-horizontal-table th,.report-horizontal-table td{padding:.55mm .65mm;font-size:6.1pt;white-space:nowrap}body.printing-report .metrics{gap:2mm;margin:2mm 0}body.printing-report .statistics-grid{gap:2mm;margin:2mm 0}body.printing-report .metric,body.printing-report .statistic-card{padding:1.3mm;border:.4px solid #777;background:#fff;break-inside:avoid}body.printing-report .metric b{font-size:10pt;color:#000}body.printing-report .metric span{font-size:6.5pt}body.printing-report .statistic-card h2{font-size:8pt;color:#000;margin:0 0 1mm}body.printing-report .statistic-card li{font-size:6.5pt;padding:.45mm 0}.print-team-grid{display:grid;grid-template-columns:1.35fr .8fr 1.35fr .8fr;gap:1mm 1.5mm}.print-team-member,.print-team-signature{border:.4px solid #777;min-height:12mm;padding:1mm;box-sizing:border-box}.print-team-member b{display:block;font-size:6.7pt;line-height:1.2;font-weight:700}.print-team-name,.print-team-document{display:block;padding-left:2mm;font-size:6.5pt;line-height:1.25}.print-team-document{font-size:6.2pt}
}
.annual-comparison-list{display:grid;gap:.45rem;margin:.8rem 0 0;padding:0;list-style:none}.annual-comparison-list li{display:flex;justify-content:space-between;gap:.7rem;align-items:center;padding:.55rem .65rem;border-radius:7px;background:#f1f6f8;font-size:.9rem}.annual-comparison-list b{white-space:nowrap;color:#526573}.annual-comparison-list b.positive{color:#176346}.annual-comparison-list b.negative{color:#a73524}.dashboard-hero{grid-template-columns:repeat(4,minmax(0,1fr));align-items:start}.dashboard-hero>*{min-width:0}.dashboard-attendance-stack,.dashboard-panel-stack{display:grid;gap:.55rem;min-width:0}.dashboard-hero-card{min-height:0;aspect-ratio:16/9;overflow:hidden}.dashboard-hero-card span,.dashboard-hero-card small{overflow-wrap:anywhere}.dashboard-comparison-cell{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.6rem;min-height:2.35rem;padding:.45rem .65rem;border:1px solid var(--line);border-radius:7px;background:#f1f6f8;color:#476275;font-size:.76rem;line-height:1.2}.dashboard-comparison-cell strong{white-space:nowrap;color:#29475a;font-size:.76rem}.dashboard-comparison-cell span{min-width:0;overflow-wrap:anywhere}.dashboard-comparison-cell b{color:#526573;font-size:.95rem;white-space:nowrap}.dashboard-comparison-cell.positive{border-color:#9bd3ba;background:#edf9f2}.dashboard-comparison-cell.positive b{color:#176346}.dashboard-comparison-cell.negative{border-color:#e0ada4;background:#fff3f1}.dashboard-comparison-cell.negative b{color:#a73524}@media screen and (min-width:801px) and (max-width:1140px){.dashboard-hero{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-hero-card{aspect-ratio:16/9}}@media screen and (max-width:800px){.chart-grid,.dashboard-hero,.dashboard-detail-grid{grid-template-columns:1fr}.dashboard-comparison-cell{grid-template-columns:auto minmax(0,1fr);align-items:start}.dashboard-comparison-cell b{grid-column:2}.dashboard-hero-card{aspect-ratio:auto;min-height:8.2rem}.statistics-tabs{overflow:auto;flex-wrap:nowrap}.statistics-tab{white-space:nowrap;flex:0 0 auto}}
.transferencia-opcoes{display:flex;flex-wrap:wrap;gap:.7rem 1.15rem;margin:.55rem 0 .9rem}.transfer-details{grid-template-columns:repeat(4,minmax(0,1fr))}#adicionar-sinais-vitais{margin-top:1.15rem}.additional-vitals{display:grid;gap:.8rem;margin-top:.8rem}.additional-vitals-row{padding:.85rem;border:1px solid var(--line);border-radius:8px;background:var(--pale)}.additional-vitals-heading{display:flex;justify-content:space-between;align-items:center;gap:.75rem;margin-bottom:.7rem}.additional-vitals-heading h3{margin:0;color:var(--blue);font-size:.95rem}.additional-vitals-heading button{min-height:2.2rem;padding:.45rem .7rem}.checks-grid .check input,.inline-section>.check input,.occurrence-add-section .check input,.transferencia-opcoes .check input{width:1.2rem;height:1.2rem;margin:0 .45rem 0 0;vertical-align:-.2rem;accent-color:var(--blue)}.print-additional-vitals{margin-top:1.5mm}.print-additional-vitals>b{display:block;font-size:6.3pt;text-transform:uppercase;color:#333}@media screen and (max-width:1000px){.transfer-details{grid-template-columns:repeat(2,minmax(0,1fr))}}@media screen and (max-width:640px){.transfer-details{grid-template-columns:1fr}.transferencia-opcoes{display:grid;grid-template-columns:1fr}.additional-vitals-heading{align-items:flex-start;flex-direction:column}.additional-vitals-heading button{width:100%}}
.team-signature-field{margin-top:.75rem;padding-top:.65rem;border-top:1px solid var(--line)}.team-signature-label{display:block;margin-bottom:.35rem;color:#29475a;font-size:.82rem;font-weight:700}.team-signature-canvas{display:block;width:100%;height:82px;box-sizing:border-box;border:1px dashed #91adbd;border-radius:6px;background:#fff;touch-action:none;cursor:crosshair}.team-signature-canvas[aria-disabled="true"]{background:#f1f5f7;cursor:not-allowed}.team-signature-actions{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-top:.35rem}.team-signature-actions small{color:#526f80;font-size:.74rem;line-height:1.2}.team-signature-actions button{min-height:1.95rem;padding:.35rem .55rem;font-size:.75rem}@media print{.print-team-signature{display:flex;align-items:center;justify-content:center;overflow:hidden}.print-team-signature-image{display:block;max-width:100%;max-height:10.5mm;object-fit:contain}}

/* Gestão de atendimentos e SAE */
.management-tabs{margin:0 0 1.25rem}.management-subview{min-width:0}.management-subview[data-management-active="false"]{display:none!important}.sae-heading{display:flex;justify-content:space-between;align-items:start;gap:1rem;margin:1.25rem 0}.sae-heading h2{margin:0;color:var(--blue);font-size:1.3rem}.sae-heading p{color:#476275}.sae-identification-grid{display:grid;gap:1rem}.sae-identification-row{display:grid;gap:1rem;min-width:0}.sae-schedules-row{grid-template-columns:repeat(4,minmax(0,1fr))}.sae-patient-row{grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr)}.sae-address-row{grid-template-columns:minmax(0,1fr)}.sae-classification-row{grid-template-columns:repeat(2,minmax(0,1fr))}.sae-subsection-title{margin:1.15rem 0 .65rem;color:var(--blue);font-size:1.05rem}.sae-checks{margin-bottom:1rem}.sae-vitals-list{display:grid;gap:.8rem}.sae-vital-row{padding:.85rem;border:1px solid #c9dce8;border-radius:8px;background:#f4f9fc}.sae-vital-heading{display:flex;justify-content:space-between;align-items:center;gap:.75rem;margin-bottom:.65rem}.sae-vital-heading h3{margin:0;color:var(--blue);font-size:.98rem}.sae-vital-actions{display:flex;flex-wrap:wrap;gap:.5rem}.icon-action{min-width:2.45rem;font-size:1.2rem;line-height:1}.sae-allergy-grid{display:grid;grid-template-columns:minmax(10rem,.38fr) minmax(0,1fr);gap:1rem}.sae-medication-use{display:block;margin-top:1rem}.sae-field-action{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.7rem;align-items:end;margin-top:1rem}.sae-field-action .icon-action{margin-bottom:.1rem;height:2.65rem}.sae-glasgow-action{margin-top:0}.grid.five{grid-template-columns:repeat(5,minmax(0,1fr))}.sae-pain{margin-top:1rem}.sae-pain>strong{display:block;margin-bottom:.55rem;color:var(--blue)}.sae-pain-options{display:flex;flex-wrap:wrap;gap:.5rem}.sae-pain-options .check{display:flex;align-items:center;justify-content:center;gap:.28rem;min-width:3.1rem;margin:0;padding:.45rem .6rem;border:1px solid #c9dce8;border-radius:7px;background:#f4f9fc;font-weight:700}.sae-pain-options .check input{width:1.05rem;height:1.05rem;margin:0;accent-color:var(--blue)}.sae-system-grid{display:grid;grid-template-columns:1fr;gap:1rem}.sae-system-card{padding:1rem;border:1px solid var(--line);border-radius:9px;background:#fbfdfe}.sae-system-card h3{margin:0 0 .65rem;color:var(--blue);font-size:1rem}.sae-system-card .checks-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sae-system-detail{margin-top:.75rem}.sae-diagnosis-list{display:grid;gap:.65rem}.sae-diagnosis{display:grid;grid-template-columns:minmax(14rem,.8fr) minmax(0,1.5fr) minmax(7rem,.35fr);gap:.8rem;align-items:center;padding:.75rem .85rem;border:1px solid var(--line);border-radius:8px;background:#fff}.sae-diagnosis p{margin:0;padding:.65rem .75rem;border-left:3px solid #28749a;border-radius:4px;background:#edf5f8;color:#183a4f;font-size:.9rem;font-weight:600;line-height:1.45}.sae-diagnosis label:last-child{font-size:.82rem}.sae-diagnosis input{margin-top:.2rem}.sae-table{min-width:740px}.sae-table input{margin:0;min-width:5rem}.sae-table td{vertical-align:middle}.sae-table th{background:#e7f1f6}
.sae-system-card{display:grid;gap:.85rem}.sae-system-card h3{margin:0}.sae-system-topic{padding:.8rem .9rem;border-left:3px solid #9dc9de;border-radius:0 7px 7px 0;background:#f4f9fc}.sae-system-topic h4{margin:0 0 .55rem;color:#315e76;font-size:.9rem}.sae-system-card .sae-system-options{grid-template-columns:repeat(3,minmax(0,1fr));gap:.55rem 1rem}.sae-system-card .sae-system-detail{margin:0;padding:.75rem .85rem;background:#eef6f9;border-radius:7px}.sae-system-card .sae-system-detail input{margin-top:.4rem}.sae-diagnosis .check input{width:1.2rem;height:1.2rem;margin:0 .45rem 0 0;vertical-align:-.2rem;accent-color:var(--blue)}@media screen and (min-width:1080px){.sae-system-card .sae-system-options{grid-template-columns:repeat(4,minmax(0,1fr))}}@media screen and (max-width:640px){.sae-system-card .sae-system-options{grid-template-columns:1fr}.sae-system-topic{padding:.75rem}}
@media screen and (max-width:900px){.sae-schedules-row{grid-template-columns:repeat(2,minmax(0,1fr))}.sae-diagnosis{grid-template-columns:1fr}.sae-heading{flex-direction:column}.sae-heading .view-heading-actions{justify-content:flex-start}.grid.five{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media screen and (max-width:640px){.grid.four,.sae-schedules-row,.sae-patient-row,.sae-classification-row,.sae-system-card .checks-grid,.sae-allergy-grid,.grid.five{grid-template-columns:1fr}.management-tabs{margin-inline:-.2rem}.sae-table{min-width:680px}.sae-vital-heading{align-items:flex-start;flex-direction:column}.sae-field-action{grid-template-columns:1fr}.sae-field-action .icon-action{width:100%;margin:0}.sae-pain-options{gap:.38rem}.sae-pain-options .check{min-width:2.7rem}}
@media print{
  body.printing-report .dashboard-hero{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:3mm!important;align-items:stretch!important;margin:2mm 0!important}
  body.printing-report .dashboard-attendance-stack{display:grid!important;grid-template-rows:minmax(30mm,1fr) auto!important;gap:1.5mm!important;min-width:0!important;break-inside:avoid!important}
  body.printing-report .dashboard-hero-card{box-sizing:border-box!important;min-height:30mm!important;aspect-ratio:auto!important;overflow:visible!important;padding:3mm!important;break-inside:avoid!important}
  body.printing-report .dashboard-hero-card span{font-size:8pt!important;line-height:1.2!important}
  body.printing-report .dashboard-hero-card b{font-size:23pt!important;line-height:1!important}
  body.printing-report .dashboard-hero-card small{font-size:7.4pt!important;line-height:1.25!important;overflow-wrap:anywhere!important}
  body.printing-report .dashboard-comparison-cell{display:grid!important;grid-template-columns:32mm minmax(0,1fr) 16mm!important;gap:1.5mm!important;min-height:0!important;padding:1.5mm 2mm!important;font-size:6.8pt!important;line-height:1.2!important;break-inside:avoid!important}
  body.printing-report .dashboard-comparison-cell strong{font-size:6.8pt!important;white-space:nowrap!important}
  body.printing-report .dashboard-comparison-cell b{font-size:8pt!important;white-space:nowrap!important}
  body.printing-report .dashboard-detail-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:3mm!important;margin-top:3mm!important}
  body.printing-report .dashboard-detail-grid .chart-card{min-width:0!important;break-inside:avoid!important}
  body.printing-report .dashboard-detail-grid .chart-card svg{max-width:100%!important;height:auto!important}
  body.printing-report .dashboard-content .report-note{margin-top:3mm!important;break-inside:avoid!important}
  /* SAE: aproveita a área vertical disponível para leitura e descrições clínicas mais confortáveis. */
  .print-sae{font-size:7.1pt;line-height:1.18}.print-sae .print-title{grid-template-columns:27mm 1fr 36mm;gap:2mm;padding:1.4mm 0 1.8mm;margin-bottom:1.8mm}.print-sae .print-logo{max-width:25mm;max-height:14mm}.print-sae .print-title h1{font-size:9.4pt;margin:0}.print-sae .print-service-owner{font-size:6.7pt}.print-sae .print-service-cnpj,.print-sae .print-document span{font-size:6.1pt}.print-sae .print-document{min-height:14mm;padding-left:1.5mm}.print-sae .print-document strong{font-size:7.5pt}.print-sae .sae-unit-heading{margin-bottom:1.5mm;font-size:7.8pt;padding:.9mm 1.5mm}.print-sae .print-section{margin-top:1.8mm}.print-sae .print-section h2{margin:0 0 .9mm;padding-bottom:.45mm;font-size:7.4pt}.print-sae .print-grid,.print-sae .print-time-line,.print-sae .print-vitals{gap:.9mm 1.8mm;margin-top:.9mm}.print-sae .print-field b{font-size:6.1pt}.print-sae .print-field span{min-height:0;font-size:6.8pt;line-height:1.17}.print-sae .print-text{min-height:0;padding:1mm;font-size:6.8pt;line-height:1.2}.print-sae .sae-print-exam{columns:2;column-gap:3.5mm}.print-sae .sae-print-system{display:inline-block;width:100%;margin-top:1.2mm;break-inside:avoid;page-break-inside:avoid}.print-sae .sae-print-system h2{font-size:7pt}.print-sae .sae-print-diagnoses{display:grid;gap:1mm}.print-sae .sae-print-diagnosis{border:.4px solid #999;padding:1mm;break-inside:avoid}.print-sae .sae-print-diagnosis>b{display:block;font-size:6.9pt}.print-sae .sae-print-diagnosis p{margin:.45mm 0;font-size:6.7pt;line-height:1.22}.print-sae .sae-print-diagnosis span{font-size:6.6pt}.print-sae .sae-print-other-notes{margin-top:1mm}.print-sae .print-foot{margin-top:1.6mm;font-size:6pt}
}
/* Campos nativos respeitam a largura da própria coluna, sem forçar dimensões do Safari. */
#ficha-form fieldset,#ficha-form .grid,#ficha-form .grid>label{min-width:0;min-inline-size:0}
#ficha-form .grid>label>input,#ficha-form .grid>label>select,#ficha-form .grid>label>textarea{box-sizing:border-box;min-width:0;min-inline-size:0;max-width:100%}
/* Celulares em uma coluna. */
@media screen and (max-width:640px){
  #ficha-form .occurrence-times-grid,#ficha-form .top-times,#ficha-form .closing-grid,#linhas-destino .destination-row{grid-template-columns:100%!important;gap:1rem!important}
}
/* Tablet: preserva colunas nos dados gerais, mas data e horários usam linhas próprias. */
@media screen and (min-width:641px) and (max-width:1300px){
  #ficha-form .occurrence-times-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:1rem!important}
  #ficha-form .occurrence-times-grid>label:nth-child(1),
  #ficha-form .occurrence-times-grid>label:nth-child(4),
  #ficha-form .occurrence-times-grid>label:nth-child(5),
  #ficha-form .occurrence-times-grid>label:nth-child(6){grid-column:1/-1}
  #ficha-form .top-times,#ficha-form .closing-grid,#linhas-destino .destination-row{grid-template-columns:minmax(0,1fr)!important;gap:1rem!important}
  #ficha-form .top-times{margin-bottom:1rem!important}
}

/* Navega\u00e7\u00e3o e preenchimento em telas port\u00e1teis.
   Estas regras finais consolidam os pontos de quebra para que os campos n\u00e3o
   recebam grades conflitantes ao alternar entre retrato e paisagem. */
html{scroll-padding-top:6.25rem}
body{max-width:100%;overflow-x:clip}
.app-shell,.content,.statistics-subview,#ficha-form,.table-wrap{min-width:0}
.nav,.statistics-tabs{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.table-wrap{-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;overscroll-behavior-y:auto}
.nav,.statistics-tabs{scroll-snap-type:x proximity;scrollbar-width:thin}
.nav-item,.statistics-tab{scroll-snap-align:start}
input,select,textarea{scroll-margin-block:7rem 2rem}

@media screen and (min-width:641px) and (max-width:1099px){
  /* Tablets e celulares em paisagem usam o conte\u00fado inteiro, sem menu lateral. */
  .app-shell{display:block;padding:1rem 1.25rem max(2.5rem,env(safe-area-inset-bottom))}
  .nav{position:sticky;top:4.6rem;z-index:20;display:flex;flex-direction:row;overflow-x:auto;overflow-y:hidden;margin:0 0 1.25rem;padding:.45rem}
  .nav-item{flex:0 0 auto;white-space:nowrap}
  /* Os dois hor\u00e1rios de avalia\u00e7\u00e3o cabem lado a lado, sem reduzir a coluna. */
  #ficha-form .top-times{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:1rem!important}
}

@media screen and (max-width:640px){
  html{scroll-padding-top:1rem}
  .app-header{position:static}
  .nav,.statistics-tabs{overscroll-behavior-x:contain}
  input,select,textarea{font-size:16px;scroll-margin-block:1rem 2rem}
  .table-wrap{touch-action:pan-x pan-y}
}

@media screen and (orientation:landscape) and (max-height:560px) and (max-width:1099px){
  /* Em pouca altura, o cabe\u00e7alho e os blocos ficam mais compactos para sobrar \u00e1rea \u00fatil. */
  .app-header{min-height:3.8rem;padding:.55rem 1rem}
  .app-logo{width:60px;height:35px}
  .app-header strong{font-size:1.12rem}
  .muted{font-size:.8rem}
  .nav{top:3.8rem;margin-bottom:.8rem}
  .app-shell{padding-top:.75rem;padding-bottom:1.5rem}
  .view-heading{margin-bottom:1rem;padding-bottom:.7rem}
  fieldset{margin:1rem 0;padding:1rem}
}

/* Modo de apresentação: um painel principal por vez, próprio para telas públicas. */
.dashboard-presentation-active .dashboard-hero{display:block;width:min(100%,72rem,calc((100vh - 12rem)*16/9));max-width:100%;aspect-ratio:16/9;min-height:0;margin:0 auto}
.dashboard-presentation-active .dashboard-hero>*{display:none}
.dashboard-presentation-active .dashboard-hero>*.dashboard-slide-active{display:block;height:100%;animation:dashboard-slide-in .55s ease both}
.dashboard-presentation-active .dashboard-hero>.dashboard-panel-stack.dashboard-slide-active{display:grid;height:100%;grid-template-rows:minmax(0,1fr) auto;gap:1rem}
.dashboard-presentation-active .dashboard-hero-card{box-sizing:border-box;min-height:0;height:100%;aspect-ratio:auto;padding:clamp(1.25rem,3vw,2.35rem)}
.dashboard-presentation-active .dashboard-panel-stack .dashboard-hero-card{height:auto}
.dashboard-presentation-active .dashboard-hero-card span{font-size:clamp(1rem,2vw,1.45rem)}
.dashboard-presentation-active .dashboard-hero-card b{margin:.7rem 0;font-size:clamp(3.4rem,9vw,7rem)}
.dashboard-presentation-active .dashboard-hero-card small{max-width:42rem;font-size:clamp(1rem,2vw,1.55rem);line-height:1.35}
.dashboard-presentation-active .dashboard-comparison-cell{min-height:3.2rem;padding:.8rem 1rem;font-size:clamp(.85rem,1.45vw,1.05rem)}
.dashboard-presentation-active .dashboard-detail-grid,.dashboard-presentation-active>.report-note{display:none}
@keyframes dashboard-slide-in{from{opacity:.1;transform:translate3d(1.4rem,0,0) scale(.985)}to{opacity:1;transform:translate3d(0,0,0) scale(1)}}
@media (prefers-reduced-motion:reduce){.dashboard-presentation-active .dashboard-hero>*.dashboard-slide-active{animation:none}}
@media print{
  body.printing-report .dashboard-presentation-active .dashboard-hero{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;min-height:0!important;max-width:none!important;margin:2mm 0!important}
  body.printing-report .dashboard-presentation-active .dashboard-hero>*{display:block!important}
  body.printing-report .dashboard-presentation-active .dashboard-hero>.dashboard-attendance-stack{display:grid!important}
  body.printing-report .dashboard-presentation-active .dashboard-hero-card{min-height:30mm!important;padding:3mm!important}
  body.printing-report .dashboard-presentation-active .dashboard-detail-grid{display:grid!important}
  body.printing-report .dashboard-presentation-active>.report-note{display:block!important}
}

/* Fechamento de plantão: folha de rosto administrativa, legível em tela e A4. */
.shift-closure-panel{background:#fff;border-top:4px solid var(--blue)}
.shift-closure-controls{display:grid;grid-template-columns:minmax(0,220px) minmax(0,290px) auto;gap:1rem;align-items:end;padding:1rem;border:1px solid var(--line);border-radius:10px;background:var(--pale)}
.shift-closure-action button{width:100%;min-height:2.7rem}.shift-closure-content{margin-top:1.15rem}.shift-summary-banner{display:flex;justify-content:space-between;gap:1rem;padding:1rem 1.1rem;border-radius:11px;background:linear-gradient(135deg,#123b57,#1879ae);color:#fff;box-shadow:0 6px 18px rgba(17,57,84,.15)}
.shift-summary-banner>div{display:grid;gap:.1rem}.shift-summary-banner span{font-size:.78rem;opacity:.84;text-transform:uppercase;letter-spacing:.04em}.shift-summary-banner strong{font-size:1.05rem}.shift-summary-banner small{opacity:.92}.shift-overview-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem;margin:1rem 0}.shift-overview-cards article{padding:.85rem 1rem;border:1px solid var(--line);border-radius:10px;background:#f7fbfd}.shift-overview-cards article.warning{background:#fff7e7;border-color:#e5c47e}.shift-overview-cards span{display:block;color:#476275;font-size:.85rem}.shift-overview-cards b{display:block;margin-top:.15rem;font-size:1.65rem;color:var(--blue)}
.shift-section{margin-top:1.25rem;padding-top:1.15rem;border-top:1px solid var(--line)}.shift-section-heading{display:flex;justify-content:space-between;gap:1rem;align-items:baseline;margin-bottom:.8rem}.shift-section-heading h2{margin:0;color:var(--blue);font-size:1.08rem}.shift-section-heading p{color:#476275;font-size:.88rem}.shift-unit-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.85rem}.shift-unit-card{padding:1rem;border:1px solid var(--line);border-radius:10px;background:#fbfdfe}.shift-unit-card h3{margin:0;color:var(--ink)}.shift-unit-total{display:flex;align-items:baseline;gap:.4rem;margin:.6rem 0;padding:.55rem .65rem;border-radius:7px;background:var(--pale)}.shift-unit-total b{font-size:1.55rem;color:var(--blue)}.shift-unit-total span{font-size:.84rem;color:#476275}.shift-unit-card ul,.shift-professional-group ul{list-style:none;margin:0;padding:0}.shift-unit-card li{display:flex;justify-content:space-between;gap:.7rem;padding:.3rem 0;border-bottom:1px solid #e7eef2;font-size:.9rem}.shift-unit-card li:last-child{border-bottom:0}.shift-unit-card .shift-non-performed{margin-top:.25rem;color:#7c5108;font-weight:700}
.shift-professional-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem}.shift-professional-group{padding:.9rem;border:1px solid var(--line);border-radius:10px;background:#fbfdfe}.shift-professional-group h3{margin:0 0 .5rem;color:var(--blue);font-size:1rem}.shift-professional-group li{display:flex;align-items:center;justify-content:space-between;gap:.7rem;padding:.45rem 0;border-bottom:1px solid #e7eef2;font-size:.88rem}.shift-professional-group li:last-child{border-bottom:0}.shift-professional-group li>span{overflow-wrap:anywhere}.shift-professional-group em{padding:.16rem .4rem;border-radius:999px;background:#e8f2f7;color:#245b78;font-size:.72rem;font-style:normal;white-space:nowrap}.shift-empty{color:#6b8090;font-style:italic}.shift-manual-add{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.55rem;align-items:end;margin-top:.8rem;padding-top:.8rem;border-top:1px dashed var(--line)}.shift-manual-add label{font-size:.82rem}.shift-manual-add input{font-size:.9rem}.shift-remove{padding:.32rem .5rem;font-size:.76rem;white-space:nowrap}
@media screen and (max-width:800px){.shift-closure-controls,.shift-unit-grid,.shift-professional-grid,.shift-overview-cards{grid-template-columns:1fr}.shift-summary-banner,.shift-section-heading{flex-direction:column;align-items:flex-start}.shift-manual-add{grid-template-columns:1fr}.shift-manual-add button{width:100%}}
@media print{body.printing-report .shift-summary-banner{padding:2mm 2.5mm;border:.4px solid #000;background:#fff!important;color:#000!important;box-shadow:none;break-inside:avoid}body.printing-report .shift-summary-banner span,body.printing-report .shift-summary-banner small{color:#000!important;opacity:1}body.printing-report .shift-overview-cards{grid-template-columns:repeat(3,minmax(0,1fr));gap:2mm;margin:2mm 0}body.printing-report .shift-overview-cards article,body.printing-report .shift-unit-card,body.printing-report .shift-professional-group{padding:1.5mm;border:.4px solid #777;background:#fff;break-inside:avoid}body.printing-report .shift-overview-cards b{font-size:12pt;color:#000}body.printing-report .shift-section{margin-top:2mm;padding-top:2mm;break-inside:avoid}body.printing-report .shift-section-heading{margin-bottom:1mm}body.printing-report .shift-section-heading h2{font-size:9pt;color:#000}body.printing-report .shift-section-heading p{font-size:6.5pt}body.printing-report .shift-unit-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:2mm}body.printing-report .shift-unit-card h3,body.printing-report .shift-professional-group h3{font-size:7.4pt;color:#000}body.printing-report .shift-unit-total{margin:1mm 0;padding:1mm;background:#eee}body.printing-report .shift-unit-total b{font-size:10pt;color:#000}body.printing-report .shift-unit-card li,body.printing-report .shift-professional-group li{font-size:6.5pt;padding:.6mm 0}body.printing-report .shift-professional-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:2mm}body.printing-report .shift-professional-group em{font-size:5.5pt;padding:.35mm .7mm;color:#000;background:#eee}body.printing-report .shift-manual-add,body.printing-report .shift-remove{display:none!important}}

/* Leitura mais confortável nas fichas digitais, sem alterar a estrutura dos campos. */
#ficha-form,#sae-form{font-size:1.04rem}
#ficha-form input,#ficha-form select,#ficha-form textarea,#sae-form input,#sae-form select,#sae-form textarea{font-size:1.01em}
#ficha-form legend,#sae-form legend{font-size:1.08em}
#ficha-form .check,#sae-form .check{font-size:1.02em}

@media print{
  /* O espaço disponível no A4 permite elevar discretamente a leitura sem transbordar. */
  .print-record:not(.print-sae){font-size:8pt}
  .print-record:not(.print-sae) .print-section h2{font-size:8.3pt}
  .print-record:not(.print-sae) .print-field span{font-size:8pt}
  .print-record:not(.print-sae) .print-text{font-size:7.95pt}
  .print-sae{font-size:7.35pt}
  .print-sae .print-section h2{font-size:7.6pt}
  .print-sae .print-field span,.print-sae .print-text{font-size:7pt}
  .print-sae .sae-print-diagnosis p{font-size:6.9pt}
}

/* Histórico importado e identificação profissional da SAE. */
.sae-history-import{margin-top:.85rem}.sae-history-import .sae-subsection-title{margin-top:0}.sae-history-import .sae-checks{margin-bottom:0}.sae-nurse-identification{border-color:#9dc9de;background:#f4f9fc}
