/* Complemento: preserva style.css e publicacoes.css existentes. */
:root{--forest:#23583d;--leaf:#e7f1e8;--ink:#273c31}
[hidden]{display:none!important}
.portal-shell{background:#f5f7f2}
.sidebar{position:fixed;inset:0 auto 0 0;width:252px;padding:28px 18px 20px;display:flex;flex-direction:column;align-items:stretch;flex-wrap:nowrap;gap:22px;overflow-y:auto;background:#fff;border-right:1px solid #dce6df;border-bottom:0;box-shadow:2px 0 18px #254d3010;z-index:20}
.sidebar .brand{display:flex;gap:12px;align-items:center;font-size:18px;line-height:1.25;min-width:0;color:var(--forest)}
.sidebar .brand:hover{text-decoration:none}.sidebar .brand small{margin-top:6px}.school-tree{width:52px;height:62px;flex-shrink:0;object-fit:contain}
.sidebar nav{display:flex;flex-direction:column;flex:0 0 auto;gap:5px;flex-wrap:nowrap;overflow:visible;order:initial}
.sidebar nav a{padding:11px 15px;font-size:14px;font-weight:500;border-radius:10px;white-space:normal}
.sidebar nav a.active{font-weight:700;background:var(--leaf);box-shadow:inset 3px 0 var(--forest)}
.sidebar-account{margin-top:auto;padding:18px 10px 0;border-top:1px solid #e7ede7;font-size:13px;overflow-wrap:anywhere}
.sidebar-account small{display:block;color:#6d7f72;margin-top:4px}.sidebar-account .logout{margin:14px 0 0}.sidebar-account button{width:100%}
.sidebar-toggle{display:none}.portal-shell main{width:calc(100% - 252px);max-width:1400px;margin:0 0 0 252px;padding:38px 38px 70px;min-height:100vh}
.login-tree{object-fit:contain;display:block;width:76px;height:82px;margin:0 auto 18px}.login-wrap{max-width:470px}
.routine-heading{display:flex;justify-content:space-between;align-items:center;gap:18px}.routine-heading h2{margin:4px 0 8px}.eyebrow{text-transform:uppercase;letter-spacing:.09em;font-size:11px;font-weight:700;color:#6b806f}
.routine-badge{background:var(--leaf);color:var(--forest);padding:6px 12px;border-radius:20px;font-size:12px;white-space:nowrap}
.routine-editor select,.routine-editor textarea{width:100%}.routine-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 22px}.routine-fields>div:last-child{grid-column:1/-1}
.routine-workspace{display:grid;grid-template-columns:200px minmax(0,1fr);border:1px solid #dce6df;border-radius:12px;overflow:hidden;margin:16px 0}
.routine-field-list{padding:20px;background:#f5f8f4;border-right:1px solid #dce6df}.routine-students{max-height:580px;overflow-y:auto;padding:18px}
.routine-student{display:grid;grid-template-columns:minmax(130px,.8fr) minmax(0,1.2fr);gap:18px;padding:15px 0;border-bottom:1px solid #e6ede6;align-items:center}.routine-student strong{font-size:13px;overflow-wrap:anywhere}.routine-student label{margin:0}.routine-student label{font-size:12px}
.routine-batch{display:flex;align-items:end;gap:10px;padding:0 0 18px;border-bottom:1px solid #dce6df}.routine-batch label{flex:1;margin:0}
.routine-summary{display:grid;grid-template-columns:160px minmax(0,1fr);margin:18px 0;font-size:14px}.routine-summary dt,.routine-summary dd{padding:12px;margin:0;border-bottom:1px solid #e3ebe3;white-space:pre-wrap;overflow-wrap:anywhere}.routine-summary dt{font-weight:600;background:#f5f8f4}
.routine-editor details{padding:13px 0;border-bottom:1px solid #e3ebe3}.routine-editor summary{cursor:pointer}
@media(max-width:1100px){.portal-shell main{padding:28px 24px 60px}.sidebar{width:230px}.portal-shell main{width:calc(100% - 230px);margin-left:230px}.routine-workspace{grid-template-columns:160px minmax(0,1fr)}}
@media(max-width:780px){.sidebar{position:sticky;inset:auto;top:0;width:100%;padding:12px 16px;display:grid;grid-template-columns:1fr auto;gap:10px;border-right:0;border-bottom:1px solid #dce6df;max-height:85vh}.sidebar .brand{font-size:15px}.school-tree{width:35px;height:42px}.sidebar .brand small{margin-top:2px}.sidebar-toggle{display:block;align-self:center}.sidebar nav{grid-column:1/-1;gap:3px;max-height:48vh;overflow-y:auto;flex-basis:auto}.sidebar-account{grid-column:1/-1;margin-top:0;padding:10px 0 0;display:flex;align-items:center;gap:10px}.sidebar-account small{margin:0}.sidebar-account .logout{margin:0 0 0 auto}.sidebar-account button{width:auto}.js .sidebar:not(.menu-open) nav,.js .sidebar:not(.menu-open) .sidebar-account{display:none}.portal-shell main{margin:0;width:100%;padding:24px 16px 50px;min-height:80vh}.routine-workspace{grid-template-columns:1fr}.routine-field-list{border-right:0;border-bottom:1px solid #dce6df;padding:14px}.routine-students{padding:12px}.routine-fields{grid-template-columns:1fr}.routine-student{grid-template-columns:1fr;gap:8px}.routine-summary{grid-template-columns:110px minmax(0,1fr)}.routine-batch{flex-wrap:wrap}.routine-batch label{flex-basis:100%}}
/* Editor completo e alternativas visíveis. */
.compose-options{border:1px solid #dce7df;border-radius:12px;padding:18px;margin:22px 0}.compose-options-row,.choice-row{display:flex;flex-wrap:wrap;gap:8px}.option-chip,.choice-chip{display:flex;flex-direction:row;align-items:center;gap:7px;cursor:pointer;margin:0;padding:10px 13px;border:1px solid #cdddcf;border-radius:9px;font-size:13px;background:#fff;font-weight:500;white-space:normal}.option-chip:has(input:checked),.choice-chip:has(input:checked),.option-chip[aria-expanded=true]{border-color:#3a7f4a;background:#eaf4e8;color:#225d35}.option-chip input,.choice-chip input{accent-color:#2d7949;min-height:0!important;width:17px!important;height:17px;flex:0 0 17px;padding:0!important}.compose-option-panel{padding:20px 0 0;margin-top:18px;border-top:1px solid #e0e9df}.routine-choices{border:0;padding:0;margin:0 0 16px;min-width:0}.routine-choices legend{font-size:13px;font-weight:600;margin-bottom:9px;color:#405448}.routine-student{grid-template-columns:150px minmax(0,1fr)}.routine-student .routine-choices{margin:0}.routine-batch-values{flex:1}.routine-batch-values>strong{font-size:13px;display:block;margin-bottom:10px}.routine-tabs{display:flex;flex-direction:column;gap:5px;margin-bottom:15px}.routine-tabs button{text-align:left;white-space:normal;border:0;background:transparent;padding:10px}.routine-tabs button[aria-pressed=true]{background:#deecd9;color:#235d36}.routine-editor .routine-fields{grid-template-columns:1fr}.routine-editor .routine-fields>fieldset{padding:14px 0;border-bottom:1px solid #e6ece3}.routine-choices input[type=hidden]{display:none}
@media(max-width:780px){.routine-student{grid-template-columns:1fr}.routine-tabs{flex-direction:row;flex-wrap:wrap}.routine-tabs button{border:1px solid #dce7df;font-size:12px}.choice-chip{padding:10px;font-size:12px}.compose-options{padding:12px}.routine-batch{align-items:stretch;flex-direction:column}}

.include-option{display:flex;align-items:center;gap:.5rem;margin-bottom:1rem;font-weight:600}.include-option input{width:auto}

.option-chip.is-included{border-color:#277346;background:#dcefdc;color:#185531;font-weight:700}.option-selector{display:flex;align-items:center;gap:4px;margin:0}.option-selector input{width:17px;min-height:0}.option-selector span{font-size:11px}.draft-actions{margin-top:24px}

.option-control{display:inline-flex;align-items:stretch;border:1px solid #cdddcf;border-radius:9px;background:#fff;overflow:hidden}
.option-control .option-selector{padding:0 0 0 12px;margin:0;cursor:pointer;align-self:stretch}
.option-control .option-chip{border:0;border-radius:0;background:transparent;padding-left:8px}
.option-control.is-included{border-color:#277346;background:#dcefdc;color:#185531}
.option-control .option-chip.is-included{background:transparent}
.option-control:focus-within{outline:2px solid #277346;outline-offset:2px}
.routine-tabs button{display:flex;align-items:center;justify-content:space-between;gap:8px}
.routine-tabs button.has-values{font-weight:700}
.routine-field-status{font-size:11px;line-height:1.5;min-width:20px;text-align:center;background:#edf1e9;color:#405448;border-radius:8px;padding:1px 5px}
.routine-field-status:empty{display:none}
.routine-tabs button.is-complete .routine-field-status{background:#dcefdc;color:#185531}
.routine-legend{font-size:11px;line-height:1.5}
/* Agenda: contadores e alinhamento de seleções */
label.check,label:has(>input[type=checkbox]):not(.option-selector):not(.choice-chip){flex-direction:row;align-items:center;justify-content:flex-start;gap:9px}
label.check input[type=checkbox],label input[type=checkbox]{flex:0 0 18px;width:18px;height:18px;min-height:18px;margin:0;align-self:center;accent-color:#2d7949}
.option-control{align-items:center;min-height:42px}
.option-control .option-selector{display:flex;flex-direction:row;align-items:center;justify-content:center;align-self:center;padding:0 0 0 12px;margin:0;min-height:0;line-height:1}
.option-control .option-selector input{display:block;margin:0;position:static}
.option-control .option-chip{display:flex;align-items:center;min-height:42px;margin:0}
.toolbar form{flex-wrap:wrap}.menu-count{display:inline-flex;align-items:center;justify-content:center;min-width:23px;height:23px;padding:0 6px;border-radius:20px;background:#a83830;color:#fff;font-size:12px;font-weight:700;margin-left:6px}
.review-result{width:100%;min-height:180px}.review-controls{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0 18px}

/* Portal compacto: navegação permanente no desktop e mais área útil. */
.portal-shell{--sidebar-width:210px;font-size:14px}
.portal-shell .sidebar{width:var(--sidebar-width);padding:18px 12px 14px;gap:16px;height:100dvh}
.portal-shell .sidebar .brand{font-size:16px;gap:8px}
.portal-shell .sidebar .school-tree{width:38px;height:46px}
.portal-shell .sidebar nav{gap:2px}
.portal-shell .sidebar nav a{padding:8px 11px;font-size:13px;border-radius:7px}
.portal-shell .sidebar-account{padding:12px 6px 0;font-size:12px}
.portal-shell .sidebar-account .logout{margin-top:8px}
.portal-shell main{width:calc(100% - var(--sidebar-width));max-width:none;margin:0 0 0 var(--sidebar-width);padding:0 22px 40px;min-width:0}
.portal-topbar{position:sticky;top:0;z-index:12;display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:66px;margin:0 -22px 16px;padding:12px 22px;background:#f5f7f2f5;border-bottom:1px solid #dce6df;backdrop-filter:blur(8px)}
.portal-page-title{min-width:0;flex:1}.portal-page-title h1{font-size:22px;line-height:1.25;margin:0;overflow-wrap:anywhere}.portal-heading-fallback{font-weight:700;font-size:18px}
.portal-page-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.portal-shell .panel{padding:16px;margin:14px 0;border-radius:10px;box-shadow:0 2px 8px #18331e06}
.portal-shell h2{font-size:17px;margin-bottom:10px}.portal-shell h3{margin-top:14px}
.portal-shell p{margin:7px 0 12px}.portal-shell .muted{font-size:13px}
.portal-shell label{gap:4px;margin-bottom:10px}
.portal-shell input:not([type=checkbox]):not([type=hidden]),.portal-shell select{min-height:36px;padding:6px 9px}
.portal-shell textarea{font:inherit;line-height:1.45;max-width:100%;resize:vertical}
.portal-shell button,.portal-shell .button{padding:7px 11px;font-size:13px;min-height:36px}
.portal-shell th,.portal-shell td{padding:9px 10px}.portal-shell table{font-size:13px}
.portal-shell .toolbar{margin:12px 0;gap:8px}.portal-shell .toolbar form{flex-wrap:wrap;min-width:0}
.portal-shell .stats{gap:10px;margin-top:14px}.portal-shell .stat strong{font-size:26px}
.portal-shell .compose-options{padding:12px;margin:4px 0;border-radius:9px}
.portal-shell .compose-option-panel{padding-top:12px;margin-top:12px}
.portal-shell .option-control,.portal-shell .option-control .option-chip{min-height:36px}
.portal-shell .review-controls{gap:6px;margin:0 0 8px}
.portal-shell .review-controls>button{padding:3px 8px;min-height:28px;font-size:12px}
.portal-shell .routine-workspace{grid-template-columns:170px minmax(0,1fr);margin:10px 0}
.portal-shell .routine-field-list{padding:12px}.portal-shell .routine-students{padding:10px 14px;max-height:clamp(280px,58vh,620px)}
.portal-shell .routine-student{padding:10px 0;gap:12px}.portal-shell .routine-batch{padding-bottom:10px}
.portal-shell .routine-tabs{gap:3px}.portal-shell .routine-tabs button{padding:7px 8px}
.portal-shell .choice-chip{padding:7px 9px}.portal-shell .routine-choices{margin-bottom:10px}
.portal-shell .draft-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.portal-shell .draft-actions p{margin:0}.portal-shell .draft-actions>p:first-child{flex:1;min-width:180px}
.portal-shell #comunicado-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 12px}
.portal-shell #comunicado-form>*{grid-column:1/-1;min-width:0}
.portal-shell #comunicado-form>label:has(>#agenda-tipo),.portal-shell #comunicado-form>label:has(>#agenda-ano),.portal-shell #comunicado-form>label:has(>#agenda-alvo){grid-column:auto}
.portal-shell #comunicado-form>label>input,.portal-shell #comunicado-form>label>select,.portal-shell #comunicado-form>label>textarea{width:100%}
.portal-shell #comunicado-form>label>input[type=checkbox]{width:18px}
.portal-heading-ready .compose-back-fallback{display:none}
.portal-shell :is(input,select,textarea,button,a){scroll-margin-top:90px}
@media(min-width:781px) and (max-height:760px){.portal-shell .sidebar{gap:10px;padding-top:12px}.portal-shell .sidebar nav a{padding:6px 10px}.portal-shell .sidebar .school-tree{height:36px}.portal-shell .sidebar-account{padding-top:8px}}
@media(max-width:1000px) and (min-width:781px){.portal-shell{--sidebar-width:190px}.portal-shell main{padding-right:16px;padding-left:16px}.portal-topbar{margin-left:-16px;margin-right:-16px;padding-left:16px;padding-right:16px}.portal-page-title h1{font-size:20px}}
@media(max-width:780px){
 .portal-shell .sidebar{position:sticky;top:0;inset-inline:0;width:100%;height:auto;padding:10px 14px;gap:8px;max-height:85dvh}
 .portal-shell .sidebar .school-tree{width:30px;height:36px}.portal-shell .sidebar .brand{font-size:14px}
 .portal-shell .sidebar nav a{padding:10px 12px;min-height:42px}
 .portal-shell main{width:100%;margin:0;padding:0 12px 28px}
 .portal-topbar{position:relative;top:auto;margin:0 -12px 12px;padding:10px 12px;min-height:60px;gap:8px;flex-wrap:wrap}
 .portal-page-title h1{font-size:20px}.portal-page-actions{margin-left:auto;flex-wrap:wrap}
 .portal-shell .panel{padding:12px;margin:12px 0}.portal-shell #comunicado-form{grid-template-columns:1fr}
 .portal-shell button,.portal-shell .button{min-height:42px}.portal-shell input:not([type=checkbox]):not([type=hidden]),.portal-shell select{min-height:42px;font-size:16px}.portal-shell textarea{font-size:16px}
 .portal-shell .routine-workspace{grid-template-columns:1fr}.portal-shell .routine-student{grid-template-columns:1fr}
 .portal-shell .routine-field-list{padding:10px}.portal-shell .routine-students{max-height:none;padding:10px}
 .portal-shell .routine-tabs button{min-height:40px}.portal-shell .choice-chip{min-height:42px}
 .portal-shell .review-controls>button{min-height:36px}.portal-shell .draft-actions{align-items:stretch;flex-direction:column}
}
@media print{.portal-shell .sidebar,.portal-topbar .portal-page-actions{display:none!important}.portal-shell main{margin:0;width:100%;padding:0}.portal-topbar{position:static;margin:0;padding:0;background:white}.portal-shell .routine-students{max-height:none;overflow:visible}}
