
:root{--bg:#f3f7f7;--card:#fff;--green:#116b5e;--dark:#163b38;--muted:#647b79;--line:#dce8e6;--focus:#197e70}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:#1c3532;font:16px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif}header{background:linear-gradient(110deg,#0d5b50,#148773);color:white;padding:30px 20px}header .wrap{max-width:1000px;margin:auto}h1{font-size:clamp(23px,3vw,34px);margin:4px 0}h2{font-size:20px;color:var(--dark);margin:0 0 18px}header p{margin:5px 0;opacity:.9}.tag{font-size:12px;letter-spacing:.12em;font-weight:800;text-transform:uppercase}.container{max-width:1000px;margin:24px auto;padding:0 16px 40px}.tabs{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:20px}button{cursor:pointer;font:inherit;font-weight:650;border:0;border-radius:10px;padding:12px 18px}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #79d4c4;outline-offset:2px}.tab{background:#e1efec;color:var(--green)}.tab.active,.primary{background:var(--green);color:white}.secondary{background:#e5f0ed;color:var(--green)}.danger{background:#fff0ed;color:#a13a29}.card{background:var(--card);border:1px solid var(--line);border-radius:17px;padding:24px;margin-bottom:18px;box-shadow:0 4px 16px #163b3809}.intro{background:#eef8f5;border-left:4px solid var(--green);padding:16px;border-radius:9px;margin-bottom:22px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.field label,.question legend{display:block;font-weight:750;margin-bottom:8px}.required{color:#a32929}input[type=text],input[type=number],input[type=date],textarea{width:100%;border:1px solid #c4d8d3;border-radius:9px;padding:12px;font:inherit;background:#fff;color:#1c3532}textarea{min-height:105px;resize:vertical}fieldset{border:0;padding:0;margin:0}.question{padding:22px 0;border-top:1px solid var(--line)}.question:first-child{border-top:0;padding-top:0}.option{display:flex;gap:11px;align-items:flex-start;margin:10px 0;padding:10px;border:1px solid #e7efed;border-radius:10px;cursor:pointer}.option:has(input:checked){background:#edf8f5;border-color:#7dbcb0}.option input{accent-color:var(--green);width:18px;height:18px;margin-top:3px;flex:none}.small{color:var(--muted);font-size:13px}.actions{display:flex;gap:10px;flex-wrap:wrap}.hidden{display:none!important}.notice{padding:12px 16px;background:#e8f5ec;border:1px solid #b7d8c2;border-radius:9px;color:#235c3d;margin:12px 0}.stats{display:flex;gap:14px;flex-wrap:wrap}.stat{background:#eef7f4;padding:15px 19px;border-radius:10px}.stat strong{font-size:26px;display:block;color:var(--green)}.table-scroll{overflow:auto}table{width:100%;border-collapse:collapse;min-width:610px}th,td{padding:12px;border-bottom:1px solid var(--line);text-align:left}th{color:var(--green);font-size:13px}footer{text-align:center;color:var(--muted);margin:28px 0;font-size:13px}.empty{padding:28px;text-align:center;color:var(--muted)}@media(max-width:650px){.grid{grid-template-columns:1fr}.card{padding:17px}.actions button{flex:1}.container{margin-top:15px}}@media print{header,.tabs,.actions,#records,#alert,.small.storage,footer{display:none!important}body{background:#fff}.container{max-width:none}.card{box-shadow:none;border:0;padding:0}.question{break-inside:avoid}.option{padding:4px;border:0}#formView{display:block!important}}
.voice-button{background:#daf2e9;color:#075a48;border:1px solid #89c6b4;padding:9px 13px;font-size:14px;display:inline-flex;gap:7px;align-items:center;margin:8px 0}
.voice-button.listening{background:#b63236;color:#fff;animation:pulse 1s infinite}.voice-button:disabled{opacity:.55;cursor:not-allowed}
.voice-hint{font-size:13px;color:#526b67;margin:4px 0 9px}.voice-output{font-size:14px;padding:9px 12px;border-radius:8px;background:#f1f7f5;border:1px solid #d7e7e2;margin:5px 0;overflow-wrap:anywhere}
.voice-output:empty{display:none}.voice-panel{background:#e7f5ef;border:1px solid #a8d5c5;border-radius:12px;padding:14px;margin-bottom:16px}
@keyframes pulse{50%{filter:brightness(1.3)}}@media print{.voice-button,.voice-output,.voice-hint,.voice-panel{display:none!important}}

/* Dashboard sem dependências externas de terceiros. */
:root{--blue:#4475cb;--blue-light:#eff4ff;--green-light:#effaf7;--compareB:#6480d6}
#dashboard h2{margin:0}#dashboard h3{font-size:16px;line-height:1.3;color:#204841;margin:0 0 12px}
#dashboard select{width:100%;border:1px solid #c4d8d3;border-radius:9px;background:#fff;padding:11px 36px 11px 12px;min-height:47px;color:#1c3532;font:inherit}
#formView select{width:100%;border:1px solid #c4d8d3;border-radius:9px;background:#fff;padding:12px;min-height:49px;color:#1c3532;font:inherit}#formView select:focus-visible{outline:3px solid #79d4c4;outline-offset:2px}.demographics-grid{grid-template-columns:1fr 1fr 1fr}@media(max-width:760px){.demographics-grid{grid-template-columns:1fr 1fr}}@media(max-width:650px){.demographics-grid{grid-template-columns:1fr}}#dashboard label{display:block;font-size:13px;font-weight:750;margin-bottom:7px;color:#315e56}
#dashboard select:focus-visible{outline:3px solid #79d4c4;outline-offset:2px}
.dashboard-hero{display:flex;gap:20px;justify-content:space-between;align-items:center;background:linear-gradient(125deg,#103b37,#126d5d 75%,#1b8876);color:white;padding:25px 26px;border-radius:17px;margin-bottom:15px}
.dashboard-hero h2{color:white!important;font-size:clamp(22px,3vw,29px)!important;margin:5px 0 6px!important}.dashboard-hero p{margin:0;opacity:.86;max-width:580px}.dash-hero-actions{display:flex;gap:8px;flex-wrap:wrap}.light-button{background:#ffffffeb;color:#155b52;font-size:13px;white-space:nowrap;padding:11px 14px}.light-button:hover{background:white}.dash-note{padding:13px 16px;background:#eef8f5;border-left:3px solid #438b7e;color:#49625c;font-size:13px;border-radius:8px;margin:0 0 15px}
.dash-filters{padding:19px 22px}.filter-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;gap:12px}.filter-header h2{font-size:17px!important}.compact{font-size:13px;padding:8px 12px}.dash-filter-grid{display:grid;grid-template-columns:1.3fr 1.15fr 1.15fr 1fr 1fr;gap:12px}.filter-footer{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;padding-top:15px;font-size:12px;color:#647b79;font-weight:600}
.kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;margin-bottom:27px}.kpi{background:white;border:1px solid #dce8e6;border-radius:15px;padding:17px 19px;box-shadow:0 4px 15px #163b3808;min-height:122px}.kpi-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.kpi-label{font-size:13px;font-weight:650;color:#58756f}.kpi-ico{width:33px;height:33px;border-radius:10px;background:#e6f6ef;display:flex;justify-content:center;align-items:center;font-size:17px}.kpi-value{font-size:clamp(24px,3vw,32px);color:#114f46;font-weight:800;line-height:1.2;margin:5px 0 2px}.kpi-detail{color:#6f8680;font-size:12px;line-height:1.3}
.dash-section-heading{display:flex;justify-content:space-between;gap:15px;align-items:end;margin:26px 0 14px}.dash-section-heading h2{font-size:22px!important;color:#1f4441!important}.dash-eyebrow{font-size:11px;font-weight:800;color:#198773;letter-spacing:.13em}.muted-inline{font-size:12px;color:#798a85}.dash-profile{display:grid;grid-template-columns:1fr 1fr;gap:15px}.dash-profile .card{margin:0;padding:22px}.dash-charts-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}.chart-card{margin:0;padding:20px;min-width:0}.chart-head{display:flex;align-items:center;justify-content:space-between;gap:9px;margin-bottom:8px}.chart-index{color:#13806f;background:#ecf7f3;font-size:12px;font-weight:800;padding:5px 9px;border-radius:7px;white-space:nowrap}.chart-title{font-size:16px!important;margin:0 0 8px!important}.chart-sub{font-size:12px;color:#748d87;margin:0 0 19px!important}
.chart-bars{display:grid;gap:12px}.bar-item{min-width:0}.bar-meta{display:flex;align-items:start;justify-content:space-between;gap:13px;margin-bottom:5px;font-size:13px}.bar-name{color:#31564e;line-height:1.35;min-width:0;overflow-wrap:anywhere}.bar-val{font-weight:800;white-space:nowrap;color:#124f46;font-variant-numeric:tabular-nums}.bar-val small{font-size:11px;color:#739087;font-weight:550}.bar-track{height:9px;border-radius:20px;background:#e9f2ef;overflow:hidden}.bar-fill{height:100%;background:linear-gradient(90deg,#14947c,#50baa3);border-radius:20px;min-width:0;transition:width .25s ease}.bar-fill.blue{background:linear-gradient(90deg,#5b7cc8,#93a9e8)}.no-responses{background:#f6faf8;color:#637c75;text-align:center;border-radius:10px;padding:23px 13px;font-size:13px}.chart-footer{border-top:1px solid #e6edeb;padding-top:12px;font-size:11px;color:#718780;margin-top:16px}.dash-comparison{padding:22px}.compare-controls{display:grid;grid-template-columns:1.35fr 1fr 1fr 1fr;gap:12px}.compare-legend{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin:20px 0 10px;color:#4b665e;font-size:13px;font-weight:650}.compare-legend>span{display:flex;align-items:center;gap:6px}.dot{display:inline-block;width:11px;height:11px;border-radius:3px}.dot-a{background:#14947c}.dot-b{background:#6480d6}.compare-row{padding:14px 0;border-bottom:1px solid #e8efec}.compare-option{font-size:14px;font-weight:720;color:#224e45;margin-bottom:10px}.compare-pair{display:grid;grid-template-columns:1fr 1fr;gap:16px}.compare-percent{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#55716a;margin-bottom:5px}.compare-percent strong{color:#124e46}.compare-summary{font-size:13px;color:#5e766e;background:#f3f8f6;border-radius:9px;padding:11px 13px;margin-bottom:9px}.dash-empty{text-align:center;padding:35px 24px}.empty-icon{display:block;font-size:38px;color:#2e947d;margin-bottom:5px}.dash-empty p{color:#657e75}.dashboard-hidden{display:none!important}
@media(max-width:880px){.dash-filter-grid,.compare-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-hero{align-items:start;flex-direction:column}.dash-profile,.dash-charts-grid{grid-template-columns:1fr}.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:550px){.kpi-grid{grid-template-columns:1fr 1fr;gap:9px}.kpi{padding:13px;min-height:105px}.kpi-label{font-size:12px}.kpi-value{font-size:25px}.dash-filter-grid,.compare-controls{grid-template-columns:1fr}.compare-pair{grid-template-columns:1fr;gap:7px}.dashboard-hero{padding:19px}.dash-hero-actions{width:100%}.dash-hero-actions button{flex:1}.dash-section-heading{display:block}.muted-inline{display:block;margin-top:6px}.dash-charts-grid{gap:12px}}
@media print{header,.tabs,#formView,#records,footer,#alert,.dash-hero-actions,.dash-note,.dash-filters,.dashboard-hero .tag,#dashGoForm{display:none!important}#dashboard{display:block!important}#dashboard .card,.kpi{box-shadow:none;break-inside:avoid}#dashboard .dashboard-hero{background:#fff!important;color:#134b41!important;padding:5px 0 15px;border-bottom:2px solid #397b70}#dashboard .dashboard-hero h2{color:#123f38!important}#dashboard .dashboard-hero p{color:#405c55}#dashboard .dash-charts-grid,#dashboard .dash-profile{grid-template-columns:1fr 1fr}#dashboard .kpi-grid{grid-template-columns:repeat(3,1fr)}#dashboard .dash-section-heading{break-after:avoid}#dashboard .chart-card{break-inside:avoid}#dashboard .dash-comparison{break-inside:auto}#dashboard .compare-row{break-inside:avoid}#dashboard .bar-fill{-webkit-print-color-adjust:exact;print-color-adjust:exact}#dashboard .compare-summary{print-color-adjust:exact}#dashboard .dot{print-color-adjust:exact}body{font-size:11px}#dashboard .chart-title{font-size:13px!important}#dashboard .bar-name{font-size:11px}@page{size:A4;margin:11mm}}

@media print{body.print-form #formView{display:block!important}body.print-form #dashboard{display:none!important}body.print-dashboard #formView{display:none!important}body.print-dashboard #dashboard{display:block!important}}
/* Exibição por perfil (a segurança efetiva é validada na API). */
body.auth-locked>header,body.auth-locked>main,body.auth-locked>footer,body.auth-locked>#userBar{display:none!important}
#authGate{display:none;min-height:100vh;background:linear-gradient(135deg,#e7f4ef,#eff3fb);padding:28px 15px;align-items:center;justify-content:center}
body.auth-locked #authGate{display:flex}
.auth-card{width:min(100%,480px);background:white;padding:30px;border-radius:22px;border:1px solid #d7e8df;box-shadow:0 16px 54px #193e3930}
.auth-logo{width:min(100%,320px);height:auto;background:transparent;display:flex;align-items:center;justify-content:center;margin:0 auto 16px}.auth-logo img{display:block;width:100%;height:auto;object-fit:contain;background:transparent}
.auth-card h1{color:#143e37;font-size:28px;margin:5px 0 6px}.auth-card p{color:#5c776f;margin:5px 0 20px}
.auth-card .field{margin-bottom:14px}.auth-card label{display:block;font-weight:750;font-size:13px;margin-bottom:6px;color:#2d574c}
.auth-card input,#usersView input,#usersView select{width:100%;border:1px solid #bdd5cc;border-radius:9px;padding:12px;font:inherit;color:#1c3532;background:#fff}
.auth-card .primary{width:100%;margin-top:6px}.auth-warning{font-size:12px;color:#697e76;background:#f5f8f7;border-radius:8px;padding:11px;margin-top:17px}
.auth-error{color:#a12d2d!important;font-size:13px;margin:9px 0!important;min-height:20px}
#userBar{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:1000px;margin:14px auto 0;padding:11px 17px;background:#e0eee9;border-radius:10px;color:#154e42;font-size:14px}
#userBar .secondary{padding:7px 11px;font-size:13px}#usersView .field{margin:0}#usersView label{display:block;font-size:13px;font-weight:700;margin-bottom:6px}
#usersView table{min-width:480px}#usersView .button-small{padding:7px 10px;font-size:12px}
#usersView .user-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}#usersView .user-grid .wide{grid-column:span 2}
body.role-entrevistador #tabDashboard,body.role-entrevistador #tabRecords,body.role-entrevistador #tabUsers{display:none!important}
@media(max-width:650px){#userBar{margin:12px 14px 0}.auth-card{padding:22px}#usersView .user-grid{grid-template-columns:1fr}#usersView .user-grid .wide{grid-column:span 1}}
@media print{#authGate,#userBar,#usersView,#tabUsers{display:none!important}body.auth-locked>header,body.auth-locked>main,body.auth-locked>footer{display:none!important}}

#numero[readonly]{background:#e9f5f0;color:#185a49} .migration-tip{background:#f0f7fa;padding:13px;border-radius:10px;border:1px solid #d4e7ef;margin:12px 0}
