[hidden]{display:none!important}
:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#e5e7eb;background:#020617;color-scheme:dark}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 15% 0,#172554 0,#020617 45%);min-height:100vh}a{color:#bfdbfe;text-decoration:none}a:hover{text-decoration:underline}.shell{width:min(1180px,92vw);margin:0 auto;padding:40px 0 64px}.landing{display:grid;min-height:100vh;place-items:center}.hero{max-width:780px;text-align:center}.hero h1,.dashboard-head h1,.auth-card h1{font-size:clamp(2.2rem,5vw,4.7rem);line-height:1;margin:.2em 0}.hero p{font-size:1.15rem;color:#cbd5e1}.hero-guide-logo{display:block;width:min(330px,72vw);height:auto;margin:0 auto 18px;object-fit:contain}.eyebrow{text-transform:uppercase;letter-spacing:.15em;font-size:.78rem;font-weight:800;color:#60a5fa}.actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-top:28px}.button{border:0;border-radius:12px;padding:12px 18px;background:#2563eb;color:white;font-weight:700;cursor:pointer;display:inline-block}.button.secondary{background:#1e293b;border:1px solid #334155}.topbar{height:64px;padding:0 max(4vw,24px);display:flex;align-items:center;justify-content:space-between;background:#020617cc;border-bottom:1px solid #1e293b;position:sticky;top:0;backdrop-filter:blur(12px);z-index:5}.topbar nav{display:flex;gap:18px;align-items:center}.link-button{background:none;border:0;color:#bfdbfe;cursor:pointer}.card{background:#0f172acc;border:1px solid #1e293b;border-radius:18px;padding:22px;box-shadow:0 12px 36px #0004}.auth-card{max-width:480px;margin:7vh auto}.form-grid{display:grid;gap:16px}.form-grid label{display:grid;gap:7px;color:#cbd5e1}.form-grid input{width:100%;border:1px solid #334155;background:#020617;color:#f8fafc;padding:12px;border-radius:10px}.message{min-height:24px;color:#fca5a5}.dashboard-head{display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:24px}.dashboard-head h1{font-size:2.4rem}.grid{display:grid;gap:18px;margin-bottom:18px}.cards-3{grid-template-columns:repeat(3,minmax(0,1fr))}.cards-2{grid-template-columns:repeat(2,minmax(0,1fr))}.big-number{font-size:2.5rem;font-weight:800;color:#93c5fd}.stack-list{display:grid;gap:10px}.item{padding:12px;border:1px solid #1e293b;border-radius:12px;background:#02061788}.item strong{display:block;margin-bottom:4px}.muted{color:#94a3b8;font-size:.9rem}.status-ok{color:#86efac}.status-bad{color:#fca5a5}@media(max-width:800px){.cards-3,.cards-2{grid-template-columns:1fr}.dashboard-head{align-items:start;flex-direction:column}.shell{padding-top:24px}}

/* BackOffice completo */
.wide-shell{width:min(1540px,96vw)}
.admin-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 22px;padding:8px;background:#071126;border:1px solid #1e293b;border-radius:14px;position:sticky;top:76px;z-index:4}
.tab{border:0;border-radius:10px;padding:10px 14px;background:transparent;color:#cbd5e1;font-weight:700;cursor:pointer}.tab:hover,.tab.active{background:#1d4ed8;color:#fff}.tab.simulator-tab{border:1px solid #2563eb;background:#0b1f46;color:#dbeafe}.tab.simulator-tab:hover,.tab.simulator-tab.active{background:#1d4ed8;color:#fff}.tab-badge{display:inline-block;margin-left:6px;padding:1px 6px;border-radius:999px;background:#2563eb;color:#fff;font-size:.68rem;line-height:1.4;vertical-align:middle}.tab.simulator-tab.active .tab-badge{background:#fff;color:#1d4ed8}
.tab-panel{animation:fadeIn .15s ease}@keyframes fadeIn{from{opacity:.4}to{opacity:1}}
.admin-grid{grid-template-columns:minmax(0,2fr) minmax(320px,1fr)}
.section-head{display:flex;justify-content:space-between;align-items:center;gap:16px}.compact-input{max-width:320px}
.form-grid input,.form-grid select,.form-grid textarea,.compact-input{width:100%;border:1px solid #334155;background:#020617;color:#f8fafc;padding:11px;border-radius:10px;font:inherit}
.form-grid textarea{resize:vertical}.compact-form{grid-template-columns:repeat(2,minmax(0,1fr));align-items:end}.compact-form button,.compact-form .checkbox-row{align-self:end}.form-inline{grid-template-columns:1.2fr 1fr 2fr auto;align-items:end}
.checkbox-row{display:flex!important;grid-template-columns:auto 1fr!important;align-items:center;gap:8px!important}.checkbox-row input{width:auto}
.table-wrap{overflow:auto}.data-table{width:100%;border-collapse:collapse;min-width:860px}.data-table th,.data-table td{text-align:left;padding:12px 10px;border-bottom:1px solid #1e293b;vertical-align:top}.data-table th{color:#93c5fd;font-size:.82rem;text-transform:uppercase;letter-spacing:.06em}.data-table tr:hover td{background:#0b1328}
.badge{display:inline-block;padding:3px 7px;border-radius:999px;background:#1e293b;border:1px solid #334155;font-size:.78rem;margin:1px}.badge.good{background:#052e16;color:#86efac;border-color:#166534}.badge.danger{background:#450a0a;color:#fca5a5;border-color:#991b1b}
.mini-button{border:1px solid #334155;border-radius:8px;padding:6px 9px;background:#172033;color:#dbeafe;cursor:pointer;font-size:.78rem}.mini-button:hover{background:#1d4ed8}.danger-button:hover{background:#991b1b}.actions-cell{display:flex;gap:6px;flex-wrap:wrap}.block-action{margin-top:8px}.button-row{display:flex;gap:8px;flex-wrap:wrap}.compact-actions{margin-top:8px}.separator{border:0;border-top:1px solid #1e293b;margin:22px 0}.side-form{align-self:start}.scroll-list{max-height:430px;overflow:auto;padding-right:4px}.tall-list{max-height:650px}.small{font-size:.72rem;word-break:break-all}.success-message{color:#86efac}.error-message{color:#fca5a5!important}
@media(max-width:1100px){.admin-grid,.cards-3{grid-template-columns:1fr}.form-inline{grid-template-columns:1fr 1fr}.admin-tabs{position:static}}
@media(max-width:700px){.compact-form,.form-inline{grid-template-columns:1fr}.section-head{align-items:stretch;flex-direction:column}.compact-input{max-width:none}}


/* Administrador 6 - Simulador Curricular */
.simulator-toolbar{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:14px;align-items:end;margin:18px 0}.simulator-toolbar label{display:grid;gap:7px;color:#cbd5e1}.simulator-toolbar select{width:100%;border:1px solid #334155;background:#020617;color:#f8fafc;padding:10px;border-radius:10px}.simulator-toolbar .button-row{grid-column:1/-1}.simulator-layout{display:grid;grid-template-columns:minmax(0,3fr) minmax(300px,1fr);gap:18px}.simulator-main{min-width:0}.simulator-side{align-self:start;position:sticky;top:142px}.simulator-legend{display:flex;gap:10px;align-items:center;flex-wrap:wrap;color:#94a3b8;font-size:.86rem}.legend-dot{display:inline-block;width:11px;height:11px;border-radius:50%;border:2px solid #64748b}.legend-dot.completed{background:#22c55e;border-color:#22c55e}.legend-dot.available{background:#3b82f6;border-color:#3b82f6}.legend-dot.planned{background:#a855f7;border-color:#a855f7}.legend-dot.blocked{background:#ef4444;border-color:#ef4444}.legend-line{display:inline-block;width:28px;height:0;border-top:2px solid #60a5fa}.legend-line.optional{border-top-style:dashed;border-top-color:#64748b}.curriculum-graph-viewport{overflow:auto;min-height:560px;border:1px solid #1e293b;border-radius:14px;background:#02061766}.curriculum-graph{position:relative;min-width:max-content;min-height:540px;padding:18px}.curriculum-columns{display:flex;gap:24px;align-items:flex-start;position:relative;z-index:2}.curriculum-column{width:240px;flex:0 0 240px}.curriculum-column>h3{position:sticky;top:0;margin:0 0 12px;padding:8px 10px;background:#0f172ae8;border:1px solid #1e293b;border-radius:10px;color:#bfdbfe;font-size:.9rem;text-align:center}.curriculum-column-body{display:grid;gap:12px}.curriculum-node{width:100%;text-align:left;border:1px solid #334155;border-left:5px solid #64748b;background:#0f172a;color:#e5e7eb;border-radius:12px;padding:11px;cursor:pointer;box-shadow:0 5px 16px #0003;position:relative}.curriculum-node:hover,.curriculum-node:focus{outline:2px solid #60a5fa;outline-offset:2px}.curriculum-node strong,.curriculum-node span,.curriculum-node small{display:block}.curriculum-node strong{color:#f8fafc}.curriculum-node>span{font-size:.84rem;margin-top:3px}.curriculum-node small{color:#94a3b8;margin-top:6px}.curriculum-node.state-concluida{border-left-color:#22c55e;background:#052e16cc}.curriculum-node.state-disponivel{border-left-color:#3b82f6}.curriculum-node.state-planeada{border-left-color:#a855f7;background:#2e1065aa}.curriculum-node.state-bloqueada,.curriculum-node.state-planeada_bloqueada{border-left-color:#ef4444;background:#450a0aaa}.curriculum-node.state-percurso_selecionado,.curriculum-node.path-highlight{box-shadow:0 0 0 2px #f59e0b,0 8px 24px #0005}.curriculum-node.grupo{border-left-color:#14b8a6}.curriculum-node.percurso{border-left-color:#f59e0b}.node-tags{margin-top:7px}.curriculum-edges{position:absolute;left:0;top:0;z-index:1;pointer-events:none;overflow:visible}.curriculum-edge{fill:none;stroke-width:2;opacity:.7}.edge-mandatory{stroke:#60a5fa;marker-end:url(#arrowMandatory)}.edge-optional{stroke:#64748b;stroke-dasharray:6 5}.edge-transition{stroke:#f59e0b;stroke-dasharray:3 5}.simulator-issue.warning{border-color:#854d0e}.simulator-issue.danger{border-color:#991b1b}.simulator-issue.danger strong{color:#fca5a5}.simulator-issue.warning strong{color:#fde68a}@media(max-width:1100px){.simulator-layout{grid-template-columns:1fr}.simulator-side{position:static}.simulator-toolbar{grid-template-columns:1fr 1fr}}@media(max-width:720px){.simulator-toolbar{grid-template-columns:1fr}.curriculum-column{width:210px;flex-basis:210px}}
.curriculum-empty{min-height:84px;display:flex;align-items:center;justify-content:center;text-align:center;border:1px dashed #334155;border-radius:12px;padding:12px;color:#64748b;background:#0f172a55;font-size:.82rem}

/* Revisao 5.4.2 - leitura pedagógica do percurso */
.curriculum-path-card{border:2px solid #f59e0b;border-radius:13px;background:#0f172a;padding:14px;box-shadow:0 8px 24px #0004;display:grid;gap:7px;color:#e5e7eb}.curriculum-path-card strong{font-size:1rem;color:#fff}.curriculum-path-card span{font-size:.88rem}.curriculum-path-card small{color:#94a3b8;line-height:1.45}.curriculum-section{display:grid;gap:9px;padding:10px;border:1px solid #1e293b;border-radius:12px;background:#08122588}.curriculum-section+.curriculum-section{margin-top:10px}.curriculum-section-title{display:flex;justify-content:space-between;gap:8px;align-items:flex-start;font-size:.84rem}.curriculum-section-title strong{color:#93c5fd}.curriculum-section.required{border-color:#1e3a5f}.curriculum-section.optional{border-color:#5b2b75;background:#160d2480}.curriculum-section.optional .curriculum-section-title strong{color:#d8b4fe}.curriculum-choice-note{color:#c4b5fd;font-size:.75rem;line-height:1.4;padding:6px 8px;border-left:3px solid #a855f7;background:#2e106544;border-radius:5px}.curriculum-empty.compact{min-height:52px;padding:8px}.curriculum-node.route-required{border-left-color:#3b82f6}.curriculum-node.route-optional{border-left-color:#a855f7}.summary-text{font-size:.95rem;line-height:1.35;font-weight:700;color:#dbeafe;margin-top:8px;overflow-wrap:anywhere}.curriculum-semester-column{width:260px;flex-basis:260px}.curriculum-path-column{width:245px;flex-basis:245px}

/* Administrador 6 - Revisao 5.4.3: leitura do percurso completo */
.curriculum-path-card small { display:block; margin-top:.45rem; line-height:1.35; }
.curriculum-section { margin-bottom:1rem; }
.curriculum-section-title { display:flex; justify-content:space-between; gap:.75rem; align-items:center; margin-bottom:.55rem; }
.curriculum-section.required .curriculum-section-title strong { color:#70a7ff; }
.curriculum-section.optional .curriculum-section-title strong { color:#d88cff; }
.curriculum-choice-note { font-size:.78rem; line-height:1.35; opacity:.82; margin:-.1rem 0 .55rem; }
.curriculum-empty.compact { min-height:3.25rem; display:flex; align-items:center; justify-content:center; text-align:center; }

/* Administrador 6 - Revisao 5.4.5: hierarquia visual dos cartoes e selecao de percurso no mapa */
.curriculum-node .node-title{font-size:.94rem;line-height:1.28;color:#f8fafc;font-weight:800}.curriculum-node .node-code,.curriculum-path-card .node-code{font-size:.76rem;color:#94a3b8;margin-top:5px;overflow-wrap:anywhere}.curriculum-node.percurso.map-path-selected{box-shadow:0 0 0 2px #f59e0b,0 8px 24px #0005;border-left-color:#f59e0b}.curriculum-node.percurso.map-path-selected::after{content:'✓';position:absolute;right:9px;top:8px;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:#f59e0b;color:#111827;font-weight:900;font-size:.75rem}

/* Calendário mensal do BackOffice */
.calendar-shell{overflow:hidden}.calendar-section-head{align-items:flex-start}.calendar-nav-actions{display:flex;align-items:center;gap:8px}.calendar-nav-actions .mini-button{font-size:1.35rem;line-height:1;padding:8px 13px}.calendar-toolbar{display:grid;grid-template-columns:minmax(150px,220px) minmax(180px,260px) 1fr;gap:14px;align-items:end;margin:18px 0 12px}.calendar-toolbar label{display:grid;gap:7px;color:#cbd5e1}.calendar-toolbar select{width:100%;border:1px solid #334155;background:#020617;color:#f8fafc;padding:11px;border-radius:10px;font:inherit}.calendar-legend{display:flex;gap:14px;align-items:center;justify-content:flex-end;flex-wrap:wrap;color:#94a3b8;font-size:.86rem;padding-bottom:10px}.calendar-legend span{display:flex;align-items:center;gap:6px}.calendar-dot{width:9px;height:9px;border-radius:999px;display:inline-block}.calendar-dot.period{background:#38bdf8}.calendar-dot.moment{background:#f59e0b}.calendar-dot.draft{background:#64748b}.calendar-month-title{font-size:1.35rem;font-weight:800;margin:12px 0;color:#e2e8f0;text-transform:capitalize}.calendar-weekdays,.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.calendar-weekdays{border:1px solid #1e293b;border-bottom:0;border-radius:12px 12px 0 0;overflow:hidden;background:#071126}.calendar-weekdays span{padding:9px;text-align:center;color:#93c5fd;font-size:.78rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em;border-right:1px solid #1e293b}.calendar-weekdays span:last-child{border-right:0}.calendar-grid{border-left:1px solid #1e293b;border-top:1px solid #1e293b}.calendar-day{min-height:130px;padding:8px;border-right:1px solid #1e293b;border-bottom:1px solid #1e293b;background:#061024;overflow:hidden}.calendar-day.outside{background:#030817;color:#475569}.calendar-day.today{box-shadow:inset 0 0 0 2px #2563eb}.calendar-day-number{font-size:.82rem;font-weight:800;color:#cbd5e1;margin-bottom:6px}.calendar-day.outside .calendar-day-number{color:#475569}.calendar-events{display:grid;gap:4px}.calendar-event-chip{border:0;border-left:3px solid #38bdf8;border-radius:6px;background:#0c2740;color:#dbeafe;text-align:left;padding:5px 6px;cursor:pointer;font-size:.72rem;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.calendar-event-chip.moment{border-left-color:#f59e0b;background:#2d1c08}.calendar-event-chip.draft{opacity:.62;filter:saturate(.55)}.calendar-event-chip:hover{outline:1px solid #60a5fa}.calendar-more{font-size:.7rem;color:#94a3b8;padding:2px 3px}.calendar-bottom-grid{margin-top:18px}.calendar-detail-actions{margin-top:10px}.calendar-status-draft{color:#cbd5e1}.calendar-status-published{color:#86efac}@media(max-width:1000px){.calendar-toolbar{grid-template-columns:1fr 1fr}.calendar-legend{grid-column:1/-1;justify-content:flex-start}.calendar-day{min-height:110px}.calendar-event-chip{font-size:.68rem}}@media(max-width:700px){.calendar-weekdays,.calendar-grid{min-width:760px}.calendar-shell{overflow-x:auto}.calendar-toolbar{grid-template-columns:1fr}.calendar-legend{grid-column:auto}.calendar-day{min-height:105px}.calendar-bottom-grid{grid-template-columns:1fr}}

.calendar-list-event{width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer}.calendar-list-event:hover{border-color:#3b82f6;background:#071a33}

/* Auto-registo de estudantes */
.auth-card h2{margin:0 0 8px;font-size:1.45rem}.auth-switch{margin:16px 0 0;text-align:center;color:#94a3b8}.auth-link{font-weight:700;text-decoration:underline;text-underline-offset:3px}.auth-link:hover{color:#dbeafe}.auth-card .success-message{color:#86efac}


/* Portal do Estudante - escolha inicial de percurso */
.student-onboarding-grid { align-items: start; }
.onboarding-summary { margin-top: 1rem; }
.onboarding-confirm { margin-top: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.student-curriculum { display: grid; gap: .85rem; margin-top: 1rem; max-height: 38rem; overflow: auto; padding-right: .25rem; }
.curriculum-period { border: 1px solid var(--border, #dbe3ec); border-radius: .75rem; overflow: hidden; background: var(--surface, #fff); }
.curriculum-period-head { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem .85rem; background: rgba(15, 23, 42, .04); }
.curriculum-unit { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem .85rem; border-top: 1px solid var(--border, #e5e7eb); }
.curriculum-unit > span:first-child { min-width: 0; }
@media (max-width: 760px) {
  .onboarding-confirm, .curriculum-unit, .curriculum-period-head { align-items: stretch; flex-direction: column; }
  .onboarding-confirm .button { width: 100%; }
}


/* Area do Aluno — Calendario e Documentacao por percurso */
.student-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 22px;padding:8px;background:#071126;border:1px solid #1e293b;border-radius:14px;position:sticky;top:76px;z-index:4}
.student-tab{appearance:none;border:0;border-radius:10px;padding:10px 14px;background:transparent;color:#cbd5e1;font:inherit;font-weight:700;cursor:pointer}
.student-tab:hover,.student-tab.active{background:#1d4ed8;color:#fff}
.student-tab:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}
.student-panel{animation:fadeIn .15s ease}.student-panel[hidden]{display:none!important}
.student-resource-list .item{display:flex;flex-direction:column;gap:.35rem;padding:12px;border:1px solid #1e293b;border-radius:12px;background:#02061788}
.resource-meta{font-size:.92rem;font-weight:700;color:#cbd5e1}
.student-calendar-shell{margin-bottom:18px}
.student-calendar-shell .calendar-event-chip{width:100%}
.student-calendar-shell .calendar-event-chip:focus-visible{outline:2px solid #60a5fa;outline-offset:1px}
@media(max-width:1100px){.student-tabs{position:static}}
@media(max-width:640px){.student-tabs{display:grid;grid-template-columns:1fr}.student-tab{text-align:left}}

/* PATCH Calendario 2026-08-09: linha temporal com scroll (Administrador + Aluno) */
.calendar-timeline-toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;margin:16px 0 12px}.calendar-timeline-toolbar .calendar-legend{padding-bottom:0}.calendar-timeline-viewport{height:min(72vh,820px);min-height:560px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;border:1px solid #1e293b;border-radius:14px;background:#030817;padding:0 14px 18px;scroll-behavior:auto}.calendar-timeline-viewport:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}.calendar-timeline-month{padding-top:14px;margin-bottom:30px;scroll-margin-top:10px}.calendar-timeline-month:last-child{margin-bottom:0}.calendar-timeline-month .calendar-month-title{position:sticky;top:0;z-index:4;margin:0 -2px 10px;padding:12px 4px 10px;background:linear-gradient(180deg,#030817 78%,rgba(3,8,23,.82));border-bottom:1px solid #172033}.calendar-timeline-month .calendar-weekdays{position:sticky;top:52px;z-index:3}.calendar-timeline-month .calendar-grid{border-radius:0 0 10px 10px;overflow:hidden}.calendar-timeline-month .calendar-day{min-height:118px}.calendar-timeline-month .calendar-day.today .calendar-day-number:after{content:'Hoje';display:inline-block;margin-left:6px;padding:1px 5px;border-radius:999px;background:#2563eb;color:#eff6ff;font-size:.62rem;font-weight:800;vertical-align:1px}.calendar-bottom-grid .card>h2{margin-top:0}
@media(max-width:700px){.calendar-timeline-viewport{height:70vh;min-height:500px;padding:0 8px 14px}.calendar-timeline-month{min-width:760px}.calendar-shell{overflow:hidden}.calendar-timeline-toolbar{align-items:flex-start}.calendar-timeline-month .calendar-weekdays{top:50px}}

/* Patch 2026-08-09: consulta completa dos eventos de um dia */
.calendar-more-button{display:block;width:100%;border:1px dashed #334155;background:#071126;color:#93c5fd;border-radius:7px;padding:5px 7px;text-align:left;cursor:pointer;font:inherit;font-size:.7rem}.calendar-more-button:hover,.calendar-more-button:focus-visible{border-color:#60a5fa;background:#0b1b35;color:#dbeafe;outline:none}.calendar-dialog-open{overflow:hidden}.calendar-day-dialog[hidden]{display:none}.calendar-day-dialog{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:24px}.calendar-day-dialog-backdrop{position:absolute;inset:0;background:rgba(2,6,23,.78);backdrop-filter:blur(3px)}.calendar-day-dialog-panel{position:relative;z-index:1;width:min(860px,calc(100vw - 32px));max-height:min(84vh,900px);display:flex;flex-direction:column;gap:14px;border:1px solid #334155;border-radius:18px;background:#0b1326;box-shadow:0 24px 80px rgba(0,0,0,.5);padding:20px}.calendar-day-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.calendar-day-dialog-head h2{margin:4px 0 4px;text-transform:capitalize}.calendar-day-dialog-close{font-size:1.45rem;line-height:1;min-width:42px}.calendar-day-search{display:grid;gap:7px;color:#cbd5e1}.calendar-day-search input{width:100%;border:1px solid #334155;background:#020617;color:#f8fafc;padding:11px 12px;border-radius:10px;font:inherit}.calendar-day-search input:focus{outline:2px solid #2563eb;outline-offset:1px}.calendar-day-event-list{display:grid;gap:10px;overflow:auto;min-height:100px;padding-right:4px}.calendar-day-event-card{display:grid;gap:8px;border:1px solid #24324a;border-left:4px solid #38bdf8;border-radius:12px;background:#071126;padding:13px 14px}.calendar-day-event-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.calendar-day-event-card-head>div{display:grid;gap:3px}.calendar-day-event-card p{margin:0;color:#cbd5e1;line-height:1.45}.calendar-day-event-time{color:#93c5fd;font-size:.86rem;font-weight:700}.calendar-day-event-card .button-row{margin-top:2px}.calendar-day-event-card .block-action{justify-self:start;margin-top:2px}@media(max-width:700px){.calendar-day-dialog{padding:10px}.calendar-day-dialog-panel{width:100%;max-height:92vh;padding:15px;border-radius:14px}.calendar-day-event-card-head{display:grid}.calendar-day-dialog-head{gap:10px}}

/* Patch 2026-08-09: login - memorizar dados de acesso */
.login-remember-row{margin-top:-2px;color:#cbd5e1;font-size:.95rem;cursor:pointer;justify-self:start}.login-remember-row input[type="checkbox"]{width:18px!important;height:18px;min-width:18px;margin:0;padding:0;accent-color:#2563eb;cursor:pointer}.login-remember-row span{line-height:1.25}.login-remember-row:focus-within{outline:2px solid #60a5fa;outline-offset:4px;border-radius:6px}

/* Definições base do aluno */
.settings-base-grid{grid-template-columns:repeat(4,minmax(0,1fr));align-items:end}
.settings-actions{grid-column:1/-1;margin-top:4px}
.settings-base-grid select:disabled{opacity:.82;cursor:not-allowed}
@media(max-width:1100px){.settings-base-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.settings-base-grid{grid-template-columns:1fr}}

/* Calendario do aluno: prioridade visual Avaliacao > Aluno > Geral. */
.student-calendar-shell .calendar-event-chip.evaluation{border-left-color:#ef4444;background:#351018;color:#fee2e2}
.student-calendar-shell .calendar-event-chip.student{border-left-color:#f97316;background:#32170b;color:#ffedd5}
.student-calendar-shell .calendar-event-chip.general{border-left-color:#38bdf8;background:#0c2740;color:#dbeafe}
.calendar-day-event-card.evaluation{border-left-color:#ef4444;background:#1c0b13}
.calendar-day-event-card.student{border-left-color:#f97316;background:#1f1109}
.calendar-day-event-card.general{border-left-color:#38bdf8}
.calendar-list-event.evaluation{border-left:4px solid #ef4444}
.calendar-list-event.student{border-left:4px solid #f97316}
.calendar-list-event.general{border-left:4px solid #38bdf8}

/* PATCH 2026-08-10 - tema visual centralizado do Portal do Estudante.
   Todas as areas (primeiro acesso, dashboard, calendario, documentacao e Gestao Curricular)
   reutilizam estes tokens e os componentes globais. Nenhuma area deve definir uma paleta propria. */
:root{
  --atlas-bg:#020617;
  --atlas-bg-accent:#172554;
  --atlas-surface:#0f172acc;
  --atlas-surface-solid:#0f172a;
  --atlas-surface-soft:#02061788;
  --atlas-surface-strong:#071126;
  --atlas-border:#1e293b;
  --atlas-border-strong:#334155;
  --atlas-text:#e5e7eb;
  --atlas-text-strong:#f8fafc;
  --atlas-muted:#94a3b8;
  --atlas-label:#cbd5e1;
  --atlas-link:#bfdbfe;
  --atlas-accent:#2563eb;
  --atlas-accent-hover:#1d4ed8;
  --atlas-accent-soft:#93c5fd;
  --atlas-focus:#60a5fa;
  --atlas-success:#86efac;
  --atlas-danger:#fca5a5;
  --atlas-radius:18px;
  --atlas-control-radius:10px;
  --atlas-shadow:0 12px 36px #0004;
  /* aliases mantidos para componentes curriculares antigos */
  --surface:var(--atlas-surface-solid);
  --border:var(--atlas-border);
}
body{background:radial-gradient(circle at 15% 0,var(--atlas-bg-accent) 0,var(--atlas-bg) 45%);color:var(--atlas-text)}
a,.link-button{color:var(--atlas-link)}
.card{background:var(--atlas-surface);border-color:var(--atlas-border);border-radius:var(--atlas-radius);box-shadow:var(--atlas-shadow)}
.topbar{background:color-mix(in srgb,var(--atlas-bg) 80%,transparent);border-color:var(--atlas-border)}
.button{background:var(--atlas-accent);color:#fff}.button:hover{background:var(--atlas-accent-hover)}
.button.secondary{background:#1e293b;border-color:var(--atlas-border-strong)}
.form-grid label,.simulator-toolbar label,.calendar-toolbar label{color:var(--atlas-label)}
.form-grid input,.form-grid select,.form-grid textarea,.compact-input,.simulator-toolbar select,.calendar-toolbar select,.calendar-day-search input{
  border-color:var(--atlas-border-strong);background:var(--atlas-bg);color:var(--atlas-text-strong);border-radius:var(--atlas-control-radius)
}
.form-grid input:focus,.form-grid select:focus,.form-grid textarea:focus,.compact-input:focus,.simulator-toolbar select:focus,.calendar-toolbar select:focus{
  outline:2px solid var(--atlas-focus);outline-offset:1px
}
.muted{color:var(--atlas-muted)}
.item{border-color:var(--atlas-border);background:var(--atlas-surface-soft)}
.data-table th{color:var(--atlas-accent-soft)}.data-table th,.data-table td{border-color:var(--atlas-border)}.data-table tr:hover td{background:var(--atlas-surface-strong)}
.student-tabs,.admin-tabs{background:var(--atlas-surface-strong);border-color:var(--atlas-border)}
.student-tab,.tab{color:var(--atlas-label)}.student-tab:hover,.student-tab.active,.tab:hover,.tab.active{background:var(--atlas-accent-hover);color:#fff}
.student-tab:focus-visible,.tab:focus-visible{outline:2px solid var(--atlas-focus);outline-offset:2px}

/* Primeiro acesso: usa exatamente os mesmos cartoes, controlos e superficies do restante Portal. */
#courseSelection .student-onboarding-grid>.card{background:var(--atlas-surface);border-color:var(--atlas-border)}
#courseSelection .student-curriculum{scrollbar-color:var(--atlas-border-strong) var(--atlas-bg)}
#courseSelection .curriculum-period{border:1px solid var(--atlas-border);background:var(--atlas-surface-soft);color:var(--atlas-text);border-radius:12px}
#courseSelection .curriculum-period-head{background:var(--atlas-surface-strong);color:var(--atlas-text);border-bottom:0}
#courseSelection .curriculum-period-head strong{color:var(--atlas-text-strong)}
#courseSelection .curriculum-unit{border-top:1px solid var(--atlas-border);background:transparent;color:var(--atlas-text)}
#courseSelection .curriculum-unit strong,#courseSelection .curriculum-unit>span:first-child{color:var(--atlas-text-strong)}
#courseSelection .curriculum-unit .muted,#courseSelection .curriculum-period .muted{color:var(--atlas-muted)}
#courseSelection .onboarding-summary .item,#studentSimulationSummary .item{background:var(--atlas-surface-soft);border-color:var(--atlas-border)}
#courseSelection .checkbox-row{color:var(--atlas-label)}
#courseSelection .checkbox-row input[type="checkbox"]{accent-color:var(--atlas-accent)}

/* Gestao Curricular: apenas layout local. As cores e componentes sao todos herdados do tema global. */
.curriculum-page-head{margin-bottom:1.25rem}.curriculum-management-card{overflow:visible}.curriculum-management-head{align-items:center;gap:1rem}.curriculum-table-wrap{margin-top:1rem;overflow-x:auto}.curriculum-table{min-width:1120px}.curriculum-table th{white-space:nowrap;font-size:.78rem;letter-spacing:.045em;text-transform:uppercase}.curriculum-table td{vertical-align:middle}.curriculum-row-actions{display:flex;gap:.4rem;white-space:nowrap}
.curriculum-icon-button{width:2.1rem;height:2.1rem;border:1px solid var(--atlas-border-strong);border-radius:.55rem;background:var(--atlas-surface-strong);color:var(--atlas-link);cursor:pointer;font-weight:800}.curriculum-icon-button:hover{background:var(--atlas-accent-hover);color:#fff}.curriculum-icon-button.danger{color:var(--atlas-danger)}
.curriculum-enrollment-form{grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin-top:1.25rem;padding:1.1rem;border:1px solid var(--atlas-border);border-radius:12px;background:var(--atlas-surface-soft)}.curriculum-enrollment-form>label{min-width:0}.curriculum-form-actions{grid-column:1/-1;margin-top:.2rem}
.curriculum-rule-note{display:flex;gap:.7rem;align-items:flex-start;margin-top:1rem;padding:.85rem 1rem;border:1px solid var(--atlas-border);border-radius:12px;color:var(--atlas-link);background:var(--atlas-surface-soft);font-size:.92rem}
.curriculum-dialog{width:min(900px,calc(100vw - 2rem));max-height:calc(100vh - 2rem);border:1px solid var(--atlas-border-strong);border-radius:var(--atlas-radius);padding:0;color:var(--atlas-text);background:var(--atlas-surface-solid);box-shadow:0 24px 80px rgba(0,0,0,.55)}.curriculum-dialog::backdrop{background:rgba(2,6,23,.78);backdrop-filter:blur(3px)}.curriculum-dialog-shell{padding:1.25rem;margin:0}.curriculum-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}.curriculum-dialog-head h2{margin:.15rem 0 .35rem}.dialog-close{width:2.3rem;height:2.3rem;border-radius:var(--atlas-control-radius);border:1px solid var(--atlas-border-strong);background:#1e293b;color:var(--atlas-text);font-size:1.25rem;cursor:pointer}.dialog-close:hover{background:var(--atlas-accent-hover)}
.curriculum-search{display:block;max-width:420px;margin:.75rem 0}.curriculum-search input{width:100%;margin-top:.4rem}.curriculum-uc-summary{display:flex;justify-content:space-between;gap:1rem;align-items:center;padding:.65rem 0 .9rem;border-bottom:1px solid var(--atlas-border)}.curriculum-unit-list{max-height:52vh;overflow:auto;margin-top:.3rem}.curriculum-unit-row{display:grid;grid-template-columns:auto 90px minmax(220px,1fr) minmax(180px,auto);gap:.8rem;align-items:center;padding:.75rem .5rem;border-bottom:1px solid var(--atlas-border);cursor:pointer}.curriculum-unit-row:hover{background:var(--atlas-surface-strong)}.curriculum-unit-code{font-weight:800;color:var(--atlas-accent-soft)}.curriculum-unit-name{font-weight:650}.curriculum-unit-meta{color:var(--atlas-muted);font-size:.87rem;text-align:right}.curriculum-dialog-actions{justify-content:flex-end;margin-top:1rem}.curriculum-confirm-dialog{width:min(500px,calc(100vw - 2rem))}.danger-action{background:#991b1b!important;border-color:#b91c1c!important}.danger-action:hover{background:#7f1d1d!important}
@media(max-width:1050px){.curriculum-enrollment-form{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:680px){.curriculum-enrollment-form{grid-template-columns:1fr}.curriculum-unit-row{grid-template-columns:auto 72px 1fr}.curriculum-unit-meta{grid-column:2/-1;text-align:left}.curriculum-uc-summary{align-items:flex-start;flex-direction:column}}


/* Navegação lateral recolhível — Portal e Administrador */
#studentArea{display:grid;grid-template-columns:248px minmax(0,1fr);gap:22px;align-items:start;transition:grid-template-columns .2s ease}
#studentArea.nav-collapsed{grid-template-columns:72px minmax(0,1fr)}
#studentArea>.student-tabs{grid-column:1;grid-row:1;align-self:start}
#studentArea>.student-panel{grid-column:2;grid-row:1;min-width:0}
#dashboard{display:grid;grid-template-columns:268px minmax(0,1fr);gap:22px;align-items:start;transition:grid-template-columns .2s ease}
#dashboard.nav-collapsed{grid-template-columns:72px minmax(0,1fr)}
#dashboard>.dashboard-head{grid-column:1/-1;grid-row:1}
#dashboard>.admin-tabs{grid-column:1;grid-row:2;align-self:start}
#dashboard>.tab-panel{grid-column:2;grid-row:2;min-width:0}
.student-tabs.side-navigation,.admin-tabs.side-navigation{display:flex;flex-direction:column;flex-wrap:nowrap;gap:6px;margin:0;padding:10px;position:sticky;top:76px;z-index:4;width:100%;border-radius:16px;background:var(--atlas-surface-strong);border:1px solid var(--atlas-border);box-shadow:0 12px 30px rgba(2,6,23,.18);overflow:hidden}
.side-navigation .student-tab,.side-navigation .tab{width:100%;min-height:44px;display:flex;align-items:center;gap:11px;padding:10px 12px;text-align:left;border-radius:10px;white-space:nowrap;overflow:hidden;transition:background .15s ease,color .15s ease,transform .15s ease}
.side-navigation .student-tab:hover,.side-navigation .tab:hover{transform:translateX(2px)}
.side-navigation .student-tab.active,.side-navigation .tab.active{box-shadow:inset 3px 0 0 var(--atlas-focus)}
.side-navigation .tab.simulator-tab{border:0;background:transparent;color:var(--atlas-label)}
.side-navigation .tab.simulator-tab:hover,.side-navigation .tab.simulator-tab.active{background:var(--atlas-accent-hover);color:#fff}
.side-nav-icon{width:26px;min-width:26px;height:26px;border-radius:8px;display:grid;place-items:center;font-size:1.05rem;line-height:1;background:color-mix(in srgb,var(--atlas-accent-hover) 22%,transparent);color:var(--atlas-focus)}
.side-navigation .active .side-nav-icon{background:rgba(255,255,255,.14);color:#fff}
.side-nav-label{overflow:hidden;text-overflow:ellipsis}
.side-nav-toggle{appearance:none;border:1px solid var(--atlas-border);background:color-mix(in srgb,var(--atlas-surface-solid) 88%,transparent);color:var(--atlas-label);height:38px;border-radius:10px;margin-bottom:4px;padding:0 10px;display:flex;align-items:center;justify-content:flex-end;gap:8px;cursor:pointer;font:inherit;font-size:.78rem;font-weight:800;letter-spacing:.02em;white-space:nowrap;overflow:hidden}
.side-nav-toggle:hover{border-color:var(--atlas-border-strong);color:var(--atlas-text)}
.side-nav-toggle-icon{display:grid;place-items:center;width:22px;height:22px;border-radius:7px;background:color-mix(in srgb,var(--atlas-accent-hover) 22%,transparent);font-size:1.25rem;line-height:1;transition:transform .2s ease}
.nav-collapsed .side-navigation .side-nav-label,.nav-collapsed .side-navigation .side-nav-toggle-label{display:none}
.nav-collapsed .side-navigation .student-tab,.nav-collapsed .side-navigation .tab{justify-content:center;padding-left:8px;padding-right:8px}
.nav-collapsed .side-navigation .side-nav-toggle{justify-content:center;padding:0}
.nav-collapsed .side-navigation .side-nav-toggle-icon{transform:rotate(180deg)}
.nav-collapsed .side-navigation .student-tab:hover,.nav-collapsed .side-navigation .tab:hover{transform:none}
@media(max-width:900px){#studentArea,#studentArea.nav-collapsed,#dashboard,#dashboard.nav-collapsed{grid-template-columns:1fr;gap:16px}#studentArea>.student-tabs,#studentArea>.student-panel,#dashboard>.dashboard-head,#dashboard>.admin-tabs,#dashboard>.tab-panel{grid-column:1;grid-row:auto}.student-tabs.side-navigation,.admin-tabs.side-navigation{position:static;display:flex;flex-direction:row;overflow-x:auto;scrollbar-width:thin;padding:8px}.side-navigation .student-tab,.side-navigation .tab{width:auto;min-width:max-content}.side-nav-toggle{display:none}.nav-collapsed .side-navigation .side-nav-label{display:inline}.nav-collapsed .side-navigation .student-tab,.nav-collapsed .side-navigation .tab{justify-content:flex-start;padding:10px 12px}}

/* Ajustes de grelha da navegação lateral */
#studentArea[hidden],#dashboard[hidden]{display:none!important}
#dashboard>.admin-tabs{grid-row:2 / span 2}
#dashboard>#adminMessage{grid-column:2;grid-row:2;margin:0;align-self:start}
#dashboard>.tab-panel{grid-column:2;grid-row:3;min-width:0}
@media(max-width:900px){#dashboard>.admin-tabs,#dashboard>#adminMessage,#dashboard>.tab-panel{grid-column:1;grid-row:auto}}

/* Navegação lateral full-height e logótipo ajustado — 2026-08-10 */
.topbar-brand{display:flex;align-items:center;height:100%;max-width:min(220px,46vw);min-width:0;overflow:hidden;text-decoration:none!important;flex:0 1 auto}
.topbar-brand img{display:block;width:auto;height:48px;max-width:100%;max-height:calc(100% - 12px);object-fit:contain;object-position:left center;flex:0 1 auto}

@media(min-width:901px){
  #studentArea,#dashboard{width:100vw;max-width:none;margin-left:calc(50% - 50vw);margin-top:-40px;min-height:calc(100vh - 64px);gap:0;align-items:stretch}
  #studentArea{grid-template-columns:248px minmax(0,1fr)}
  #studentArea.nav-collapsed{grid-template-columns:72px minmax(0,1fr)}
  #dashboard{grid-template-columns:268px minmax(0,1fr)}
  #dashboard.nav-collapsed{grid-template-columns:72px minmax(0,1fr)}

  #studentArea>.student-tabs,#dashboard>.admin-tabs{align-self:start;position:sticky;top:64px;height:calc(100vh - 64px);min-height:calc(100vh - 64px);border-radius:0;border-top:0;border-bottom:0;border-left:0;border-right:1px solid var(--atlas-border);box-shadow:8px 0 28px rgba(2,6,23,.16);padding:18px 10px;background:var(--atlas-surface-strong);overflow-y:auto;overflow-x:hidden}
  #studentArea>.student-tabs{grid-column:1;grid-row:1}
  #studentArea>.student-panel{grid-column:2;grid-row:1;padding:36px max(4vw,24px) 64px 28px;min-width:0}

  #dashboard>.admin-tabs{grid-column:1;grid-row:1 / span 3}
  #dashboard>.dashboard-head{grid-column:2;grid-row:1;padding:36px max(4vw,24px) 0 28px;margin-bottom:24px}
  #dashboard>#adminMessage{grid-column:2;grid-row:2;margin:0;padding:0 max(4vw,24px) 0 28px;align-self:start}
  #dashboard>.tab-panel{grid-column:2;grid-row:3;padding:0 max(4vw,24px) 64px 28px;min-width:0}

  .student-tabs.side-navigation,.admin-tabs.side-navigation{width:100%}
}

@media(max-width:900px){
  .topbar-brand{max-width:min(180px,52vw)}
  .topbar-brand img{height:42px;max-height:calc(100% - 14px)}
}


/* Toggle da navegação lateral na barra superior — 2026-08-10 */
.side-navigation>.side-nav-toggle{display:none!important}
.topbar-sidebar-toggle{appearance:none;flex:0 0 40px;width:40px;height:40px;margin-left:10px;border:1px solid var(--atlas-border);border-radius:10px;background:color-mix(in srgb,var(--atlas-surface-solid) 86%,transparent);color:var(--atlas-label);display:grid;place-items:center;cursor:pointer;padding:0;transition:background .15s ease,border-color .15s ease,color .15s ease}
.topbar-sidebar-toggle:hover{background:var(--atlas-accent-hover);border-color:var(--atlas-accent-hover);color:#fff}
.sidebar-toggle-glyph{display:flex;align-items:center;gap:3px;width:25px;height:22px}
.sidebar-toggle-frame{position:relative;display:block;width:17px;height:16px;border:1.7px solid currentColor;border-radius:3px}
.sidebar-toggle-rail{position:absolute;left:3px;top:2px;bottom:2px;width:3px;border-right:1.7px solid currentColor}
.sidebar-toggle-arrow{font-size:18px;line-height:1;font-weight:800;transform:translateY(-1px);transition:transform .2s ease}
body:has(#studentArea.nav-collapsed) #studentNavToggle .sidebar-toggle-arrow,body:has(#dashboard.nav-collapsed) #adminNavToggle .sidebar-toggle-arrow{transform:rotate(180deg) translateY(1px)}
@media(max-width:900px){.topbar-sidebar-toggle{display:none}}

/* 2026-08-10 - toggle da sidebar no extremo esquerdo da barra superior */
.app-topbar{justify-content:flex-start;padding-left:10px}
.app-topbar .topbar-sidebar-toggle{order:0;margin:0 10px 0 0}
.app-topbar .topbar-brand{order:1}
.app-topbar nav{order:2;margin-left:auto}
@media(max-width:900px){.app-topbar{padding-left:10px}.app-topbar .topbar-sidebar-toggle{display:none}}

/* 2026-08-10 - sidebar fixa: o scroll da pagina afecta apenas o conteudo */
@media(min-width:901px){
  #studentArea>.student-tabs,#dashboard>.admin-tabs{
    position:fixed;
    left:0;
    top:64px;
    bottom:0;
    height:auto;
    min-height:0;
    z-index:4;
  }
  #studentArea>.student-tabs{width:248px}
  #studentArea.nav-collapsed>.student-tabs{width:72px}
  #dashboard>.admin-tabs{width:248px}
  #dashboard.nav-collapsed>.admin-tabs{width:72px}
}


/* 2026-08-13 - sidebar inicia abaixo da barra superior.
   A barra lateral deixa de ficar por tras da topbar, evitando ocultar a primeira opcao. */
@media(min-width:901px){
  #studentArea>.student-tabs,#dashboard>.admin-tabs{
    top:64px;
    bottom:0;
    height:calc(100dvh - 64px);
    min-height:0;
    padding-top:18px;
    padding-bottom:18px;
    overflow-y:auto;
    overflow-x:hidden;
    z-index:4;
  }
  .app-topbar{z-index:6}
}

/* 2026-08-10 - Definicoes do aluno: notificacoes e tema */
.settings-groups{display:grid;gap:18px}.settings-card{overflow:hidden}.notification-settings-list{display:grid;gap:0;border:1px solid #1e293b;border-radius:14px;overflow:hidden}.notification-setting-row{display:grid;grid-template-columns:minmax(260px,1fr) auto minmax(260px,auto);gap:18px;align-items:center;padding:18px;background:#02061766}.notification-setting-row+.notification-setting-row{border-top:1px solid #1e293b}.notification-setting-copy{display:grid;gap:4px}.switch-control{display:inline-flex;align-items:center;gap:9px;cursor:pointer}.switch-control input{position:absolute;opacity:0;pointer-events:none}.switch-slider{width:44px;height:24px;border-radius:999px;background:#334155;position:relative;transition:.2s}.switch-slider:after{content:"";position:absolute;width:18px;height:18px;left:3px;top:3px;border-radius:50%;background:#fff;transition:.2s}.switch-control input:checked+.switch-slider{background:#14b8a6}.switch-control input:checked+.switch-slider:after{transform:translateX(20px)}.switch-control input:focus-visible+.switch-slider{outline:2px solid #60a5fa;outline-offset:3px}.switch-label{font-size:.9rem;color:#cbd5e1}.days-control{display:flex;align-items:center;gap:8px;white-space:nowrap;color:#cbd5e1;font-size:.9rem}.days-control select{border:1px solid #334155;background:#020617;color:#f8fafc;border-radius:9px;padding:8px 28px 8px 10px}.days-control.is-disabled{opacity:.45}.theme-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.theme-option{position:relative;display:grid;gap:7px;padding:14px;border:1px solid #334155;border-radius:14px;background:#02061788;cursor:pointer}.theme-option input{position:absolute;opacity:0}.theme-option:has(input:checked){border-color:#14b8a6;box-shadow:0 0 0 2px #14b8a633}.theme-option strong{font-size:1rem}.theme-option small{color:#94a3b8;line-height:1.4}.theme-preview{height:72px;border-radius:10px;border:1px solid #334155;display:grid;grid-template-columns:28% 1fr;overflow:hidden}.theme-preview span:first-child{background:#0f172a}.theme-preview span:last-child{background:#f8fafc}.theme-preview-dark span:first-child{background:#020617}.theme-preview-dark span:last-child{background:#111827}.theme-preview-system{background:linear-gradient(110deg,#f8fafc 0 49%,#111827 51% 100%)}.theme-preview-system span{background:transparent!important}.settings-save-message{min-height:20px;margin:4px 2px 0}.settings-save-message.is-saved{color:#5eead4}

/* Tema claro. O tema escuro continua a ser o tema base do projeto. */
html[data-theme="light"]{color-scheme:light}html[data-theme="light"] body{background:radial-gradient(circle at 15% 0,#dbeafe 0,#f8fafc 45%);color:#0f172a}html[data-theme="light"] a{color:#1d4ed8}html[data-theme="light"] .topbar{background:#ffffffeb;border-color:#cbd5e1}html[data-theme="light"] .topbar a,html[data-theme="light"] .link-button{color:#334155}html[data-theme="light"] .card{background:#ffffffeb;border-color:#dbe2ea;box-shadow:0 12px 36px #0f172a12}html[data-theme="light"] .item,html[data-theme="light"] .notification-setting-row,html[data-theme="light"] .theme-option{background:#f8fafc;border-color:#dbe2ea}html[data-theme="light"] .notification-settings-list,html[data-theme="light"] .notification-setting-row+.notification-setting-row{border-color:#dbe2ea}html[data-theme="light"] .muted,html[data-theme="light"] .switch-label,html[data-theme="light"] .days-control{color:#64748b}html[data-theme="light"] .form-grid label{color:#475569}html[data-theme="light"] .form-grid input,html[data-theme="light"] .form-grid select,html[data-theme="light"] .days-control select{background:#fff;color:#0f172a;border-color:#cbd5e1}html[data-theme="light"] .student-tabs{background:#f1f5f9;border-color:#cbd5e1}html[data-theme="light"] .student-tab{color:#334155}html[data-theme="light"] .student-tab.active{background:#dbeafe;color:#1d4ed8}html[data-theme="light"] .button.secondary{background:#e2e8f0;border-color:#cbd5e1;color:#0f172a}html[data-theme="light"] .theme-option small{color:#64748b}

@media(max-width:980px){.notification-setting-row{grid-template-columns:1fr auto}.days-control{grid-column:1/-1;justify-content:flex-start}.theme-options{grid-template-columns:1fr}}

/* PATCH 2026-08-10 - acabamento do tema claro e largura responsiva.
   O tema escuro permanece inalterado. */

/* A aplicacao nunca deve criar scroll horizontal ao nivel do browser. */
html,body{max-width:100%;overflow-x:clip}
main.shell{max-width:100%;min-width:0}
#studentArea,#dashboard,#studentArea>.student-panel,#dashboard>.tab-panel,#dashboard>.dashboard-head,#dashboard>#adminMessage{min-width:0;max-width:100%}
.card,.grid,.section-head,.calendar-shell,.student-calendar-shell,.calendar-bottom-grid{min-width:0;max-width:100%}
img,svg,video,canvas{max-width:100%}

@media(min-width:901px){
  /* Quando a area aplicacional esta visivel, a shell passa a usar a largura real do browser.
     A sidebar fixa continua encostada a esquerda e o conteudo ocupa apenas o espaco restante. */
  body:has(#studentArea:not([hidden])) main.shell,
  body:has(#dashboard:not([hidden])) main.shell{width:100%;max-width:100%;margin:0;padding-left:0;padding-right:0}
  #studentArea,#dashboard{width:100%;max-width:100%;margin-left:0;margin-right:0}
  #studentArea>.student-panel{max-width:calc(100vw - 248px)}
  #studentArea.nav-collapsed>.student-panel{max-width:calc(100vw - 72px)}
  #dashboard>.dashboard-head,#dashboard>#adminMessage,#dashboard>.tab-panel{max-width:calc(100vw - 268px)}
  #dashboard.nav-collapsed>.dashboard-head,#dashboard.nav-collapsed>#adminMessage,#dashboard.nav-collapsed>.tab-panel{max-width:calc(100vw - 72px)}
}

/* Tema claro: tokens claros aplicados apenas quando explicitamente ativo. */
html[data-theme="light"]{
  --atlas-bg:#f8fafc;
  --atlas-bg-accent:#dbeafe;
  --atlas-surface:#fffffff2;
  --atlas-surface-solid:#ffffff;
  --atlas-surface-soft:#f8fafc;
  --atlas-surface-strong:#eef4fb;
  --atlas-border:#d6dee8;
  --atlas-border-strong:#c3cedb;
  --atlas-text:#1e293b;
  --atlas-text-strong:#0f172a;
  --atlas-muted:#64748b;
  --atlas-label:#334155;
  --atlas-link:#1d4ed8;
  --atlas-accent-soft:#2563eb;
  --atlas-shadow:0 12px 30px rgba(15,23,42,.10);
}

/* Sidebar clara: mais luminosa, mantendo contraste e estado ativo. */
html[data-theme="light"] .student-tabs.side-navigation,
html[data-theme="light"] .admin-tabs.side-navigation{background:#edf4fb;border-color:#cbd7e5;box-shadow:8px 0 24px rgba(30,64,175,.08)}
html[data-theme="light"] .side-navigation .student-tab,
html[data-theme="light"] .side-navigation .tab{color:#334155}
html[data-theme="light"] .side-nav-icon{background:#dbeafe;color:#2563eb}
html[data-theme="light"] .side-navigation .student-tab:hover,
html[data-theme="light"] .side-navigation .tab:hover{background:#e0ecfb;color:#1e3a8a}
html[data-theme="light"] .side-navigation .student-tab.active,
html[data-theme="light"] .side-navigation .tab.active,
html[data-theme="light"] .side-navigation .tab.simulator-tab.active{background:#dbeafe;color:#1d4ed8;box-shadow:inset 3px 0 0 #2563eb}
html[data-theme="light"] .side-navigation .active .side-nav-icon{background:#bfdbfe;color:#1d4ed8}

/* Calendario - superficies, grelha, cabecalhos e controlos no tema claro. */
html[data-theme="light"] .calendar-timeline-viewport{background:#f8fafc;border-color:#d6dee8;scrollbar-color:#cbd5e1 #f8fafc}
html[data-theme="light"] .calendar-timeline-month .calendar-month-title{color:#0f172a;background:linear-gradient(180deg,#f8fafc 78%,rgba(248,250,252,.88));border-color:#dbe2ea}
html[data-theme="light"] .calendar-month-title{color:#0f172a}
html[data-theme="light"] .calendar-weekdays{background:#eef4fb;border-color:#d6dee8}
html[data-theme="light"] .calendar-weekdays span{color:#1d4ed8;border-color:#d6dee8}
html[data-theme="light"] .calendar-grid{border-color:#d6dee8}
html[data-theme="light"] .calendar-day{background:#ffffff;border-color:#d6dee8;color:#1e293b}
html[data-theme="light"] .calendar-day.outside{background:#f1f5f9;color:#94a3b8}
html[data-theme="light"] .calendar-day-number{color:#334155}
html[data-theme="light"] .calendar-day.outside .calendar-day-number{color:#94a3b8}
html[data-theme="light"] .calendar-day.today{box-shadow:inset 0 0 0 2px #2563eb;background:#eff6ff}
html[data-theme="light"] .calendar-legend{color:#64748b}
html[data-theme="light"] .calendar-event-chip{background:#e0f2fe;color:#0c4a6e}
html[data-theme="light"] .calendar-event-chip.moment{background:#fef3c7;color:#78350f}
html[data-theme="light"] .calendar-event-chip.draft{background:#e2e8f0;color:#475569}
html[data-theme="light"] .student-calendar-shell .calendar-event-chip.evaluation{background:#fee2e2;color:#991b1b}
html[data-theme="light"] .student-calendar-shell .calendar-event-chip.student{background:#ffedd5;color:#9a3412}
html[data-theme="light"] .student-calendar-shell .calendar-event-chip.general{background:#e0f2fe;color:#075985}
html[data-theme="light"] .calendar-more-button{background:#f8fafc;color:#1d4ed8;border-color:#94a3b8}
html[data-theme="light"] .calendar-more-button:hover,html[data-theme="light"] .calendar-more-button:focus-visible{background:#eff6ff;color:#1e40af;border-color:#2563eb}
html[data-theme="light"] .calendar-list-event:hover{background:#eff6ff;border-color:#60a5fa}
html[data-theme="light"] .calendar-status-draft{color:#64748b}
html[data-theme="light"] .calendar-status-published{color:#15803d}

/* Dialogo/detalhe do calendario em tema claro. */
html[data-theme="light"] .calendar-day-dialog-backdrop{background:rgba(15,23,42,.36)}
html[data-theme="light"] .calendar-day-dialog-panel{background:#ffffff;color:#0f172a;border-color:#cbd5e1;box-shadow:0 24px 70px rgba(15,23,42,.22)}
html[data-theme="light"] .calendar-day-search{color:#475569}
html[data-theme="light"] .calendar-day-search input{background:#fff;color:#0f172a;border-color:#cbd5e1}
html[data-theme="light"] .calendar-day-event-card{background:#f8fafc;border-color:#dbe2ea}
html[data-theme="light"] .calendar-day-event-card p{color:#475569}
html[data-theme="light"] .calendar-day-event-time{color:#1d4ed8}
html[data-theme="light"] .calendar-day-event-card.evaluation{background:#fff1f2}
html[data-theme="light"] .calendar-day-event-card.student{background:#fff7ed}
html[data-theme="light"] .calendar-day-event-card.general{background:#f0f9ff}

/* Documentacao: links/botoes deixam de herdar a aparencia escura. */
html[data-theme="light"] .student-resource-list .item{background:#ffffff;border-color:#dbe2ea}
html[data-theme="light"] .student-resource-list .resource-meta{color:#475569}
html[data-theme="light"] #documentsPanel .mini-button,
html[data-theme="light"] #documentsPanel a.mini-button{background:#eef4fb;color:#1d4ed8;border-color:#bfd0e4;box-shadow:none}
html[data-theme="light"] #documentsPanel .mini-button:hover,
html[data-theme="light"] #documentsPanel a.mini-button:hover{background:#dbeafe;color:#1e40af;border-color:#93b4dd;text-decoration:none}

/* Controlos comuns que ainda tinham fundo escuro codificado. */
html[data-theme="light"] .mini-button{background:#f1f5f9;color:#334155;border-color:#cbd5e1}
html[data-theme="light"] .mini-button:hover{background:#dbeafe;color:#1d4ed8}
html[data-theme="light"] .topbar-sidebar-toggle{background:#f8fafc;color:#334155;border-color:#cbd5e1}


/* PATCH 2026-08-10 - ações da topbar como botões com ícones */
.app-topbar nav{gap:8px}
.app-topbar .topbar-action{display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:7px 11px;border:1px solid var(--atlas-border);border-radius:10px;background:var(--atlas-surface-soft);color:var(--atlas-link);font:inherit;font-weight:700;line-height:1;cursor:pointer;text-decoration:none}
.app-topbar .topbar-action:hover{background:var(--atlas-surface-strong);border-color:var(--atlas-border-strong);text-decoration:none}
.topbar-action-icon{font-size:1.05rem;line-height:1}
html[data-theme="light"] .app-topbar .topbar-action{background:#f8fafc;color:#334155;border-color:#cbd5e1}
html[data-theme="light"] .app-topbar .topbar-action:hover{background:#eaf2fb;color:#1d4ed8;border-color:#aebfd2}
@media(max-width:620px){.app-topbar .topbar-action span:last-child{display:none}.app-topbar .topbar-action{padding:8px 10px}}

/* Tema claro - badges/perfis na gestão de Utilizadores. O tema escuro permanece inalterado. */
html[data-theme="light"] .data-table .badge{background:#e8f0fa;color:#334155;border-color:#c3d2e3}
html[data-theme="light"] .data-table .badge.good{background:#dcfce7;color:#166534;border-color:#86efac}
html[data-theme="light"] .data-table .badge.danger{background:#fee2e2;color:#991b1b;border-color:#fca5a5}


/* PATCH 2026-08-10 - home: ações da topbar e dimensão do login */
.home-topbar{justify-content:flex-start}
.home-topbar .topbar-brand{order:0}
.home-topbar nav{order:1;margin-left:auto}
#auth.auth-card{width:min(100%,440px);max-width:440px}
@media(max-width:520px){#auth.auth-card{width:100%;max-width:none}}

/* PATCH 2026-08-10 - UCs Activas do aluno */
.active-units-summary{display:flex;gap:12px;margin:0 0 18px}.active-units-summary-card{display:flex;align-items:baseline;gap:10px;padding:12px 16px;border:1px solid var(--atlas-border);border-radius:14px;background:var(--atlas-surface-soft)}.active-units-summary-card strong{font-size:1.8rem;color:var(--atlas-accent-soft)}.active-units-summary-card span{color:var(--atlas-muted)}
.active-units-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;min-width:0}.active-unit-card{min-width:0}.active-unit-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-bottom:14px;border-bottom:1px solid var(--atlas-border)}.active-unit-head h2{margin:4px 0 5px;font-size:1.15rem}.active-unit-code{font-weight:850;color:var(--atlas-accent-soft);font-size:.82rem;letter-spacing:.04em}.active-unit-status{flex:0 0 auto;padding:5px 9px;border-radius:999px;border:1px solid var(--atlas-border-strong);font-size:.76rem;font-weight:800}.active-unit-status.ongoing{background:var(--atlas-surface-strong);color:var(--atlas-link)}.active-unit-status.approved{background:#052e16;color:#86efac;border-color:#166534}.active-unit-status.failed{background:#450a0a;color:#fca5a5;border-color:#991b1b}
.active-unit-result{display:grid;grid-template-columns:1fr auto auto;gap:12px;align-items:center;padding:14px 0;border-bottom:1px solid var(--atlas-border)}.active-unit-result>span{color:var(--atlas-muted)}.active-unit-result>strong{font-size:1.35rem;color:var(--atlas-text-strong)}.active-unit-events-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0 9px}.active-unit-events{display:grid;gap:8px}.active-unit-event{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--atlas-border);border-radius:10px;background:var(--atlas-surface-soft)}.active-unit-event>div{min-width:0}.active-unit-event strong,.active-unit-event span{display:block}.active-unit-event .muted{margin-top:3px}.active-unit-empty{padding:10px 0}.active-unit-dialog{width:min(620px,calc(100vw - 2rem))}
html[data-theme="light"] .active-unit-status.approved{background:#dcfce7;color:#166534;border-color:#86efac}html[data-theme="light"] .active-unit-status.failed{background:#fee2e2;color:#991b1b;border-color:#fca5a5}html[data-theme="light"] .active-unit-event{background:#f8fafc;border-color:#dbe2ea}
@media(max-width:1000px){.active-units-grid{grid-template-columns:1fr}}@media(max-width:620px){.active-unit-head,.active-unit-events-head,.active-unit-event{align-items:stretch;flex-direction:column}.active-unit-result{grid-template-columns:1fr auto}.active-unit-result .mini-button{grid-column:1/-1}.active-unit-event .mini-button{align-self:flex-start}}

/* PATCH 2026-08-11 — Gestao Curricular conforme maquete aprovada */
.curriculum-history-course{position:relative!important;overflow:hidden!important;padding:0!important;border:1px solid #26364d!important;border-radius:14px!important;background:#071126!important;box-shadow:none!important}
.curriculum-history-course.is-completed{border-color:#22c55e!important;background:linear-gradient(90deg,rgba(34,197,94,.08),rgba(7,17,38,.96) 44%)!important;box-shadow:inset 0 0 0 1px rgba(34,197,94,.08)!important}
.curriculum-history-course-heading{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:18px!important;margin:0!important;padding:16px 18px!important;border:0!important;background:transparent!important}
.curriculum-history-course-heading-main{min-width:0!important;flex:1 1 auto!important}
.curriculum-history-course-title-row{display:flex!important;align-items:center!important;gap:10px!important;min-width:0!important;flex-wrap:wrap!important}
.curriculum-history-course-title-row h3{display:block!important;margin:0!important;color:#f8fafc!important;font-size:1.03rem!important;line-height:1.3!important;font-weight:800!important}
.curriculum-history-completed-icon{display:grid!important;place-items:center!important;width:34px!important;height:34px!important;flex:0 0 34px!important;border-radius:999px!important;background:#16a34a!important;color:#fff!important;font-size:1rem!important;font-weight:900!important;box-shadow:0 0 0 4px rgba(34,197,94,.10)!important}
.curriculum-history-completed-badge{display:inline-flex!important;align-items:center!important;padding:4px 9px!important;border:0!important;border-radius:7px!important;background:rgba(34,197,94,.12)!important;color:#22c55e!important;font-size:.82rem!important;font-weight:900!important;line-height:1.2!important;white-space:nowrap!important}
.item.curriculum-history-course>.curriculum-history-course-toggle{position:static!important;top:auto!important;right:auto!important;left:auto!important;flex:0 0 auto!important;min-width:102px!important;width:auto!important;margin:0!important;padding:8px 12px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;border:1px solid #3b82f6!important;border-radius:8px!important;background:transparent!important;color:#60a5fa!important;font-size:.82rem!important;font-weight:800!important;z-index:auto!important}
.curriculum-history-course.is-completed>.curriculum-history-course-heading>.curriculum-history-course-toggle{border-color:#22c55e!important;color:#22c55e!important}
.curriculum-history-course-toggle:hover{background:rgba(59,130,246,.08)!important}
.curriculum-history-course.is-completed .curriculum-history-course-toggle:hover{background:rgba(34,197,94,.08)!important}
.curriculum-history-course-toggle-icon{display:inline-block!important;font-size:1rem!important;line-height:1!important;transition:transform .16s ease!important}
.curriculum-history-course-toggle[aria-expanded="true"] .curriculum-history-course-toggle-icon{transform:rotate(180deg)!important}
.curriculum-history-collapsed-summary{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;align-items:center!important;gap:0!important;margin:0!important;padding:10px 68px!important;border-top:1px solid #25344a!important;border-bottom:0!important;background:rgba(255,255,255,.015)!important;overflow-x:auto!important}
.curriculum-history-compact-metric{display:flex!important;align-items:center!important;justify-content:center!important;gap:9px!important;min-width:220px!important;padding:7px 24px!important;border-right:1px solid #2a3b54!important;white-space:nowrap!important;text-align:center!important}
.curriculum-history-compact-metric:last-child{border-right:0!important}
.curriculum-history-compact-metric::before{display:grid!important;place-items:center!important;width:28px!important;height:28px!important;flex:0 0 28px!important;border:2px solid #3b82f6!important;border-radius:999px!important;color:#60a5fa!important;font-size:.77rem!important;font-weight:900!important;line-height:1!important}
.curriculum-history-compact-metric.metric-progress::before{content:'◔'!important}
.curriculum-history-compact-metric.metric-ects::before{content:'ECTS'!important;font-size:.5rem!important}
.curriculum-history-compact-metric.metric-average::before{content:'☆'!important;border:0!important;border-radius:0!important;color:#a855f7!important;font-size:1.7rem!important}
.curriculum-history-course.is-completed .metric-progress::before{border-color:#22c55e!important;color:#22c55e!important}
.curriculum-history-compact-metric span{display:inline!important;color:#dbe4f0!important;font-size:.9rem!important;font-weight:500!important;text-transform:none!important;letter-spacing:0!important}
.curriculum-history-compact-metric strong{display:inline!important;margin:0!important;color:#3b82f6!important;font-size:1rem!important;font-weight:900!important;line-height:1.2!important}
.curriculum-history-course.is-completed .metric-progress strong{color:#22c55e!important}
.curriculum-history-compact-metric.metric-average strong{color:#a855f7!important}
.curriculum-history-course-details{padding:0 16px 14px!important;border-top:1px solid #25344a!important;background:rgba(2,6,23,.18)!important}
.curriculum-history-section-title{margin:0!important;padding:12px 0 9px!important;border-bottom:1px solid #25344a!important;color:#e2e8f0!important;font-size:.92rem!important;font-weight:800!important}
.curriculum-history-years{display:grid!important;gap:0!important}
.curriculum-history-year{border-bottom:1px solid #25344a!important}
.curriculum-history-year>summary{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:16px!important;list-style:none!important;cursor:pointer!important;padding:10px 8px!important;color:#dbeafe!important;font-size:.88rem!important;font-weight:700!important}
.curriculum-history-year>summary::-webkit-details-marker{display:none!important}
.curriculum-history-year>summary::before{content:'›'!important;color:#93c5fd!important;font-size:1.25rem!important;line-height:1!important;transition:transform .14s ease!important}
.curriculum-history-year[open]>summary::before{transform:rotate(90deg)!important}
.curriculum-history-year-title{margin-right:auto!important}
.curriculum-history-year-stats{display:flex!important;align-items:center!important;gap:34px!important}
.curriculum-history-year-stats span{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:86px!important;padding:4px 10px!important;border-radius:8px!important;background:rgba(34,197,94,.10)!important;color:#86efac!important;font-size:.78rem!important;font-weight:800!important}
.curriculum-history-year-body{padding:0 0 10px!important}
.curriculum-history-semester{padding:8px 0 3px!important}
.curriculum-history-period-heading{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;padding:7px 8px!important;color:#93c5fd!important;font-size:.82rem!important;font-weight:800!important}
.curriculum-history-period-actions{display:flex!important;align-items:center!important;gap:6px!important}
.curriculum-history-table-wrap{width:100%!important;overflow-x:auto!important}
.curriculum-history-table{width:100%!important;min-width:850px!important;table-layout:fixed!important;border-collapse:collapse!important}
.curriculum-history-table col.c-code{width:12%!important}.curriculum-history-table col.c-unit{width:40%!important}.curriculum-history-table col.c-ects{width:10%!important}.curriculum-history-table col.c-grade{width:12%!important}.curriculum-history-table col.c-result{width:16%!important}.curriculum-history-table col.c-actions{width:10%!important}
.curriculum-history-table th,.curriculum-history-table td{box-sizing:border-box!important;padding:10px!important;vertical-align:middle!important}
.curriculum-history-table th:nth-child(n+3),.curriculum-history-table td:nth-child(n+3){text-align:center!important}
.curriculum-history-result{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:92px!important;padding:4px 9px!important;border-radius:999px!important;font-weight:800!important;line-height:1.2!important;border:1px solid transparent!important}
.curriculum-history-result.approved{color:#22c55e!important;background:rgba(34,197,94,.12)!important;border-color:rgba(34,197,94,.42)!important}
.curriculum-history-result.failed{color:#ef4444!important;background:rgba(239,68,68,.12)!important;border-color:rgba(239,68,68,.42)!important}
.curriculum-history-result.pending{color:#94a3b8!important;background:rgba(148,163,184,.10)!important;border-color:rgba(148,163,184,.25)!important}
.curriculum-history-course-actions{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;padding:12px 0 0!important}
.curriculum-history-course-actions .danger{margin-left:auto!important;border-color:#ef4444!important;color:#fca5a5!important}
html[data-theme="light"] .curriculum-history-course{background:#fff!important;border-color:#d6dfeb!important}
html[data-theme="light"] .curriculum-history-course.is-completed{background:linear-gradient(90deg,#f1fcf5,#fff 48%)!important;border-color:#22c55e!important}
html[data-theme="light"] .curriculum-history-course-title-row h3{color:#10213e!important}
html[data-theme="light"] .curriculum-history-collapsed-summary{background:#fbfdff!important;border-color:#dce4ee!important}
html[data-theme="light"] .curriculum-history-compact-metric{border-color:#dce4ee!important}
html[data-theme="light"] .curriculum-history-compact-metric span{color:#1f2d44!important}
html[data-theme="light"] .curriculum-history-course-details{background:#fff!important;border-color:#dce4ee!important}
html[data-theme="light"] .curriculum-history-section-title,html[data-theme="light"] .curriculum-history-year{border-color:#dce4ee!important;color:#10213e!important}
html[data-theme="light"] .curriculum-history-year>summary{color:#10213e!important}
html[data-theme="light"] .curriculum-history-period-heading{color:#1d4ed8!important}
@media(max-width:900px){.curriculum-history-collapsed-summary{padding-left:12px!important;padding-right:12px!important}.curriculum-history-compact-metric{min-width:205px!important;padding-left:14px!important;padding-right:14px!important}.curriculum-history-year-stats{gap:10px!important}}
@media(max-width:640px){.curriculum-history-course{overflow-x:auto!important;overflow-y:hidden!important;-webkit-overflow-scrolling:touch!important}.curriculum-history-course>.curriculum-history-course-heading,.curriculum-history-course>.curriculum-history-collapsed-summary,.curriculum-history-course>.curriculum-history-course-details{min-width:760px!important}.curriculum-history-course-heading{align-items:flex-start!important;padding:13px!important}.curriculum-history-course-title-row{padding-right:4px!important}.curriculum-history-completed-icon{width:30px!important;height:30px!important;flex-basis:30px!important}.item.curriculum-history-course>.curriculum-history-course-toggle{min-width:88px!important;padding:7px 9px!important}.curriculum-history-collapsed-summary{grid-template-columns:repeat(3,minmax(205px,1fr))!important;overflow:visible!important}.curriculum-history-year>summary{align-items:flex-start!important}.curriculum-history-year-stats{gap:6px!important;flex-wrap:nowrap!important;justify-content:flex-end!important}.curriculum-history-course-actions{flex-wrap:nowrap!important}}

.academic-history-completed-state{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:8px}.academic-history-completed-state strong{color:#15803d;font-weight:800}

.history-form-fields{display:contents}
.history-form-fields[hidden]{display:none!important}

/* CQES - Acesso ao Ensino Superior */
.cqes-card{border-left:4px solid var(--accent,#0f766e)}
.cqes-language-fields{display:contents}
.cqes-selected-units{margin-top:1rem}
.cqes-unit-preview{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
.cqes-unit-chip{display:inline-flex;gap:.4rem;align-items:center;padding:.45rem .7rem;border:1px solid var(--border);border-radius:999px;background:var(--surface-soft,#f7faf9);font-size:.9rem}
.cqes-unit-chip strong{white-space:nowrap}
.cqes-attempts-head{margin-top:1.25rem}
.cqes-attempt{border-left:4px solid transparent}
.cqes-attempt.is-completed{border-left-color:#198754;background:rgba(25,135,84,.05)}
.cqes-attempt.is-integral{box-shadow:inset 0 0 0 1px rgba(25,135,84,.22)}
.cqes-attempt-title{display:flex;flex-wrap:wrap;gap:.55rem;align-items:center;margin-bottom:.35rem}
.cqes-status{display:inline-flex;align-items:center;border-radius:999px;padding:.2rem .55rem;font-size:.78rem;font-weight:800;letter-spacing:.04em}
.cqes-status.completed{color:#146c43;background:rgba(25,135,84,.12)}
.cqes-status.pending{color:var(--muted);background:var(--surface-soft,#f2f4f5)}
.cqes-results-grid{display:grid;grid-template-columns:repeat(3,minmax(210px,1fr));gap:.75rem;margin-top:.8rem;overflow-x:auto;padding-bottom:.25rem}
.cqes-result{min-width:210px;border:1px solid var(--border);border-radius:.8rem;padding:.75rem;background:var(--surface,#fff)}
.cqes-result.approved{border-color:rgba(25,135,84,.38)}
.cqes-result .cqes-result-head{display:flex;justify-content:space-between;gap:.5rem;align-items:flex-start;margin-bottom:.55rem}
.cqes-result label{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
.cqes-result input{width:7rem}
.cqes-summary-line{display:flex;gap:1.1rem;flex-wrap:wrap;margin-top:.55rem;font-size:.92rem}
@media(max-width:640px){.cqes-results-grid{grid-template-columns:repeat(3,230px)}.cqes-card{overflow-x:hidden}}

.cqes-attempt-summary{display:flex;justify-content:space-between;align-items:center;gap:1rem;cursor:pointer;list-style-position:outside}.cqes-attempt-summary::marker{color:var(--muted)}.cqes-attempt-meta{display:flex;align-items:center;gap:1rem;white-space:nowrap;color:var(--muted);font-size:.9rem}.cqes-attempt-meta strong{color:var(--text)}.cqes-attempt-details{padding-top:.75rem}.cqes-attempt[open] .cqes-attempt-summary{padding-bottom:.5rem;border-bottom:1px solid var(--border)}@media(max-width:700px){.cqes-attempt-summary{align-items:flex-start;flex-direction:column}.cqes-attempt-meta{white-space:normal;flex-wrap:wrap}}

/* Admin — Percursos dos Alunos alinhado com o Histórico Académico do Portal */
.admin-student-history-shell{margin-bottom:16px}
.admin-student-picker{display:grid;grid-template-columns:minmax(280px,2fr) minmax(220px,1fr) auto auto;gap:12px;align-items:end}
.admin-student-picker label{min-width:0}
.admin-student-picker select,.admin-student-picker input{width:100%}
.admin-student-history-cards{gap:14px}
.admin-student-edit-grid{margin-top:16px}
.admin-academic-support-grid{margin-top:14px;gap:14px}
.admin-academic-support-grid>div{min-width:0}
@media(max-width:1050px){.admin-student-picker{grid-template-columns:1fr 1fr}.admin-student-picker .button{width:100%}}
@media(max-width:700px){.admin-student-picker{grid-template-columns:1fr}.admin-student-picker .button{width:100%}.admin-student-edit-grid{grid-template-columns:1fr!important}}


/* Admin — normalização do seletor de aluno e filtros do histórico académico */
.admin-student-picker label{display:grid;gap:7px;color:var(--atlas-label)}
.admin-student-picker select,.admin-student-picker input{
  min-height:46px;border:1px solid var(--atlas-border-strong);background-color:var(--atlas-bg);color:var(--atlas-text-strong);padding:11px 40px 11px 12px;border-radius:var(--atlas-control-radius);font:inherit
}
.admin-student-picker select{
  appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2393c5fd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;background-size:16px
}
.admin-student-picker select:focus,.admin-student-picker input:focus{outline:2px solid var(--atlas-focus);outline-offset:1px}
.admin-student-picker select option{background:var(--atlas-bg);color:var(--atlas-text-strong)}
.admin-history-filter-form{grid-template-columns:repeat(2,minmax(0,1fr))}
.admin-history-uc-field{grid-column:1/-1}
.admin-history-submit{grid-column:1/-1}
@media(max-width:700px){.admin-history-filter-form{grid-template-columns:1fr}.admin-history-uc-field,.admin-history-submit{grid-column:auto}}

/* Index/auth navigation normalization — 2026-08-11 */
.app-topbar .topbar-action.active,.app-topbar .topbar-action[aria-current="page"]{background:#2563eb;color:#fff;border-color:#3b82f6;box-shadow:0 0 0 1px #3b82f633 inset}
.app-topbar .topbar-action.active:hover,.app-topbar .topbar-action[aria-current="page"]:hover{background:#1d4ed8;color:#fff;border-color:#60a5fa}
html[data-theme="light"] .app-topbar .topbar-action.active,html[data-theme="light"] .app-topbar .topbar-action[aria-current="page"]{background:#2563eb;color:#fff;border-color:#1d4ed8}
.home-topbar{justify-content:flex-start}
/* FAQ do Aluno: quando existe pesquisa, os resultados ficam numa area com scroll vertical. */
#faq.faq-search-results-scroll{max-height:min(62vh,680px);overflow-y:auto;overflow-x:hidden;padding-right:8px;scrollbar-gutter:stable}
#faq.faq-search-results-scroll .item{margin-right:2px}



/* PATCH 2026-08-11 - Simulador Curricular no Portal do Aluno */
.student-simulator-controls{margin-bottom:18px}.student-simulator-toolbar{grid-template-columns:repeat(4,minmax(180px,1fr))}.student-simulator-hide-row{grid-column:1/3;align-self:center}.student-simulator-summary{margin-top:18px}.student-simulator-summary .card{padding:16px;box-shadow:none}.student-simulator-summary h3{margin:0 0 8px;font-size:.85rem;color:var(--atlas-muted)}.student-simulator-map-card{min-width:0}.student-simulator-map-card .curriculum-graph-viewport{min-height:610px;max-height:72vh;scrollbar-gutter:stable}.student-simulator-map-card .curriculum-node.student-history-completed{border-color:#16a34a;border-left-color:#22c55e;background:linear-gradient(135deg,color-mix(in srgb,#16a34a 26%,var(--atlas-surface-solid)),color-mix(in srgb,#22c55e 13%,var(--atlas-surface-solid)));box-shadow:0 0 0 1px rgba(34,197,94,.22),0 7px 20px rgba(22,163,74,.16);cursor:default}.student-simulator-map-card .curriculum-node.student-history-completed:hover,.student-simulator-map-card .curriculum-node.student-history-completed:focus{outline-color:#4ade80}.student-simulator-completed-badge,.student-simulator-planned-badge{display:inline-flex!important;align-items:center;width:max-content;margin-top:8px;padding:3px 8px;border-radius:999px;font-size:.7rem!important;font-weight:800}.student-simulator-completed-badge{background:#166534;color:#dcfce7}.student-simulator-planned-badge{background:#6b21a8;color:#f3e8ff}.student-simulator-legend{margin-top:12px}.student-simulator-map-card .curriculum-section{display:grid;gap:8px;padding:9px;border:1px solid var(--atlas-border);border-radius:12px;background:color-mix(in srgb,var(--atlas-surface-soft) 82%,transparent)}.student-simulator-map-card .curriculum-section+.curriculum-section{margin-top:10px}.student-simulator-map-card .curriculum-section-title{display:flex;justify-content:space-between;gap:8px;color:var(--atlas-muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.04em}.student-simulator-map-card .curriculum-section-title strong{color:var(--atlas-label)}
@media(max-width:1100px){.student-simulator-toolbar{grid-template-columns:repeat(2,minmax(180px,1fr))}.student-simulator-hide-row{grid-column:1/-1}}
@media(max-width:720px){.student-simulator-toolbar{grid-template-columns:1fr}.student-simulator-hide-row{grid-column:auto}.student-simulator-map-card .curriculum-graph-viewport{min-height:520px}}


/* PATCH 2026-08-11 - Simulador Aluno: cores por equivalencia curricular */
.student-simulator-map-card .curriculum-node.student-simulator-required:not(.student-history-completed){border-color:#2563eb;border-left-color:#3b82f6;background:linear-gradient(135deg,color-mix(in srgb,#2563eb 24%,var(--atlas-surface-solid)),color-mix(in srgb,#3b82f6 10%,var(--atlas-surface-solid)))}
.student-simulator-map-card .curriculum-node.student-simulator-optional:not(.student-history-completed){border-color:#7e22ce;border-left-color:#a855f7;background:linear-gradient(135deg,color-mix(in srgb,#7e22ce 24%,var(--atlas-surface-solid)),color-mix(in srgb,#a855f7 10%,var(--atlas-surface-solid)))}
.student-simulator-map-card .curriculum-node.student-simulator-planned:not(.student-history-completed){box-shadow:0 0 0 2px rgba(250,204,21,.62),0 7px 20px rgba(0,0,0,.18)}


/* PATCH 2026-08-11 - Simulador Aluno: mapa compacto e exportacao PDF sem pop-ups */
.student-simulator-legend{display:none!important}
.student-simulator-map-head{align-items:center}
.student-simulator-map-head .button{flex:0 0 auto}
.student-simulator-map-card .curriculum-graph-viewport{min-height:430px;max-height:68vh}
.student-simulator-map-card .curriculum-graph{padding:10px;min-height:410px}
.student-simulator-map-card .curriculum-columns{gap:10px}
.student-simulator-map-card .curriculum-column{width:170px;flex:0 0 170px}
.student-simulator-map-card .curriculum-semester-column{width:170px;flex-basis:170px}
.student-simulator-map-card .curriculum-path-column{width:160px;flex-basis:160px}
.student-simulator-map-card .curriculum-column>h3{margin-bottom:7px;padding:6px 7px;border-radius:8px;font-size:.75rem}
.student-simulator-map-card .curriculum-column-body{gap:7px}
.student-simulator-map-card .curriculum-section{gap:5px;padding:6px;border-radius:9px}
.student-simulator-map-card .curriculum-section+.curriculum-section{margin-top:6px}
.student-simulator-map-card .curriculum-section-title{font-size:.62rem;gap:4px}
.student-simulator-map-card .curriculum-node{border-left-width:4px;border-radius:8px;padding:7px;box-shadow:0 3px 9px #0002}
.student-simulator-map-card .curriculum-node .node-title{font-size:.76rem;line-height:1.18}
.student-simulator-map-card .curriculum-node .node-code{font-size:.64rem;margin-top:3px}
.student-simulator-map-card .curriculum-node small{font-size:.64rem;line-height:1.18;margin-top:4px}
.student-simulator-map-card .student-simulator-completed-badge{margin-top:5px;padding:2px 6px;font-size:.6rem!important}
.student-simulator-map-card .curriculum-path-card{padding:9px;border-radius:9px;gap:4px;box-shadow:0 4px 12px #0003}
.student-simulator-map-card .curriculum-path-card strong{font-size:.78rem;line-height:1.2}
.student-simulator-map-card .curriculum-path-card .node-code{font-size:.64rem;margin-top:2px}
.student-simulator-map-card .curriculum-path-card small{font-size:.64rem;line-height:1.25;margin-top:2px}
.student-simulator-map-card .curriculum-empty.compact{min-height:34px;padding:5px;font-size:.65rem}
.student-simulator-print-header{display:none}
@media(max-width:1100px){.student-simulator-map-card .curriculum-column,.student-simulator-map-card .curriculum-semester-column{width:165px;flex-basis:165px}.student-simulator-map-card .curriculum-path-column{width:155px;flex-basis:155px}}
@media(max-width:720px){.student-simulator-map-head{align-items:flex-start;gap:10px}.student-simulator-map-head .button{width:100%}.student-simulator-map-card .curriculum-graph-viewport{min-height:420px}}

@page{size:A4 landscape;margin:8mm}
@media print{
  html,body{background:#fff!important;color:#111!important}
  body.student-simulator-print-mode{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body.student-simulator-print-mode .app-topbar,
  body.student-simulator-print-mode #auth,
  body.student-simulator-print-mode #courseSelection,
  body.student-simulator-print-mode #studentArea>.student-tabs,
  body.student-simulator-print-mode #studentArea>.student-panel:not(#simulatorPanel),
  body.student-simulator-print-mode #simulatorPanel>.dashboard-head,
  body.student-simulator-print-mode #simulatorPanel>.student-simulator-controls,
  body.student-simulator-print-mode .student-simulator-map-head .button{display:none!important}
  body.student-simulator-print-mode .shell{display:block!important;max-width:none!important;width:100%!important;margin:0!important;padding:0!important}
  body.student-simulator-print-mode #studentArea,
  body.student-simulator-print-mode #simulatorPanel{display:block!important;margin:0!important;padding:0!important;width:100%!important}
  body.student-simulator-print-mode #simulatorPanel[hidden]{display:block!important}
  body.student-simulator-print-mode .student-simulator-map-card{display:block!important;border:0!important;box-shadow:none!important;background:#fff!important;color:#111!important;margin:0!important;padding:0!important;width:100%!important}
  body.student-simulator-print-mode .student-simulator-map-head{display:block!important;margin:0 0 5mm!important}
  body.student-simulator-print-mode .student-simulator-map-head h2{color:#111!important;margin:0 0 2mm!important;font-size:15pt!important}
  body.student-simulator-print-mode .student-simulator-map-head p{color:#444!important;font-size:8pt!important;margin:0!important}
  body.student-simulator-print-mode .student-simulator-print-header{display:block!important;margin:0 0 4mm!important;padding:3mm!important;border:1px solid #bbb!important;border-radius:2mm!important;color:#111!important;font-size:8pt!important;line-height:1.35!important}
  body.student-simulator-print-mode .curriculum-graph-viewport{overflow:visible!important;max-height:none!important;min-height:0!important;height:auto!important;border:0!important;background:#fff!important}
  body.student-simulator-print-mode .curriculum-graph{min-width:0!important;min-height:0!important;padding:0!important;background:#fff!important}
  body.student-simulator-print-mode .curriculum-columns{gap:5px!important;justify-content:flex-start!important;align-items:flex-start!important;width:100%!important}
  body.student-simulator-print-mode .curriculum-column,
  body.student-simulator-print-mode .curriculum-semester-column{width:141px!important;flex:0 0 141px!important}
  body.student-simulator-print-mode .curriculum-path-column{width:132px!important;flex:0 0 132px!important}
  body.student-simulator-print-mode .curriculum-column>h3{position:static!important;background:#eef2f7!important;border-color:#bbb!important;color:#111!important;font-size:6.8pt!important;padding:4px!important;margin-bottom:4px!important}
  body.student-simulator-print-mode .curriculum-section{break-inside:avoid;background:#f8fafc!important;border-color:#bbb!important;padding:4px!important;gap:3px!important}
  body.student-simulator-print-mode .curriculum-section-title{font-size:5.8pt!important;color:#444!important}
  body.student-simulator-print-mode .curriculum-section-title strong{color:#111!important}
  body.student-simulator-print-mode .curriculum-node{break-inside:avoid;color:#111!important;padding:4px!important;border-radius:5px!important;box-shadow:none!important}
  body.student-simulator-print-mode .curriculum-node .node-title{color:#111!important;font-size:6.3pt!important;line-height:1.12!important}
  body.student-simulator-print-mode .curriculum-node .node-code,
  body.student-simulator-print-mode .curriculum-node small{color:#333!important;font-size:5.4pt!important;line-height:1.12!important}
  body.student-simulator-print-mode .curriculum-node.student-history-completed{background:#dcfce7!important;border-color:#16a34a!important}
  body.student-simulator-print-mode .curriculum-node.student-simulator-required:not(.student-history-completed){background:#dbeafe!important;border-color:#2563eb!important}
  body.student-simulator-print-mode .curriculum-node.student-simulator-optional:not(.student-history-completed){background:#f3e8ff!important;border-color:#7e22ce!important}
  body.student-simulator-print-mode .curriculum-path-card{background:#fff7ed!important;border-color:#f59e0b!important;color:#111!important;box-shadow:none!important;padding:5px!important}
  body.student-simulator-print-mode .curriculum-path-card strong{color:#111!important;font-size:6.5pt!important}
  body.student-simulator-print-mode .curriculum-path-card .node-code,
  body.student-simulator-print-mode .curriculum-path-card small{color:#333!important;font-size:5.4pt!important}
  body.student-simulator-print-mode .student-simulator-completed-badge{background:#166534!important;color:#fff!important;font-size:5.2pt!important;padding:1px 4px!important}
}

/* Simulador Curricular do Aluno — CQES / Acesso ao Ensino Superior */
.student-simulator-cqes-languages{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:12px;padding:12px;border:1px solid var(--atlas-border);border-radius:12px;background:color-mix(in srgb,var(--atlas-surface-soft) 88%,transparent)}
.student-simulator-cqes-languages[hidden]{display:none!important}
.student-simulator-cqes-languages label{margin:0}
.student-simulator-cqes-map .cqes-simulator-column{width:230px;flex-basis:230px}
.student-simulator-cqes-map .curriculum-node{cursor:default}
@media(max-width:720px){.student-simulator-cqes-languages{grid-template-columns:1fr}.student-simulator-cqes-map .cqes-simulator-column{width:200px;flex-basis:200px}}
@media print{body.student-simulator-print-mode .student-simulator-cqes-map .cqes-simulator-column{width:170px!important;flex-basis:170px!important}}

/* Historico do proprio curso atual: periodos concluidos tratados como historico academico. */
.academic-history-course-title-line{display:flex;align-items:center;gap:.55rem;flex-wrap:wrap}
.academic-history-current-course{display:inline-flex;align-items:center;border:1px solid color-mix(in srgb,var(--accent,#2f6fed) 42%,transparent);border-radius:999px;padding:.18rem .48rem;font-size:.68rem;font-weight:800;letter-spacing:.035em;line-height:1.2;color:var(--accent,#2f6fed);background:color-mix(in srgb,var(--accent,#2f6fed) 9%,transparent);white-space:nowrap}

/* Histórico académico: escolha explícita de UCs opcionais */
.academic-history-unit-section{display:grid;gap:.8rem}.academic-history-unit-section+.academic-history-unit-section{margin-top:1rem}.academic-history-unit-section-head,.academic-history-choice-head,.academic-history-unit-main{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.academic-history-unit-section-head>div,.academic-history-choice-head>div{display:grid;gap:.18rem}.academic-history-choice-group{display:grid;gap:.65rem;padding:.75rem;border:1px solid color-mix(in srgb,var(--border,#d7dde7) 80%,transparent);border-radius:12px;background:color-mix(in srgb,var(--surface,#fff) 94%,var(--accent,#2f6fed) 6%)}.academic-history-choice-group+.academic-history-choice-group{margin-top:.7rem}.academic-history-choice-count{font-size:.78rem;font-weight:800;white-space:nowrap}.academic-history-unit{display:grid;gap:.65rem}.academic-history-unit.is-optional{border-style:dashed}.academic-history-unit.is-optional.is-selected{border-style:solid;box-shadow:inset 3px 0 0 color-mix(in srgb,var(--accent,#2f6fed) 72%,transparent)}.academic-history-unit-title{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.academic-history-unit-badge{display:inline-flex;align-items:center;border-radius:999px;padding:.12rem .42rem;font-size:.68rem;font-weight:800;letter-spacing:.02em}.academic-history-unit-badge.required{background:color-mix(in srgb,var(--accent,#2f6fed) 12%,transparent);color:var(--accent,#2f6fed)}.academic-history-unit-badge.optional{background:rgba(126,34,206,.10);color:#7e22ce}.academic-history-optional-selector{display:flex;align-items:center;gap:.45rem;font-size:.82rem;font-weight:700;white-space:nowrap}.academic-history-optional-selector input{width:1rem;height:1rem}.academic-history-grade:disabled{opacity:.55;cursor:not-allowed}@media(max-width:760px){.academic-history-unit-section-head,.academic-history-choice-head,.academic-history-unit-main{flex-direction:column}.academic-history-optional-selector{white-space:normal}}

/* Admin · gestão documental dedicada (2026-08-12) */
.documents-admin-toolbar{display:grid;grid-template-columns:minmax(240px,1fr) minmax(180px,260px);gap:14px;align-items:end}.documents-admin-toolbar label{display:grid;gap:7px}.documents-admin-toolbar input,.documents-admin-toolbar select{width:100%}.documents-admin-item{display:grid;gap:8px}.document-admin-item-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start}.document-admin-item-head>div{display:grid;gap:3px;min-width:0}.document-status{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:5px 9px;font-size:.75rem;font-weight:800;white-space:nowrap}.document-status.published{background:rgba(34,197,94,.14);color:#86efac;border:1px solid rgba(34,197,94,.35)}.document-status.draft{background:rgba(148,163,184,.12);color:#cbd5e1;border:1px solid rgba(148,163,184,.28)}.document-admin-url{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.documents-admin-list{max-height:680px}@media(max-width:760px){.documents-admin-toolbar{grid-template-columns:1fr}.document-admin-item-head{flex-direction:column}.document-admin-url{white-space:normal;overflow-wrap:anywhere}}
html[data-theme="light"] .document-status.published{background:#dcfce7;color:#15803d;border-color:#86efac}html[data-theme="light"] .document-status.draft{background:#f1f5f9;color:#475569;border-color:#cbd5e1}

/* Admin · Documentos — normalização gráfica dos filtros (2026-08-12) */
.documents-admin-toolbar label{display:grid;gap:7px;color:var(--atlas-label);font-weight:600}
.documents-admin-toolbar input,.documents-admin-toolbar select{
  width:100%;min-height:46px;border:1px solid var(--atlas-border-strong);background-color:var(--atlas-bg);color:var(--atlas-text-strong);padding:11px 12px;border-radius:var(--atlas-control-radius);font:inherit;font-weight:400
}
.documents-admin-toolbar input::placeholder{color:var(--atlas-muted);opacity:1}
.documents-admin-toolbar select{
  appearance:none;-webkit-appearance:none;padding-right:40px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2393c5fd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;background-size:16px
}
.documents-admin-toolbar input:focus,.documents-admin-toolbar select:focus{outline:2px solid var(--atlas-focus);outline-offset:1px;border-color:var(--atlas-focus)}
.documents-admin-toolbar select option{background:var(--atlas-bg);color:var(--atlas-text-strong)}
html[data-theme="light"] .documents-admin-toolbar input,html[data-theme="light"] .documents-admin-toolbar select{background-color:#fff;color:#0f172a;border-color:#cbd5e1}
html[data-theme="light"] .documents-admin-toolbar label{color:#475569}

/* PATCH 2026-08-12 - Normalizacao global dos campos Aluno/Admin em tema escuro e claro.
   Regra transversal: todos os controlos editaveis usam os mesmos tokens visuais.
   Excluem-se apenas hidden/checkbox/radio, que recebem tratamento proprio. */
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select,
textarea{
  min-height:46px!important;
  border:1px solid var(--atlas-border-strong)!important;
  border-radius:var(--atlas-control-radius)!important;
  background-color:var(--atlas-bg)!important;
  color:var(--atlas-text-strong)!important;
  font:inherit!important;
  line-height:1.35;
  padding:11px 12px!important;
  box-shadow:none;
  transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease,color .16s ease;
}
textarea{min-height:96px!important;resize:vertical}
select{
  appearance:none!important;
  -webkit-appearance:none!important;
  padding-right:40px!important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2393c5fd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;
  background-repeat:no-repeat!important;
  background-position:right 12px center!important;
  background-size:16px!important;
}
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"])::placeholder,
textarea::placeholder{color:var(--atlas-muted)!important;opacity:1}
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):focus,
select:focus,
textarea:focus{
  outline:2px solid var(--atlas-focus)!important;
  outline-offset:1px!important;
  border-color:var(--atlas-focus)!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--atlas-focus) 14%,transparent)!important;
}
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):disabled,
select:disabled,
textarea:disabled{
  opacity:.58!important;
  cursor:not-allowed!important;
  background-color:var(--atlas-surface-soft)!important;
  color:var(--atlas-muted)!important;
}
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"])[readonly],
textarea[readonly]{background-color:var(--atlas-surface-soft)!important;color:var(--atlas-label)!important}
select option,select optgroup{background:var(--atlas-surface-solid);color:var(--atlas-text-strong)}
input[type="checkbox"],input[type="radio"]{
  width:1.05rem;height:1.05rem;min-width:1.05rem;accent-color:var(--atlas-accent);cursor:pointer
}
input[type="checkbox"]:focus-visible,input[type="radio"]:focus-visible{outline:2px solid var(--atlas-focus);outline-offset:2px}
input[type="checkbox"]:disabled,input[type="radio"]:disabled{opacity:.55;cursor:not-allowed}
input[type="search"]{-webkit-appearance:none;appearance:none}
input[type="date"],input[type="time"],input[type="datetime-local"]{color-scheme:dark}

/* A altura uniforme nao deve transformar controlos intencionalmente compactos em campos largos. */
.cqes-result input:not([type="checkbox"]):not([type="radio"]){width:7rem}
.academic-history-optional-selector input[type="checkbox"]{width:1rem;height:1rem;min-width:1rem}

html[data-theme="light"] input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
html[data-theme="light"] select,
html[data-theme="light"] textarea{
  background-color:#fff!important;
  color:var(--atlas-text-strong)!important;
  border-color:var(--atlas-border-strong)!important;
}
html[data-theme="light"] select{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;
}
html[data-theme="light"] input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):disabled,
html[data-theme="light"] select:disabled,
html[data-theme="light"] textarea:disabled,
html[data-theme="light"] input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"])[readonly],
html[data-theme="light"] textarea[readonly]{background-color:var(--atlas-surface-soft)!important;color:var(--atlas-muted)!important}
html[data-theme="light"] input[type="date"],html[data-theme="light"] input[type="time"],html[data-theme="light"] input[type="datetime-local"]{color-scheme:light}


/* PATCH 2026-08-12 - CQES: contraste dos chips no Histórico e coerência Claro/Escuro. */
.cqes-selected-units .cqes-unit-preview{color:var(--atlas-text,#e5e7eb)}
.cqes-selected-units .cqes-unit-preview>strong{color:var(--atlas-text-strong,#f8fafc)}
.cqes-selected-units .cqes-unit-chip{
  background:#111c31;
  border-color:#334155;
  color:#dbeafe;
  box-shadow:none;
}
.cqes-selected-units .cqes-unit-chip strong{color:#93c5fd}
html[data-theme="light"] .cqes-selected-units .cqes-unit-preview{color:#334155}
html[data-theme="light"] .cqes-selected-units .cqes-unit-preview>strong{color:#0f172a}
html[data-theme="light"] .cqes-selected-units .cqes-unit-chip{background:#f8fafc;border-color:#cbd5e1;color:#334155}
html[data-theme="light"] .cqes-selected-units .cqes-unit-chip strong{color:#1d4ed8}

/* PATCH 2026-08-12 - Admin Percursos dos Alunos: fluxo assistido por semestre */
.admin-student-edit-grid{display:grid;gap:16px;margin-top:16px}
.admin-history-semester-card{width:100%}
.admin-history-filter-form{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}
.admin-history-semester-units,.admin-history-observation,.admin-history-validation,.admin-history-submit{grid-column:1/-1}
.admin-history-semester-units{display:grid;gap:14px}
.admin-semester-uc-section{border:1px solid var(--atlas-border);border-radius:14px;padding:14px;background:var(--atlas-surface-soft)}
.admin-semester-uc-section h3{margin:0 0 10px}
.admin-semester-uc-row{display:grid;grid-template-columns:minmax(320px,1fr) 130px 160px;gap:12px;align-items:end;padding:10px 0;border-top:1px solid var(--atlas-border)}
.admin-semester-uc-row:first-of-type{border-top:0}
.admin-semester-uc-row.is-recorded{opacity:.7}
.admin-semester-uc-choice{display:flex!important;flex-direction:row!important;align-items:center!important;gap:10px!important;min-width:0}
.admin-semester-uc-choice span{display:grid;gap:3px;min-width:0}.admin-semester-uc-choice small{color:var(--atlas-muted)}
.admin-advanced-tools{margin:0}.admin-advanced-tools>summary{cursor:pointer;font-weight:700;font-size:1.05rem;list-style:none}.admin-advanced-tools>summary::-webkit-details-marker{display:none}.admin-advanced-tools>summary:after{content:'+';float:right}.admin-advanced-tools[open]>summary:after{content:'−'}
.admin-advanced-tools-grid{margin-top:16px}.admin-advanced-tools-grid>.side-form{padding:0}.admin-advanced-tools-grid>.card{margin:0}
@media(max-width:900px){.admin-history-filter-form{grid-template-columns:1fr}.admin-semester-uc-row{grid-template-columns:1fr}.admin-history-semester-units,.admin-history-observation,.admin-history-validation,.admin-history-submit{grid-column:auto}}

/* PATCH 2026-08-12 - Responsividade V2 conservadora.
   Regra: desktop >= 901px permanece inalterado. Apenas tablet/telemovel recebem
   compactacao e protecoes de largura. Nao altera navegacao, cores ou logica. */
@media(max-width:900px){
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  main.shell,main.shell.wide-shell{width:100%;max-width:100%;padding:20px 14px 48px;margin:0 auto}
  #studentArea,#studentArea.nav-collapsed,#dashboard,#dashboard.nav-collapsed{width:100%;max-width:100%;margin:0;gap:14px}
  #studentArea>.student-panel,#dashboard>.dashboard-head,#dashboard>#adminMessage,#dashboard>.tab-panel{width:100%;max-width:100%;min-width:0;padding-left:0;padding-right:0}
  .student-tabs.side-navigation,.admin-tabs.side-navigation{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;position:static!important;width:100%!important;max-width:100%;overflow-x:auto!important;overflow-y:hidden!important;gap:6px;padding:7px;margin:0 0 14px;border-radius:12px;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
  .side-navigation .student-tab,.side-navigation .tab{display:flex!important;width:auto!important;min-width:max-content!important;min-height:40px;padding:8px 10px;gap:8px;flex:0 0 auto;text-align:left}
  .side-navigation .side-nav-label{display:inline!important}
  .side-navigation .side-nav-icon{width:23px;min-width:23px;height:23px;font-size:.95rem}
  .grid,.cards-2,.cards-3,.admin-grid,.admin-student-edit-grid,.admin-academic-support-grid{min-width:0;max-width:100%}
  .card,.item,.section-head,.stack-list{min-width:0;max-width:100%}
  .form-grid,.compact-form,.form-inline,.admin-student-picker,.admin-history-filter-form,.student-simulator-toolbar,.simulator-toolbar,.calendar-toolbar,.documents-admin-toolbar{min-width:0;max-width:100%}
  .form-grid>*,.compact-form>*,.form-inline>*,.admin-student-picker>*,.admin-history-filter-form>*,.student-simulator-toolbar>*,.simulator-toolbar>*,.calendar-toolbar>*,.documents-admin-toolbar>*{min-width:0;max-width:100%}
  input:not([type="checkbox"]):not([type="radio"]),select,textarea{max-width:100%}
  .table-wrap,.curriculum-history-table-wrap,.curriculum-graph-viewport,.student-curriculum,.calendar-shell{max-width:100%;-webkit-overflow-scrolling:touch}
}

@media(max-width:700px){
  main.shell,main.shell.wide-shell{padding:16px 11px 38px}
  .topbar,.app-topbar{height:58px;min-height:58px;padding-left:8px;padding-right:8px}
  .topbar-brand{max-width:min(150px,44vw)}
  .topbar-brand img{height:38px;max-height:42px}
  .app-topbar nav{gap:5px}
  .app-topbar .topbar-action{min-height:36px;padding:7px 9px;border-radius:9px}
  .card{padding:16px;border-radius:14px}
  .item{padding:10px;border-radius:10px}
  .grid{gap:13px;margin-bottom:13px}
  .dashboard-head{gap:12px;margin-bottom:16px}
  .dashboard-head h1{font-size:clamp(1.65rem,7vw,2.1rem)}
  .dashboard-head .button{width:auto}
  .big-number{font-size:2rem}
  .button{padding:10px 13px;border-radius:10px}
  .mini-button{padding:6px 8px}
  .button-row{gap:7px}
  .compact-form,.form-inline,.admin-history-filter-form,.admin-student-picker{grid-template-columns:1fr!important}
  .section-head{gap:10px}
  .admin-semester-uc-row{grid-template-columns:1fr!important}
  .notification-setting-row{grid-template-columns:1fr!important;gap:10px;padding:13px}
  .days-control{grid-column:auto!important;white-space:normal;flex-wrap:wrap}
  .calendar-timeline-viewport{max-width:100%}
  .calendar-day-dialog-panel{max-width:100%}
  .curriculum-column{width:190px;flex-basis:190px}
  .student-simulator-cqes-map .cqes-simulator-column{width:180px;flex-basis:180px}
  .curriculum-columns{gap:14px}
  .curriculum-graph{padding:12px}
}

@media(max-width:520px){
  main.shell,main.shell.wide-shell{padding:12px 8px 32px}
  .topbar,.app-topbar{height:54px;min-height:54px}
  .topbar-brand{max-width:min(132px,40vw)}
  .topbar-brand img{height:34px}
  .app-topbar .topbar-action{min-width:36px;min-height:34px;padding:6px 8px;justify-content:center}
  .app-topbar .topbar-action span:last-child{display:none}
  .student-tabs.side-navigation,.admin-tabs.side-navigation{margin-bottom:10px;padding:5px;border-radius:10px}
  .side-navigation .student-tab,.side-navigation .tab{min-height:36px;padding:7px 9px;font-size:.86rem}
  .side-navigation .side-nav-icon{width:21px;min-width:21px;height:21px;font-size:.9rem}
  .card{padding:13px;border-radius:12px}
  .item{padding:9px}
  .form-grid{gap:12px}
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea{min-height:42px!important;padding:9px 10px!important}
  select{padding-right:34px!important;background-position:right 9px center!important}
  textarea{min-height:82px!important}
  .button{padding:9px 11px;font-size:.9rem}
  .button-row{align-items:stretch}
  .button-row>.button{flex:1 1 auto}
  .dashboard-head h1{font-size:1.55rem}
  .dashboard-head p{margin-top:6px}
  .big-number{font-size:1.8rem}
  .documents-admin-toolbar{grid-template-columns:1fr!important}
  .student-simulator-toolbar,.simulator-toolbar{grid-template-columns:1fr!important}
  .student-simulator-map-card .curriculum-graph-viewport{min-height:430px}
  .curriculum-column{width:172px;flex-basis:172px}
  .student-simulator-cqes-map .cqes-simulator-column{width:166px;flex-basis:166px}
  .curriculum-node{padding:8px;border-radius:9px}
  .curriculum-node>span{font-size:.78rem}
  .curriculum-node small{font-size:.7rem}
  .calendar-timeline-viewport{min-height:430px;height:68vh;padding-left:6px;padding-right:6px}
  .calendar-day-dialog{padding:7px}
  .calendar-day-dialog-panel{padding:12px;border-radius:12px}
  .scroll-list,.tall-list{max-width:100%}
}

@media(max-width:380px){
  main.shell,main.shell.wide-shell{padding-left:6px;padding-right:6px}
  .topbar-brand{max-width:112px}
  .app-topbar nav{gap:3px}
  .app-topbar .topbar-action{min-width:32px;padding:5px 7px}
  .card{padding:11px}
  .side-navigation .student-tab,.side-navigation .tab{padding:6px 8px}
  .curriculum-column{width:158px;flex-basis:158px}
  .student-simulator-cqes-map .cqes-simulator-column{width:154px;flex-basis:154px}
}

/* PATCH 2026-08-12 - Calendario responsivo: 7 dias sempre visiveis em ecras estreitos */
@media (max-width:700px){
  .calendar-timeline-viewport{overflow-x:hidden!important;overflow-y:auto!important;padding-left:4px!important;padding-right:4px!important}
  .calendar-timeline-month{min-width:0!important;width:100%!important;margin-bottom:18px!important}
  .calendar-timeline-month .calendar-month-title{font-size:1rem!important;padding:9px 3px 7px!important}
  .calendar-timeline-month .calendar-weekdays{top:43px!important}
  .calendar-weekdays,.calendar-grid{min-width:0!important;width:100%!important;grid-template-columns:repeat(7,minmax(0,1fr))!important}
  .calendar-weekdays span{min-width:0!important;padding:6px 1px!important;font-size:.62rem!important;letter-spacing:0!important;white-space:nowrap!important}
  .calendar-timeline-month .calendar-day,.calendar-day{min-width:0!important;min-height:58px!important;padding:3px 2px!important;position:relative;cursor:pointer}
  .calendar-day-number{margin:0!important;text-align:center!important;font-size:.72rem!important;line-height:1.2!important}
  .calendar-timeline-month .calendar-day.today .calendar-day-number:after{display:none!important}
  .calendar-day .calendar-events{display:none!important}
  .calendar-day:has(.calendar-event-chip)::after{content:"";position:absolute;left:50%;bottom:7px;width:5px;height:5px;border-radius:50%;background:#38bdf8;transform:translateX(-50%)}
  html[data-theme="light"] .calendar-day:has(.calendar-event-chip)::after{background:#2563eb}
}
@media (max-width:420px){
  .calendar-timeline-viewport{padding-left:2px!important;padding-right:2px!important}
  .calendar-weekdays span{padding:5px 0!important;font-size:.54rem!important}
  .calendar-timeline-month .calendar-day,.calendar-day{min-height:50px!important;padding:2px 1px!important}
  .calendar-day-number{font-size:.66rem!important}
  .calendar-day:has(.calendar-event-chip)::after{bottom:5px;width:4px;height:4px}
}


/* 2026-08-12: no calendario compacto, uma avaliacao concreta prevalece na sinalizacao do dia. */
@media(max-width:700px){
  /* Evento criado pelo aluno prevalece sobre a sinalizacao azul dos eventos gerais. */
  .calendar-day.has-student-event::after{background:#f97316!important}
  html[data-theme="light"] .calendar-day.has-student-event::after{background:#ea580c!important}
  /* Avaliacao concreta continua a ter a prioridade visual maxima. */
  .calendar-day.has-evaluation::after{background:#ef4444!important}
  html[data-theme="light"] .calendar-day.has-evaluation::after{background:#dc2626!important}
}


/* PATCH 2026-08-12 - navegacao mobile recolhivel igual ao menu lateral de desktop */
@media(max-width:900px){
  .app-topbar .topbar-sidebar-toggle{display:grid!important;flex:0 0 38px;width:38px;height:38px;margin:0 8px 0 0}
  #studentArea>.student-tabs.side-navigation,
  #dashboard>.admin-tabs.side-navigation{
    position:fixed!important;
    left:0;
    top:64px;
    bottom:auto;
    width:min(248px,calc(100vw - 18px));
    max-height:calc(100dvh - 64px);
    min-height:0;
    z-index:30;
    display:flex;
    flex-direction:column;
    flex-wrap:nowrap;
    gap:6px;
    padding:12px 10px 16px;
    margin:0;
    overflow-y:auto;
    overflow-x:hidden;
    border-radius:0 0 16px 0;
    border-top:0;
    border-left:0;
    border-right:1px solid var(--atlas-border);
    border-bottom:1px solid var(--atlas-border);
    background:var(--atlas-surface-strong);
    box-shadow:12px 18px 34px rgba(2,6,23,.34);
  }
  #studentArea.nav-collapsed>.student-tabs.side-navigation,
  #dashboard.nav-collapsed>.admin-tabs.side-navigation{display:none!important}
  #studentArea:not(.nav-collapsed)>.student-tabs.side-navigation,
  #dashboard:not(.nav-collapsed)>.admin-tabs.side-navigation{display:flex!important}
  .student-tabs.side-navigation .student-tab,
  .admin-tabs.side-navigation .tab{
    width:100%;
    min-width:0;
    min-height:44px;
    justify-content:flex-start;
    padding:10px 12px;
    text-align:left;
    white-space:nowrap;
  }
  .student-tabs.side-navigation .side-nav-label,
  .admin-tabs.side-navigation .side-nav-label{display:inline!important;overflow:hidden;text-overflow:ellipsis}
  #studentArea.nav-collapsed .side-navigation .side-nav-label,
  #dashboard.nav-collapsed .side-navigation .side-nav-label{display:inline!important}
}
@media(max-width:700px){
  #studentArea>.student-tabs.side-navigation,
  #dashboard>.admin-tabs.side-navigation{top:58px;max-height:calc(100dvh - 58px)}
}
@media(max-width:520px){
  #studentArea>.student-tabs.side-navigation,
  #dashboard>.admin-tabs.side-navigation{top:54px;max-height:calc(100dvh - 54px)}
}
@media(max-width:480px){
  #studentArea>.student-tabs.side-navigation,
  #dashboard>.admin-tabs.side-navigation{width:min(232px,calc(100vw - 12px));top:54px;max-height:calc(100dvh - 54px)}
  .app-topbar .topbar-sidebar-toggle{width:36px;height:36px;flex-basis:36px}
}

/* PATCH 2026-08-12 - menu recolhivel mobile: opcoes sempre em lista vertical.
   Esta regra prevalece sobre a regra responsiva V2 que colocava os separadores em linha. */
@media(max-width:900px){
  #studentArea:not(.nav-collapsed)>.student-tabs.side-navigation,
  #dashboard:not(.nav-collapsed)>.admin-tabs.side-navigation{
    display:flex!important;
    flex-direction:column!important;
    flex-wrap:nowrap!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    align-items:stretch!important;
  }
  #studentArea:not(.nav-collapsed)>.student-tabs.side-navigation .student-tab,
  #dashboard:not(.nav-collapsed)>.admin-tabs.side-navigation .tab{
    display:flex!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    flex:0 0 auto!important;
    justify-content:flex-start!important;
    text-align:left!important;
  }
}

/* PATCH 2026-08-12 - Gestao Curricular em telemovel: conteudo adaptado ao viewport.
   Em desktop nada muda. Em ecras pequenos as inscricoes deixam de depender de uma
   tabela larga e os percursos anteriores deixam de impor largura minima horizontal. */
@media(max-width:640px){
  /* Inscricoes ativas: cada linha passa a cartao vertical legivel. */
  .curriculum-table-wrap{overflow-x:visible!important;margin-top:12px!important}
  .curriculum-table{display:block!important;min-width:0!important;width:100%!important;border:0!important}
  .curriculum-table thead{display:none!important}
  .curriculum-table tbody{display:grid!important;gap:10px!important;width:100%!important}
  .curriculum-table tbody tr{display:grid!important;grid-template-columns:1fr!important;width:100%!important;min-width:0!important;padding:10px 12px!important;border:1px solid var(--atlas-border)!important;border-radius:12px!important;background:var(--atlas-surface-soft)!important}
  .curriculum-table tbody td{display:grid!important;grid-template-columns:minmax(92px,34%) minmax(0,1fr)!important;gap:10px!important;align-items:start!important;width:100%!important;min-width:0!important;padding:7px 0!important;border:0!important;border-bottom:1px solid var(--atlas-border)!important;white-space:normal!important;overflow-wrap:anywhere!important}
  .curriculum-table tbody td:last-child{border-bottom:0!important}
  .curriculum-table tbody td::before{font-size:.69rem!important;font-weight:800!important;letter-spacing:.04em!important;text-transform:uppercase!important;color:var(--atlas-muted)!important}
  .curriculum-table tbody td:nth-child(1)::before{content:'Ano letivo'}
  .curriculum-table tbody td:nth-child(2)::before{content:'Tipo de curso'}
  .curriculum-table tbody td:nth-child(3)::before{content:'Plano curricular'}
  .curriculum-table tbody td:nth-child(4)::before{content:'Percurso'}
  .curriculum-table tbody td:nth-child(5)::before{content:'Ano'}
  .curriculum-table tbody td:nth-child(6)::before{content:'Semestre'}
  .curriculum-table tbody td:nth-child(7)::before{content:'Avaliação'}
  .curriculum-table tbody td:nth-child(8)::before{content:'UCs inscritas'}
  .curriculum-table tbody td:nth-child(9)::before{content:'Ações'}
  .curriculum-row-actions{white-space:normal!important;flex-wrap:wrap!important;justify-content:flex-start!important}

  /* Cabecalho da secao: texto e botao sem colisao. */
  .curriculum-management-head{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:12px!important}
  .curriculum-management-head>.button{align-self:center!important;max-width:100%!important}

  /* Percursos anteriores: deixam de criar uma area horizontal de 760px. */
  .curriculum-history-course{overflow:visible!important;max-width:100%!important;min-width:0!important}
  .curriculum-history-course>.curriculum-history-course-heading,
  .curriculum-history-course>.curriculum-history-collapsed-summary,
  .curriculum-history-course>.curriculum-history-course-details{min-width:0!important;width:100%!important;max-width:100%!important}
  .curriculum-history-course-heading{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:start!important;gap:10px!important;padding:12px!important}
  .curriculum-history-course-heading-main{min-width:0!important}
  .curriculum-history-course-title-row{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:7px!important;min-width:0!important;padding-right:0!important}
  .curriculum-history-course-title-row h3{flex:1 1 170px!important;min-width:0!important;margin:0!important;font-size:1rem!important;line-height:1.3!important;white-space:normal!important;overflow-wrap:anywhere!important}
  .curriculum-history-course-heading .muted{white-space:normal!important;overflow-wrap:anywhere!important;font-size:.78rem!important;line-height:1.35!important}
  .curriculum-history-course-toggle{position:static!important;align-self:start!important;min-width:72px!important;max-width:82px!important;padding:6px 8px!important;font-size:.78rem!important}
  .curriculum-history-collapsed-summary{display:grid!important;grid-template-columns:1fr!important;padding:0 12px 10px!important;gap:0!important;overflow:visible!important}
  .curriculum-history-compact-metric{min-width:0!important;width:100%!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;padding:8px 2px!important;border-right:0!important;border-bottom:1px solid var(--atlas-border)!important;white-space:normal!important}
  .curriculum-history-compact-metric:last-child{border-bottom:0!important}
  .curriculum-history-compact-metric span{min-width:0!important;white-space:normal!important}
  .curriculum-history-compact-metric strong{flex:0 0 auto!important;white-space:nowrap!important}
  .curriculum-history-course-details{overflow:hidden!important}
  .curriculum-history-course-actions{flex-wrap:wrap!important;gap:8px!important}
}

@media(max-width:380px){
  .curriculum-table tbody tr{padding:8px 10px!important}
  .curriculum-table tbody td{grid-template-columns:82px minmax(0,1fr)!important;gap:8px!important;font-size:.83rem!important}
  .curriculum-history-course-heading{grid-template-columns:1fr!important}
  .curriculum-history-course-toggle{justify-self:end!important}
}

/* PATCH 2026-08-12 - Gestao Curricular: detalhes dos percursos anteriores em telemovel.
   As tabelas de UCs expandidas passam a leitura vertical e deixam de cortar ECTS, nota,
   resultado e acoes fora do viewport. Desktop permanece inalterado. */
@media(max-width:640px){
  .curriculum-history-course-details{overflow:visible!important;padding:0 12px 12px!important}
  .curriculum-history-period-heading{flex-wrap:wrap!important;align-items:flex-start!important;padding:8px 2px!important;gap:8px!important}
  .curriculum-history-period-actions{flex-wrap:wrap!important}
  .curriculum-history-table-wrap{overflow:visible!important;width:100%!important;margin-top:4px!important}
  .curriculum-history-table{display:block!important;width:100%!important;min-width:0!important;table-layout:auto!important;border:0!important}
  .curriculum-history-table colgroup,.curriculum-history-table thead{display:none!important}
  .curriculum-history-table tbody{display:grid!important;width:100%!important;gap:10px!important}
  .curriculum-history-table tbody tr{display:grid!important;grid-template-columns:1fr!important;width:100%!important;min-width:0!important;padding:9px 11px!important;border:1px solid var(--atlas-border)!important;border-radius:11px!important;background:var(--atlas-surface-soft)!important}
  .curriculum-history-table tbody td{display:grid!important;grid-template-columns:minmax(92px,34%) minmax(0,1fr)!important;align-items:start!important;gap:9px!important;width:100%!important;min-width:0!important;padding:6px 0!important;border:0!important;border-bottom:1px solid var(--atlas-border)!important;text-align:left!important;white-space:normal!important;overflow-wrap:anywhere!important}
  .curriculum-history-table tbody td:last-child{border-bottom:0!important}
  .curriculum-history-table tbody td::before{font-size:.68rem!important;font-weight:800!important;letter-spacing:.04em!important;text-transform:uppercase!important;color:var(--atlas-muted)!important;text-align:left!important}
  .curriculum-history-table tbody td:nth-child(1)::before{content:'Código'}
  .curriculum-history-table tbody td:nth-child(2)::before{content:'Unidade curricular'}
  .curriculum-history-table tbody td:nth-child(3)::before{content:'ECTS'}
  .curriculum-history-table tbody td:nth-child(4)::before{content:'Nota final'}
  .curriculum-history-table tbody td:nth-child(5)::before{content:'Resultado'}
  .curriculum-history-table tbody td:nth-child(6)::before{content:'Ações'}
  .curriculum-history-table tbody td:nth-child(n+3){text-align:left!important}
  .curriculum-history-result{justify-self:start!important;min-width:0!important;max-width:100%!important}
  .curriculum-history-table tbody td:last-child .button-row,
  .curriculum-history-table tbody td:last-child{justify-content:start!important}
  .curriculum-history-course-actions{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:8px!important}
  .curriculum-history-course-actions .button,
  .curriculum-history-course-actions .danger{margin-left:0!important;width:100%!important;max-width:100%!important;justify-content:center!important}
}
@media(max-width:380px){
  .curriculum-history-course-details{padding-left:9px!important;padding-right:9px!important}
  .curriculum-history-table tbody tr{padding:8px 9px!important}
  .curriculum-history-table tbody td{grid-template-columns:84px minmax(0,1fr)!important;gap:7px!important;font-size:.82rem!important}
}

/* 2026-08-12 - Historico Academico / Cursos ja registados: detalhe responsivo mobile */
@media(max-width:700px){
  #academicHistoryCourses{min-width:0!important;max-width:100%!important;overflow:visible!important}
  #academicHistoryCourses>.item,
  #academicHistoryCourses .item{min-width:0!important;max-width:100%!important;overflow:hidden!important}
  #academicHistoryCourses details,
  #academicHistoryCourses summary,
  #academicHistoryCourses .curriculum-history-course,
  #academicHistoryCourses .curriculum-history-course-heading,
  #academicHistoryCourses .curriculum-history-course-details{min-width:0!important;width:100%!important;max-width:100%!important}
  #academicHistoryCourses summary{white-space:normal!important;overflow-wrap:anywhere!important}
  #academicHistoryCourses .table-wrap,
  #academicHistoryCourses .curriculum-history-table-wrap{overflow:visible!important;width:100%!important;max-width:100%!important}
  #academicHistoryCourses table{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;table-layout:auto!important;border:0!important}
  #academicHistoryCourses table colgroup,
  #academicHistoryCourses table thead{display:none!important}
  #academicHistoryCourses table tbody{display:grid!important;width:100%!important;gap:10px!important}
  #academicHistoryCourses table tbody tr{display:grid!important;grid-template-columns:1fr!important;width:100%!important;min-width:0!important;padding:9px 11px!important;border:1px solid var(--atlas-border)!important;border-radius:11px!important;background:var(--atlas-surface-soft)!important}
  #academicHistoryCourses table tbody td{display:grid!important;grid-template-columns:minmax(92px,34%) minmax(0,1fr)!important;align-items:start!important;gap:9px!important;width:100%!important;min-width:0!important;padding:6px 0!important;border:0!important;border-bottom:1px solid var(--atlas-border)!important;text-align:left!important;white-space:normal!important;overflow-wrap:anywhere!important}
  #academicHistoryCourses table tbody td:last-child{border-bottom:0!important}
  #academicHistoryCourses table tbody td::before{font-size:.68rem!important;font-weight:800!important;letter-spacing:.04em!important;text-transform:uppercase!important;color:var(--atlas-muted)!important;text-align:left!important}
  #academicHistoryCourses table tbody td:nth-child(1)::before{content:'Código'}
  #academicHistoryCourses table tbody td:nth-child(2)::before{content:'Unidade curricular'}
  #academicHistoryCourses table tbody td:nth-child(3)::before{content:'ECTS'}
  #academicHistoryCourses table tbody td:nth-child(4)::before{content:'Nota final'}
  #academicHistoryCourses table tbody td:nth-child(5)::before{content:'Resultado'}
  #academicHistoryCourses table tbody td:nth-child(6)::before{content:'Ações'}
  #academicHistoryCourses .button-row{display:flex!important;flex-wrap:wrap!important;gap:7px!important;max-width:100%!important}
  #academicHistoryCourses .button-row .button,
  #academicHistoryCourses .button-row button{max-width:100%!important}
}
@media(max-width:380px){
  #academicHistoryCourses table tbody tr{padding:8px 9px!important}
  #academicHistoryCourses table tbody td{grid-template-columns:84px minmax(0,1fr)!important;gap:7px!important;font-size:.82rem!important}
}

/* PATCH 2026-08-12 - Historico Academico / CQES: eliminar scroll horizontal dos detalhes em mobile */
@media(max-width:700px){
  #academicHistoryCourses .cqes-attempt,
  #academicHistoryCourses .cqes-attempt-details,
  #academicHistoryCourses .cqes-summary-line,
  #academicHistoryCourses .cqes-results-grid,
  #academicHistoryCourses .cqes-result,
  #academicHistoryCourses .cqes-result-head,
  #academicHistoryCourses .cqes-result label{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
  #academicHistoryCourses .cqes-attempt{width:100%!important;overflow:hidden!important}
  #academicHistoryCourses .cqes-attempt-details{width:100%!important;overflow:hidden!important}
  #academicHistoryCourses .cqes-summary-line{display:grid!important;grid-template-columns:1fr!important;gap:6px!important;width:100%!important}
  #academicHistoryCourses .cqes-results-grid{display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;overflow:visible!important;gap:10px!important;padding-bottom:0!important}
  #academicHistoryCourses .cqes-result{width:100%!important;min-width:0!important;padding:10px!important}
  #academicHistoryCourses .cqes-result-head{display:flex!important;flex-wrap:wrap!important;width:100%!important;gap:7px!important}
  #academicHistoryCourses .cqes-result-head>div{flex:1 1 160px!important;min-width:0!important}
  #academicHistoryCourses .cqes-result-head strong{white-space:normal!important;overflow-wrap:anywhere!important}
  #academicHistoryCourses .cqes-result label{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto!important;align-items:center!important;width:100%!important;gap:7px!important;white-space:normal!important}
  #academicHistoryCourses .cqes-result input.cqes-grade{grid-column:1/-1!important;width:100%!important;min-width:0!important;max-width:100%!important}
  #academicHistoryCourses .cqes-result .mini-button{min-width:0!important;max-width:100%!important;margin:0!important}
}
@media(max-width:380px){
  #academicHistoryCourses .cqes-result label{grid-template-columns:1fr 1fr!important}
  #academicHistoryCourses .cqes-result .mini-button{width:100%!important;justify-content:center!important}
}


/* FAQ — filtro por categorias 2026-08-13 */
.faq-category-filter{padding:0;overflow:hidden}
.faq-category-filter-summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 22px;cursor:pointer;list-style:none}
.faq-category-filter-summary::-webkit-details-marker{display:none}
.faq-category-filter-summary>span:first-child{display:flex;flex-direction:column;gap:4px;min-width:0}
.faq-category-filter-summary strong{font-size:1.05rem;color:var(--atlas-text-strong)}
.faq-category-filter-summary small{font-size:.82rem}
.faq-category-filter-chevron{font-size:1.25rem;transition:transform .18s ease;color:var(--atlas-muted)}
.faq-category-filter[open] .faq-category-filter-chevron{transform:rotate(180deg)}
.faq-category-filter-body{border-top:1px solid var(--atlas-border);padding:18px 22px 22px}
.faq-category-filter-toolbar{display:grid;grid-template-columns:minmax(240px,1fr) auto;gap:14px;align-items:end;margin-bottom:16px}
.faq-category-search{display:grid;gap:7px;min-width:0}
.faq-category-actions{justify-content:flex-end;flex-wrap:wrap}
.faq-category-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 12px;max-height:330px;overflow-y:auto;padding:2px 6px 2px 2px;scrollbar-gutter:stable}
.faq-category-option{display:flex;align-items:flex-start;gap:9px;min-width:0;padding:9px 10px;border:1px solid var(--atlas-border);border-radius:10px;background:color-mix(in srgb,var(--atlas-surface-soft) 84%,transparent);cursor:pointer;line-height:1.25}
.faq-category-option:hover{border-color:var(--atlas-border-strong);background:color-mix(in srgb,var(--atlas-accent) 8%,var(--atlas-surface-soft))}
.faq-category-option input{flex:0 0 auto;margin-top:2px}
.faq-category-option span{min-width:0;overflow-wrap:anywhere;color:var(--atlas-text)}
.faq-category-option[hidden]{display:none!important}
@media(max-width:1100px){.faq-category-options{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:780px){.faq-category-filter-summary{padding:16px}.faq-category-filter-body{padding:14px 16px 18px}.faq-category-filter-toolbar{grid-template-columns:1fr}.faq-category-actions{justify-content:flex-start}.faq-category-options{grid-template-columns:repeat(2,minmax(0,1fr));max-height:300px}}
@media(max-width:520px){.faq-category-options{grid-template-columns:1fr}.faq-category-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}.faq-category-actions .button{width:100%;padding-left:8px;padding-right:8px}.faq-category-filter-summary strong{font-size:1rem}}


/* FAQ — pesquisa e filtro lado a lado, sem métricas internas para o aluno (2026-08-13) */
.faq-tools-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;align-items:start;margin-bottom:18px}
.faq-tools-grid>.card{margin:0;min-width:0}
.faq-search-card{min-height:100%;display:flex;flex-direction:column;justify-content:flex-start}
.faq-search-card .form-grid{margin-top:8px}
.faq-tools-grid .faq-category-filter-summary{min-height:100%;box-sizing:border-box}
@media(max-width:780px){
  .faq-tools-grid{grid-template-columns:1fr;gap:12px;margin-bottom:14px}
  .faq-search-card,.faq-tools-grid .faq-category-filter{width:100%;max-width:100%}
}


/* PATCH 2026-08-13 - densidade reforcada do Dashboard e UCs Activas em desktop.
   Aplica-se apenas a ecras >=1200px; mobile/tablet pequeno mantem as regras existentes. */
@media(min-width:1200px){
  #studentArea>.student-panel{padding-top:22px;padding-bottom:36px}
  #dashboardPanel .dashboard-head,#activeUnitsPanel .dashboard-head{margin-bottom:12px}
  #dashboardPanel .dashboard-head h1,#activeUnitsPanel .dashboard-head h1{font-size:2rem;margin:.12em 0}
  #dashboardPanel .dashboard-head p,#activeUnitsPanel .dashboard-head p{margin-top:4px;margin-bottom:4px}
  #dashboardPanel .eyebrow,#activeUnitsPanel .eyebrow{margin-bottom:6px}

  #dashboardPanel .grid{gap:10px;margin-bottom:10px}
  #dashboardPanel .card{padding:12px 14px;border-radius:13px}
  #dashboardPanel .card h2{margin:0 0 7px;font-size:1.08rem;line-height:1.2}
  #dashboardPanel .card p{margin:.35rem 0;font-size:.86rem;line-height:1.3}
  #dashboardPanel .big-number{font-size:1.9rem;line-height:1;margin:.1rem 0 .25rem}
  #dashboardPanel .stack-list{gap:6px}
  #dashboardPanel .item{padding:7px 9px;border-radius:9px;font-size:.84rem;line-height:1.25}
  #dashboardPanel .item strong{margin-bottom:2px}
  #dashboardPanel .muted{font-size:.8rem}
  #dashboardPanel .button{padding:8px 12px;border-radius:9px;font-size:.82rem}

  #activeUnitsPanel .active-units-summary{margin-bottom:10px}
  #activeUnitsPanel .active-units-summary-card{padding:7px 11px;border-radius:10px;gap:7px}
  #activeUnitsPanel .active-units-summary-card strong{font-size:1.45rem;line-height:1}
  #activeUnitsPanel .active-units-summary-card span{font-size:.82rem}
  #activeUnitsPanel .active-units-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
  #activeUnitsPanel .active-unit-card{padding:11px 12px;border-radius:12px}
  #activeUnitsPanel .active-unit-head{gap:8px;padding-bottom:7px}
  #activeUnitsPanel .active-unit-head h2{margin:2px 0 2px;font-size:.92rem;line-height:1.18}
  #activeUnitsPanel .active-unit-code{font-size:.72rem}
  #activeUnitsPanel .active-unit-head .muted{margin:2px 0 0;font-size:.75rem}
  #activeUnitsPanel .active-unit-status{padding:3px 7px;font-size:.64rem}
  #activeUnitsPanel .active-unit-result{grid-template-columns:minmax(0,1fr) auto auto;gap:6px;padding:7px 0;font-size:.8rem}
  #activeUnitsPanel .active-unit-result>strong{font-size:1rem}
  #activeUnitsPanel .active-unit-events-head{gap:7px;padding:7px 0 5px;font-size:.8rem}
  #activeUnitsPanel .active-unit-events{gap:5px}
  #activeUnitsPanel .active-unit-event{gap:7px;padding:6px 8px;border-radius:8px;font-size:.75rem;line-height:1.2}
  #activeUnitsPanel .active-unit-event .muted{font-size:.7rem}
  #activeUnitsPanel .active-unit-empty{padding:4px 0 1px;font-size:.76rem}
  #activeUnitsPanel .mini-button{padding:4px 7px;border-radius:7px;font-size:.68rem}
  #activeUnitsPanel .button{padding:8px 12px;border-radius:9px;font-size:.82rem}
}

/* Em desktop intermédio (1001-1199px), manter 2 colunas mas reduzir altura dos cartões. */
@media(min-width:1001px) and (max-width:1199px){
  #activeUnitsPanel .active-units-grid{gap:12px}
  #activeUnitsPanel .active-unit-card{padding:13px 14px}
  #activeUnitsPanel .active-unit-head{padding-bottom:9px}
  #activeUnitsPanel .active-unit-result{padding:9px 0}
  #activeUnitsPanel .active-unit-events-head{padding:9px 0 6px}
}


/* Admin - simulador alinhado visualmente com o Simulador Curricular do Portal quando existe aluno selecionado. */
#curriculumGraph.student-portal-aligned{}
@media (min-width:721px){
  .simulator-main.student-simulator-map-card .curriculum-graph-viewport{min-height:430px;max-height:68vh}
  .simulator-main.student-simulator-map-card .curriculum-graph{padding:10px;min-height:410px}
}


/* RESTAURO 2026-08-13 v12 - reaplica exatamente a densidade e o layout de Utilizadores já aprovados antes da regressão v11. */
/* PATCH 2026-08-13 - densidade desktop uniforme em todo o Portal e BackOffice.
   Herda a escala aprovada no Dashboard/UCs Activas e aplica uma reducao ligeira
   a todos os restantes separadores apenas em desktop >=1200px.
   Tablet e telemovel ficam inalterados. */
@media(min-width:1200px){
  /* Estrutura geral e cabecalhos */
  #studentArea>.student-panel{padding-top:18px;padding-bottom:30px}
  #studentArea>.student-panel .dashboard-head,
  #dashboard>.dashboard-head{margin-bottom:10px;gap:14px}
  #studentArea>.student-panel .dashboard-head h1,
  #dashboard>.dashboard-head h1{font-size:1.85rem;line-height:1.08;margin:.1em 0}
  #studentArea>.student-panel .dashboard-head p,
  #dashboard>.dashboard-head p{font-size:.8rem;line-height:1.25;margin:3px 0}
  #studentArea>.student-panel .eyebrow,
  #dashboard>.dashboard-head .eyebrow{font-size:.68rem;margin-bottom:4px}

  /* Grelhas, cartoes e blocos comuns */
  #studentArea>.student-panel .grid,
  #dashboard>.tab-panel .grid{gap:10px;margin-bottom:10px}
  #studentArea>.student-panel .card,
  #dashboard>.tab-panel .card{padding:12px 14px;border-radius:12px}
  #studentArea>.student-panel .card h2,
  #dashboard>.tab-panel .card h2{font-size:1rem;line-height:1.16;margin:0 0 7px}
  #studentArea>.student-panel .card h3,
  #dashboard>.tab-panel .card h3{font-size:.9rem;line-height:1.18;margin-top:.35rem;margin-bottom:.35rem}
  #studentArea>.student-panel .card p,
  #dashboard>.tab-panel .card p{font-size:.81rem;line-height:1.28;margin:.3rem 0}
  #studentArea>.student-panel .stack-list,
  #dashboard>.tab-panel .stack-list{gap:6px}
  #studentArea>.student-panel .item,
  #dashboard>.tab-panel .item{padding:7px 9px;border-radius:9px;font-size:.79rem;line-height:1.22}
  #studentArea>.student-panel .item strong,
  #dashboard>.tab-panel .item strong{margin-bottom:2px}
  #studentArea>.student-panel .muted,
  #dashboard>.tab-panel .muted{font-size:.75rem;line-height:1.22}
  #studentArea>.student-panel .small,
  #dashboard>.tab-panel .small{font-size:.68rem}
  #studentArea>.student-panel .big-number,
  #dashboard>.tab-panel .big-number{font-size:1.72rem;line-height:1;margin:.08rem 0 .18rem}

  /* Formularios */
  #studentArea>.student-panel .form-grid,
  #dashboard>.tab-panel .form-grid{gap:11px}
  #studentArea>.student-panel .form-grid label,
  #dashboard>.tab-panel .form-grid label{gap:5px;font-size:.8rem;line-height:1.2}
  #studentArea>.student-panel .form-grid input,
  #studentArea>.student-panel .form-grid select,
  #studentArea>.student-panel .form-grid textarea,
  #studentArea>.student-panel .compact-input,
  #dashboard>.tab-panel .form-grid input,
  #dashboard>.tab-panel .form-grid select,
  #dashboard>.tab-panel .form-grid textarea,
  #dashboard>.tab-panel .compact-input{padding:8px 9px;border-radius:8px;font-size:.79rem;line-height:1.2}
  #studentArea>.student-panel textarea,
  #dashboard>.tab-panel textarea{min-height:72px}
  #studentArea>.student-panel .section-head,
  #dashboard>.tab-panel .section-head{gap:10px}
  #studentArea>.student-panel .section-head h2,
  #dashboard>.tab-panel .section-head h2{font-size:1rem;margin:.2rem 0}

  /* Botoes, badges e separadores */
  #studentArea>.student-panel .button,
  #dashboard>.tab-panel .button{padding:7px 10px;border-radius:8px;font-size:.78rem;line-height:1.15}
  #studentArea>.student-panel .mini-button,
  #dashboard>.tab-panel .mini-button{padding:4px 7px;border-radius:7px;font-size:.68rem;line-height:1.15}
  #studentArea>.student-panel .button-row,
  #dashboard>.tab-panel .button-row{gap:6px}
  #studentArea>.student-panel .badge,
  #dashboard>.tab-panel .badge{padding:2px 6px;font-size:.7rem}
  #studentArea>.student-panel .separator,
  #dashboard>.tab-panel .separator{margin:14px 0}

  /* Tabelas e listas administrativas */
  #studentArea>.student-panel .data-table th,
  #studentArea>.student-panel .data-table td,
  #dashboard>.tab-panel .data-table th,
  #dashboard>.tab-panel .data-table td{padding:8px 8px;line-height:1.2}
  #studentArea>.student-panel .data-table th,
  #dashboard>.tab-panel .data-table th{font-size:.72rem}
  #studentArea>.student-panel .data-table td,
  #dashboard>.tab-panel .data-table td{font-size:.77rem}
  #dashboard>.tab-panel .scroll-list{max-height:500px}
  #dashboard>.tab-panel .tall-list{max-height:700px}

  /* Separadores e navegacao lateral desktop */
  #studentArea>.student-tabs,
  #dashboard>.admin-tabs{padding:14px 9px}
  #studentArea>.student-tabs .student-tab,
  #dashboard>.admin-tabs .tab{padding:8px 10px;font-size:.78rem;border-radius:8px}
  #studentArea>.student-tabs .side-nav-label,
  #dashboard>.admin-tabs .side-nav-label{font-size:.78rem}

  /* BackOffice: cabecalho e conteudo principal */
  #dashboard>.dashboard-head{padding-top:24px}
  #dashboard>.tab-panel{padding-bottom:40px}
  #dashboard>.tab-panel>h2{font-size:1.08rem;line-height:1.15;margin-top:.35rem;margin-bottom:.55rem}
  #dashboard>.tab-panel>p{font-size:.81rem;line-height:1.28}
  #dashboard>.tab-panel .admin-grid{gap:12px}
  #dashboard>.tab-panel .simulator-toolbar{gap:10px;margin:12px 0}
  #dashboard>.tab-panel .simulator-layout{gap:12px}
  #dashboard>.tab-panel .simulator-legend{gap:7px;font-size:.76rem}
  #dashboard>.tab-panel .curriculum-graph{padding:13px}
  #dashboard>.tab-panel .curriculum-columns{gap:18px}
  #dashboard>.tab-panel .curriculum-column>h3{margin-bottom:8px;padding:6px 8px;font-size:.8rem}
  #dashboard>.tab-panel .curriculum-column-body{gap:8px}
  #dashboard>.tab-panel .curriculum-node{padding:8px;border-radius:9px}
  #dashboard>.tab-panel .curriculum-node>span{font-size:.76rem}
  #dashboard>.tab-panel .curriculum-node small{font-size:.7rem;margin-top:4px}

  /* Calendario, FAQ, documentacao e blocos expansivos */
  #studentArea>.student-panel details,
  #dashboard>.tab-panel details{font-size:.8rem}
  #studentArea>.student-panel summary,
  #dashboard>.tab-panel summary{line-height:1.22}
  #studentArea>.student-panel .faq-category-filter-summary,
  #dashboard>.tab-panel .faq-category-filter-summary{padding:13px 15px}
  #studentArea>.student-panel .faq-category-filter-body,
  #dashboard>.tab-panel .faq-category-filter-body{padding:12px 15px 15px}
  #studentArea>.student-panel .faq-category-options,
  #dashboard>.tab-panel .faq-category-options{gap:6px 8px}
  #studentArea>.student-panel .faq-category-option,
  #dashboard>.tab-panel .faq-category-option{padding:7px 8px;border-radius:8px;font-size:.76rem}
  #studentArea>.student-panel .faq-tools-grid,
  #dashboard>.tab-panel .faq-tools-grid{gap:12px;margin-bottom:12px}

  /* Dialogos usados no Portal */
  #studentArea dialog .card,
  #dashboard dialog .card{padding:14px 16px;border-radius:12px}
  #studentArea dialog h2,
  #dashboard dialog h2{font-size:1.05rem}
}

/* PATCH 2026-08-13 - uniformizacao da densidade dos controlos que ficaram fora da escala aprovada.
   Referencia visual: campos do Historico Academico do Portal.
   Apenas desktop >=1200px; tablet/telemovel permanecem inalterados. */
@media(min-width:1200px){
  /* Portal do Aluno - Simulador Curricular */
  #simulatorPanel .student-simulator-toolbar label{
    gap:5px!important;
    font-size:.8rem!important;
    line-height:1.2!important;
  }
  #simulatorPanel .student-simulator-toolbar select,
  #simulatorPanel .student-simulator-toolbar input:not([type="checkbox"]):not([type="radio"]){
    min-height:38px!important;
    padding:7px 34px 7px 9px!important;
    border-radius:8px!important;
    font-size:.79rem!important;
    line-height:1.2!important;
  }
  #simulatorPanel .student-simulator-toolbar select{
    background-position:right 9px center!important;
    background-size:14px!important;
  }

  /* BackOffice - Percursos dos Alunos */
  #dashboard .admin-student-picker label,
  #dashboard [data-panel="student-paths"] .form-grid label{
    gap:5px!important;
    font-size:.8rem!important;
    line-height:1.2!important;
  }
  #dashboard .admin-student-picker select,
  #dashboard .admin-student-picker input:not([type="checkbox"]):not([type="radio"]),
  #dashboard [data-panel="student-paths"] .form-grid select,
  #dashboard [data-panel="student-paths"] .form-grid input:not([type="checkbox"]):not([type="radio"]),
  #dashboard [data-panel="student-paths"] .form-grid textarea{
    min-height:38px!important;
    padding:7px 9px!important;
    border-radius:8px!important;
    font-size:.79rem!important;
    line-height:1.2!important;
  }
  #dashboard .admin-student-picker select,
  #dashboard [data-panel="student-paths"] .form-grid select{
    padding-right:34px!important;
    background-position:right 9px center!important;
    background-size:14px!important;
  }
  #dashboard [data-panel="student-paths"] .form-grid textarea{min-height:64px!important}

  /* BackOffice - Simulador e Validador Curricular */
  #dashboard [data-panel="simulator"] .simulator-toolbar label{
    gap:5px!important;
    font-size:.8rem!important;
    line-height:1.2!important;
  }
  #dashboard [data-panel="simulator"] .simulator-toolbar select,
  #dashboard [data-panel="simulator"] .simulator-toolbar input:not([type="checkbox"]):not([type="radio"]){
    min-height:38px!important;
    padding:7px 34px 7px 9px!important;
    border-radius:8px!important;
    font-size:.79rem!important;
    line-height:1.2!important;
  }
  #dashboard [data-panel="simulator"] .simulator-toolbar select{
    background-position:right 9px center!important;
    background-size:14px!important;
  }

  /* BackOffice - Documentos: filtros e formulario de criacao/edicao */
  #dashboard [data-panel="documents"] .documents-admin-toolbar label,
  #dashboard [data-panel="documents"] .document-admin-form label,
  #dashboard [data-panel="documents"] #documentForm label{
    gap:5px!important;
    font-size:.8rem!important;
    line-height:1.2!important;
  }
  #dashboard [data-panel="documents"] .documents-admin-toolbar input,
  #dashboard [data-panel="documents"] .documents-admin-toolbar select,
  #dashboard [data-panel="documents"] #documentForm input:not([type="checkbox"]):not([type="radio"]),
  #dashboard [data-panel="documents"] #documentForm select,
  #dashboard [data-panel="documents"] #documentForm textarea{
    min-height:38px!important;
    padding:7px 9px!important;
    border-radius:8px!important;
    font-size:.79rem!important;
    line-height:1.2!important;
  }
  #dashboard [data-panel="documents"] .documents-admin-toolbar select,
  #dashboard [data-panel="documents"] #documentForm select{
    padding-right:34px!important;
    background-position:right 9px center!important;
    background-size:14px!important;
  }
  #dashboard [data-panel="documents"] #documentForm textarea{min-height:64px!important}
  #dashboard [data-panel="documents"] .documents-admin-toolbar{gap:10px!important}
}

/* PATCH 2026-08-13 - Admin > Utilizadores sem scroll horizontal em qualquer largura.
   A grelha adapta-se ao espaco disponivel; em ecras estreitos cada utilizador passa a cartao vertical. */
#dashboard [data-panel="users"] .table-wrap{
  width:100%;
  max-width:100%;
  overflow-x:hidden!important;
}
#dashboard [data-panel="users"] .data-table{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  table-layout:fixed;
}
#dashboard [data-panel="users"] .data-table th,
#dashboard [data-panel="users"] .data-table td{
  min-width:0;
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:break-word;
  white-space:normal;
}
#dashboard [data-panel="users"] .data-table th:nth-child(1),
#dashboard [data-panel="users"] .data-table td:nth-child(1){width:31%}
#dashboard [data-panel="users"] .data-table th:nth-child(2),
#dashboard [data-panel="users"] .data-table td:nth-child(2){width:27%}
#dashboard [data-panel="users"] .data-table th:nth-child(3),
#dashboard [data-panel="users"] .data-table td:nth-child(3){width:15%}
#dashboard [data-panel="users"] .data-table th:nth-child(4),
#dashboard [data-panel="users"] .data-table td:nth-child(4){width:10%}
#dashboard [data-panel="users"] .data-table th:nth-child(5),
#dashboard [data-panel="users"] .data-table td:nth-child(5){width:17%}
#dashboard [data-panel="users"] .actions-cell{
  min-width:0;
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
}
#dashboard [data-panel="users"] .actions-cell .mini-button{
  max-width:100%;
  white-space:normal;
}

@media(max-width:700px){
  #dashboard [data-panel="users"] .table-wrap{overflow:visible!important}
  #dashboard [data-panel="users"] .data-table,
  #dashboard [data-panel="users"] .data-table tbody,
  #dashboard [data-panel="users"] .data-table tr,
  #dashboard [data-panel="users"] .data-table td{display:block;width:100%!important;max-width:100%!important}
  #dashboard [data-panel="users"] .data-table thead{display:none}
  #dashboard [data-panel="users"] .data-table tbody{display:grid;gap:10px}
  #dashboard [data-panel="users"] .data-table tr{
    border:1px solid var(--atlas-border,#1e293b);
    border-radius:10px;
    padding:8px 10px;
    background:var(--atlas-surface,#0f172a);
  }
  #dashboard [data-panel="users"] .data-table td{
    position:relative;
    border-bottom:1px solid var(--atlas-border,#1e293b);
    padding:7px 0 7px 7.8rem!important;
    min-height:30px;
  }
  #dashboard [data-panel="users"] .data-table td:last-child{border-bottom:0}
  #dashboard [data-panel="users"] .data-table td::before{
    position:absolute;
    left:0;
    top:7px;
    width:7.1rem;
    color:var(--atlas-accent-soft,#93c5fd);
    font-size:.68rem;
    line-height:1.2;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.045em;
  }
  #dashboard [data-panel="users"] .data-table td:nth-child(1)::before{content:"Nome"}
  #dashboard [data-panel="users"] .data-table td:nth-child(2)::before{content:"Email"}
  #dashboard [data-panel="users"] .data-table td:nth-child(3)::before{content:"Perfis"}
  #dashboard [data-panel="users"] .data-table td:nth-child(4)::before{content:"Estado"}
  #dashboard [data-panel="users"] .data-table td:nth-child(5)::before{content:"Acoes"}
  #dashboard [data-panel="users"] .actions-cell{display:flex!important;gap:5px!important;padding-left:7.8rem!important}
}

@media(max-width:430px){
  #dashboard [data-panel="users"] .data-table td{padding-left:0!important;padding-top:25px!important}
  #dashboard [data-panel="users"] .data-table td::before{top:6px;width:auto}
  #dashboard [data-panel="users"] .actions-cell{padding-left:0!important;padding-top:25px!important}
}

/* PATCH 2026-08-13 v6 - Admin > Utilizadores: grelha legivel sem scroll horizontal.
   Em larguras onde a tabela e o formulario lateral competiam pelo espaco, o formulario
   passa para baixo da listagem. Em mobile mantem-se a apresentacao em cartoes. */
#dashboard [data-panel="users"] .admin-grid{
  min-width:0;
}
#dashboard [data-panel="users"] .admin-grid > .card{
  min-width:0;
}
#dashboard [data-panel="users"] .data-table th,
#dashboard [data-panel="users"] .data-table td{
  word-break:normal!important;
  overflow-wrap:break-word!important;
}
#dashboard [data-panel="users"] .data-table th:nth-child(1),
#dashboard [data-panel="users"] .data-table td:nth-child(1){width:30%}
#dashboard [data-panel="users"] .data-table th:nth-child(2),
#dashboard [data-panel="users"] .data-table td:nth-child(2){width:29%}
#dashboard [data-panel="users"] .data-table th:nth-child(3),
#dashboard [data-panel="users"] .data-table td:nth-child(3){width:15%}
#dashboard [data-panel="users"] .data-table th:nth-child(4),
#dashboard [data-panel="users"] .data-table td:nth-child(4){width:10%}
#dashboard [data-panel="users"] .data-table th:nth-child(5),
#dashboard [data-panel="users"] .data-table td:nth-child(5){width:16%}
#dashboard [data-panel="users"] .actions-cell{
  gap:6px!important;
  flex-direction:row!important;
  flex-wrap:wrap!important;
  align-items:center!important;
}
#dashboard [data-panel="users"] .actions-cell .mini-button{
  width:auto!important;
  max-width:none!important;
  min-width:max-content!important;
  white-space:nowrap!important;
  word-break:normal!important;
  overflow-wrap:normal!important;
  padding-left:8px!important;
  padding-right:8px!important;
}

/* A 1118 px, como no caso reportado, a listagem ganha toda a largura disponivel.
   Evita comprimir Nome/Email/Acoes para colunas ilegíveis. */
@media (max-width:1399px) and (min-width:701px){
  #dashboard [data-panel="users"] .admin-grid{
    grid-template-columns:minmax(0,1fr)!important;
  }
  #dashboard [data-panel="users"] .side-form{
    width:100%;
    max-width:none;
  }
  #dashboard [data-panel="users"] .data-table{
    font-size:.78rem;
  }
  #dashboard [data-panel="users"] .data-table th,
  #dashboard [data-panel="users"] .data-table td{
    padding-left:8px!important;
    padding-right:8px!important;
  }
}

@media (min-width:1400px){
  #dashboard [data-panel="users"] .admin-grid{
    grid-template-columns:minmax(0,2.2fr) minmax(300px,.9fr)!important;
  }
}

/* PATCH 2026-08-13 v8 - Admin > Utilizadores: formularios separados.
   A listagem usa sempre a largura disponivel; Criar e Editar sao cartoes independentes.
   Quando existe largura suficiente, os dois formularios ficam lado a lado. */
#dashboard [data-panel="users"] .admin-grid{
  grid-template-columns:minmax(0,1fr)!important;
}
#dashboard [data-panel="users"] .user-form-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:14px;
  width:100%;
  min-width:0;
}
#dashboard [data-panel="users"] .user-form-card{
  min-width:0;
  width:100%;
}
#dashboard [data-panel="users"] .user-form-card .form-grid{
  min-width:0;
}
#dashboard [data-panel="users"] .user-password-form{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--atlas-border,#1e293b);
}

@media (min-width:900px){
  #dashboard [data-panel="users"] .user-form-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:start;
  }
}

@media (max-width:700px){
  #dashboard [data-panel="users"] .user-form-grid{
    gap:10px;
  }
}

/* Gestao Curricular: percursos anteriores expandem pelo cabecalho completo, sem botao Mostrar. */
#studentPreviousAcademicCourses .curriculum-history-course-click-toggle{cursor:pointer!important;user-select:none!important}
#studentPreviousAcademicCourses .curriculum-history-course-click-toggle:focus-visible{outline:2px solid #60a5fa!important;outline-offset:-2px!important}
#studentPreviousAcademicCourses .curriculum-history-course-click-toggle>.curriculum-history-course-toggle-icon{flex:0 0 auto!important;margin-left:10px!important;color:#60a5fa!important}
#studentPreviousAcademicCourses .curriculum-history-course-click-toggle[aria-expanded="true"]>.curriculum-history-course-toggle-icon{transform:rotate(180deg)!important}
#studentPreviousAcademicCourses .curriculum-history-course.is-completed>.curriculum-history-course-click-toggle>.curriculum-history-course-toggle-icon{color:#22c55e!important}


/* Admin - Percursos dos Alunos: densidade e leitura final da situacao atual/historico - 2026-08-14 */
#dashboard [data-panel="student-paths"]{display:grid;gap:12px}
#dashboard [data-panel="student-paths"][hidden]{display:none!important}
#dashboard [data-panel="student-paths"]>.card,
#dashboard [data-panel="student-paths"] .admin-student-edit-grid>.card,
#dashboard [data-panel="student-paths"] .admin-student-status-section>.card{margin:0}
#dashboard [data-panel="student-paths"] .admin-student-history-shell{margin-bottom:0}
#dashboard [data-panel="student-paths"] .admin-student-edit-grid{margin-top:0;gap:12px;align-items:start}
#dashboard [data-panel="student-paths"] .admin-advanced-tools{grid-column:1/-1}
#dashboard [data-panel="student-paths"] .admin-student-status-section{display:grid;gap:12px;margin-top:0}
#dashboard [data-panel="student-paths"] .admin-student-status-head{margin-bottom:10px}
#dashboard [data-panel="student-paths"] .admin-student-current-card,
#dashboard [data-panel="student-paths"] .admin-student-past-card{min-width:0}
#dashboard [data-panel="student-paths"] .admin-history-course-toggle{cursor:pointer;user-select:none}
#dashboard [data-panel="student-paths"] .admin-history-course-toggle:focus-visible{outline:2px solid var(--atlas-focus);outline-offset:-2px}
#dashboard [data-panel="student-paths"] .admin-history-course-toggle>.curriculum-history-course-toggle-icon{flex:0 0 auto;margin-left:10px;color:#60a5fa;transition:transform .15s ease}
#dashboard [data-panel="student-paths"] .admin-history-course-toggle[aria-expanded="true"]>.curriculum-history-course-toggle-icon{transform:rotate(180deg)}
@media(min-width:1101px){
  #dashboard [data-panel="student-paths"] .admin-student-edit-grid{grid-template-columns:minmax(0,.92fr) minmax(0,1.38fr)}
  #dashboard [data-panel="student-paths"] .card{padding:14px 16px}
  #dashboard [data-panel="student-paths"] .section-head{margin-bottom:8px}
  #dashboard [data-panel="student-paths"] h2{margin-bottom:3px}
  #dashboard [data-panel="student-paths"] .form-grid{gap:9px}
  #dashboard [data-panel="student-paths"] .admin-history-filter-form{gap:9px}
  #dashboard [data-panel="student-paths"] .admin-history-semester-units{gap:9px}
  #dashboard [data-panel="student-paths"] .admin-semester-uc-section{padding:10px 12px}
  #dashboard [data-panel="student-paths"] .admin-semester-uc-row{padding:7px 0;gap:9px;grid-template-columns:minmax(250px,1fr) 105px 135px}
  #dashboard [data-panel="student-paths"] .admin-academic-support-grid{gap:9px;margin-top:9px}
  #dashboard [data-panel="student-paths"] .curriculum-history-course-heading{padding:11px 13px!important}
  #dashboard [data-panel="student-paths"] .curriculum-history-collapsed-summary{padding:0 13px 9px!important}
  #dashboard [data-panel="student-paths"] .curriculum-history-course-details{padding:0 13px 12px!important}
}
@media(max-width:1100px){
  #dashboard [data-panel="student-paths"] .admin-student-edit-grid{grid-template-columns:1fr}
  #dashboard [data-panel="student-paths"] .admin-advanced-tools{grid-column:auto}
}


/* Admin - Percursos dos Alunos: edicao inline da Nota Final e expandir/recolher - 2026-08-14 */
#dashboard [data-panel="student-paths"] .admin-history-grade-editor{display:grid;grid-template-columns:minmax(58px,76px) auto;gap:6px;align-items:center;min-width:0}
#dashboard [data-panel="student-paths"] .admin-history-grade-editor input{width:100%;min-width:0;min-height:30px!important;padding:5px 7px!important;font-size:.74rem!important;text-align:center}
#dashboard [data-panel="student-paths"] .admin-history-grade-save{min-height:30px!important;padding:5px 8px!important;font-size:.7rem!important;white-space:nowrap}
#dashboard [data-panel="student-paths"] .curriculum-history-course-toggle-icon{min-width:16px;text-align:center}
@media(max-width:700px){
  #dashboard [data-panel="student-paths"] .admin-history-grade-editor{grid-template-columns:minmax(54px,68px) auto}
}

/* 2026-08-15 - Portal/Calendario: exportacao iCalendar sem alterar os restantes controlos. */
#calendarPanel .calendar-nav-actions{flex-wrap:wrap;justify-content:flex-end}
#calendarPanel #studentCalendarExportScope{width:auto;min-width:172px}
@media(max-width:700px){
  #calendarPanel .calendar-nav-actions{width:100%;justify-content:flex-start}
  #calendarPanel #studentCalendarExportScope{flex:1 1 190px;min-width:0}
}

/* 2026-08-17 - Plano de Estudo semanal do aluno */
.study-availability-settings{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(150px,.65fr) minmax(170px,.65fr);gap:14px;align-items:end}.study-availability-settings>label{display:grid;gap:7px;color:#cbd5e1}.study-availability-settings input[type="time"],.study-availability-settings input[type="number"]{width:100%;border:1px solid #334155;background:#020617;color:#f8fafc;padding:10px;border-radius:10px;font:inherit}.study-days-fieldset{border:0;padding:0;margin:0;min-width:0}.study-days-fieldset legend{margin-bottom:7px;color:#cbd5e1}.study-days-options{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}.study-days-options label{display:flex;align-items:center;justify-content:center;gap:5px;border:1px solid #334155;border-radius:9px;background:#02061788;padding:9px 5px;cursor:pointer;font-size:.84rem}.study-days-options label:has(input:checked){border-color:#14b8a6;background:#0f766e33}.study-days-options input{accent-color:#14b8a6}.calendar-day-head{display:flex;align-items:center;justify-content:space-between;gap:4px;margin-bottom:6px}.calendar-day-head .calendar-day-number{margin-bottom:0}.calendar-study-week{border:1px solid #0f766e;background:#0f766e22;color:#99f6e4;border-radius:6px;padding:2px 5px;font-size:.58rem;line-height:1.2;cursor:pointer;white-space:nowrap}.calendar-study-week:hover{background:#0f766e44}.study-plan-dialog-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(250px,.65fr);gap:16px}.study-plan-dialog-grid h3{margin:0 0 10px}.study-plan-unit-list{display:grid;gap:7px;max-height:320px;overflow:auto}.study-plan-unit-option{display:flex;align-items:flex-start;gap:9px;padding:9px 10px;border:1px solid #334155;border-radius:10px;background:#02061788;cursor:pointer}.study-plan-unit-option:has(input:checked){border-color:#14b8a6;background:#0f766e22}.study-plan-unit-option span{display:grid;gap:2px}.study-plan-unit-option small{color:#94a3b8}.study-plan-availability{display:grid;gap:8px}html[data-theme="light"] .study-availability-settings>label,html[data-theme="light"] .study-days-fieldset legend{color:#475569}html[data-theme="light"] .study-availability-settings input[type="time"],html[data-theme="light"] .study-availability-settings input[type="number"],html[data-theme="light"] .study-days-options label,html[data-theme="light"] .study-plan-unit-option{background:#fff;color:#0f172a;border-color:#cbd5e1}html[data-theme="light"] .study-days-options label:has(input:checked),html[data-theme="light"] .study-plan-unit-option:has(input:checked){background:#ccfbf1;border-color:#0f766e}
@media(max-width:900px){.study-availability-settings{grid-template-columns:1fr 1fr}.study-days-fieldset{grid-column:1/-1}.study-plan-dialog-grid{grid-template-columns:1fr}}
@media(max-width:700px){.study-availability-settings{grid-template-columns:1fr}.study-days-fieldset{grid-column:auto}.study-days-options{grid-template-columns:repeat(4,minmax(0,1fr))}.calendar-study-week{font-size:0;width:20px;height:20px;padding:0}.calendar-study-week:after{content:'+';font-size:.75rem;font-weight:800}.study-plan-unit-list{max-height:250px}}

/* PATCH 2026-08-17 - Home publica e Simulador Curricular sem autenticacao */
.home-landing{width:min(1180px,calc(100% - 32px));margin:0 auto;padding:28px 0 56px}.home-public-panel[hidden]{display:none!important}.home-public-nav{display:flex;gap:8px}.home-hero{max-width:850px;margin:16px auto 36px;text-align:center}.home-hero-lead{max-width:760px;margin:14px auto 0;color:var(--atlas-muted);font-size:1.02rem;line-height:1.7}.home-hero .actions{justify-content:center;margin-top:22px}.home-public-section,.home-how-section{margin-top:28px}.home-section-heading{text-align:center;max-width:760px;margin:0 auto 22px}.home-section-heading h2{margin:4px 0 8px}.home-section-heading>p:last-child{color:var(--atlas-muted)}.home-feature-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}.home-feature-card{min-width:0;padding:18px;border:1px solid var(--atlas-border);border-radius:16px;background:var(--atlas-surface-soft);box-shadow:var(--atlas-shadow)}.home-feature-card h3{margin:12px 0 8px;font-size:1rem}.home-feature-card p{margin:0;color:var(--atlas-muted);font-size:.9rem;line-height:1.55}.home-feature-icon{display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--atlas-border-strong);border-radius:11px;background:var(--atlas-surface-strong);color:var(--atlas-accent-soft);font-weight:900}.home-how-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.home-how-step{display:flex;gap:14px;align-items:flex-start;padding:18px;border:1px solid var(--atlas-border);border-radius:16px;background:var(--atlas-surface-soft)}.home-how-step>span{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border-radius:999px;background:var(--atlas-accent);color:#fff;font-weight:900}.home-how-step h3{margin:2px 0 6px;font-size:1rem}.home-how-step p{margin:0;color:var(--atlas-muted);font-size:.9rem}.home-final-action{text-align:center;margin-top:24px;padding:22px;border:1px solid var(--atlas-border);border-radius:16px;background:var(--atlas-surface-soft)}.home-final-action p{margin:0 0 12px;color:var(--atlas-muted)}
.home-simulator-panel{padding-top:18px}.home-simulator-toolbar{display:grid;grid-template-columns:repeat(2,minmax(220px,360px));gap:14px;justify-content:center;margin:10px auto 18px}.home-simulator-toolbar label{display:grid;gap:7px;font-weight:800}.home-simulator-toolbar select{width:100%}.home-simulator-panel>.message{min-height:20px;text-align:center;margin:0 0 10px}.home-public-graph-viewport{min-height:620px;max-height:74vh;scrollbar-gutter:stable}.home-public-graph-viewport .curriculum-graph{min-height:600px}.home-public-graph-viewport .curriculum-node{cursor:default}.home-public-graph-viewport .curriculum-node:hover,.home-public-graph-viewport .curriculum-node:focus{outline:none}.home-public-graph-viewport .student-simulator-required{border-color:#2563eb;border-left-color:#3b82f6;background:linear-gradient(135deg,color-mix(in srgb,#2563eb 24%,var(--atlas-surface-solid)),color-mix(in srgb,#3b82f6 10%,var(--atlas-surface-solid)))}.home-public-graph-viewport .student-simulator-optional{border-color:#7e22ce;border-left-color:#a855f7;background:linear-gradient(135deg,color-mix(in srgb,#7e22ce 24%,var(--atlas-surface-solid)),color-mix(in srgb,#a855f7 10%,var(--atlas-surface-solid)))}
@media(max-width:1050px){.home-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.home-feature-card:last-child{grid-column:1/-1}.home-public-graph-viewport{min-height:540px}}
@media(max-width:720px){.home-landing{width:min(100% - 20px,1180px);padding-top:18px}.home-topbar{align-items:center;gap:10px;flex-wrap:wrap}.home-public-nav{width:100%;order:2}.home-public-nav .topbar-action{flex:1;justify-content:center}.home-feature-grid,.home-how-grid,.home-simulator-toolbar{grid-template-columns:1fr}.home-feature-card:last-child{grid-column:auto}.home-public-graph-viewport{min-height:480px}.home-hero{margin-top:4px}}

/* PATCH 2026-08-17 - Home / Simulador Curricular publico: mapa a toda a largura e scroll interno */
.home-simulator-panel .home-public-graph-viewport{
  width:calc(100vw - 32px);
  max-width:none;
  margin-left:calc(50% - 50vw + 16px);
  margin-right:calc(50% - 50vw + 16px);
  overflow:auto;
  overflow-x:auto;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-gutter:stable both-edges;
}
.home-simulator-panel .home-public-graph-viewport .curriculum-graph{
  width:max-content;
  min-width:100%;
}
@media(max-width:720px){
  .home-simulator-panel .home-public-graph-viewport{
    width:calc(100vw - 12px);
    margin-left:calc(50% - 50vw + 6px);
    margin-right:calc(50% - 50vw + 6px);
  }
}

/* BackOffice - Comunicacao */
#dashboard [data-panel="communication"] .communication-grid{align-items:start}
#dashboard [data-panel="communication"] textarea{min-height:190px;resize:vertical}
#dashboard [data-panel="communication"] select[multiple]{min-height:220px;padding:8px}
#dashboard [data-panel="communication"] .notice{margin-top:18px}
@media (max-width:900px){#dashboard [data-panel="communication"] .communication-grid{grid-template-columns:1fr}}

/* Auditoria avancada: detalhe em modal */
.audit-detail-dialog{width:min(920px,calc(100vw - 2rem));max-height:calc(100vh - 2rem);border:1px solid var(--atlas-border-strong);border-radius:18px;padding:0;color:var(--atlas-text);background:var(--atlas-surface-solid);box-shadow:0 24px 80px rgba(0,0,0,.55)}
.audit-detail-dialog::backdrop{background:rgba(2,6,23,.78);backdrop-filter:blur(3px)}
.audit-detail-shell{margin:0;padding:20px;display:grid;gap:16px}
.audit-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}
.audit-detail-head h2{margin:.2rem 0 .25rem}
.audit-detail-content{display:grid;gap:12px;max-height:62vh;overflow:auto;padding-right:4px}
.audit-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.audit-detail-field,.audit-detail-block{border:1px solid var(--atlas-border);border-radius:12px;background:var(--atlas-surface-soft);padding:12px}
.audit-detail-field{display:grid;gap:5px;min-width:0}
.audit-detail-field span{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--atlas-muted)}
.audit-detail-field strong{overflow-wrap:anywhere}
.audit-detail-block{display:grid;gap:8px}
.audit-detail-block pre{margin:0;max-height:220px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;font-size:.88rem;line-height:1.45;color:var(--atlas-muted)}
.audit-detail-actions{justify-content:flex-end}
@media(max-width:700px){.audit-detail-dialog{width:calc(100vw - 1rem);max-height:94vh}.audit-detail-shell{padding:14px}.audit-detail-grid{grid-template-columns:1fr}}

/* Admin > Utilizadores: diagnostico de prontidao e correcao segura */
.user-health-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.user-health-toolbar .compact-input{min-width:min(320px,70vw)}
.user-health-inline{margin-top:6px}
.badge.user-health-ok{background:rgba(34,197,94,.14);border-color:rgba(34,197,94,.35);color:#86efac}
.badge.user-health-aviso{background:rgba(245,158,11,.14);border-color:rgba(245,158,11,.35);color:#fcd34d}
.badge.user-health-erro{background:rgba(239,68,68,.14);border-color:rgba(239,68,68,.35);color:#fca5a5}
.user-health-content{display:grid;gap:10px}
.user-health-item{border:1px solid var(--atlas-border);border-radius:12px;background:var(--atlas-surface-soft);padding:12px;display:grid;gap:6px}
.user-health-item-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.user-health-item p{margin:0;color:var(--atlas-muted);line-height:1.45}
.user-health-item small{color:var(--atlas-muted)}
.user-health-item-ok{border-left:4px solid rgba(34,197,94,.65)}
.user-health-item-aviso{border-left:4px solid rgba(245,158,11,.72)}
.user-health-item-erro{border-left:4px solid rgba(239,68,68,.72)}
@media(max-width:700px){.user-health-toolbar{width:100%;justify-content:stretch}.user-health-toolbar .compact-input,.user-health-toolbar .button{width:100%}.user-health-item-head{align-items:flex-start}}


/* FASE M — Home pública + Simulador público */
.home-simulator-heading{max-width:980px;margin:0 auto 1rem;}
.home-public-simulator-stats{display:flex;flex-wrap:wrap;gap:.65rem;margin:.75rem 0 1rem;}
.home-public-simulator-stats span{display:inline-flex;gap:.35rem;align-items:baseline;padding:.45rem .7rem;border:1px solid var(--border, #d9dee8);border-radius:.75rem;background:var(--card-bg, rgba(255,255,255,.72));}
@media (max-width:700px){.home-simulator-toolbar{grid-template-columns:1fr}.home-public-simulator-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));}.home-public-simulator-stats span{justify-content:center;text-align:center;}}


/* HOTFIX Admin — gestão explícita do Histórico Académico */
.admin-history-management-bar{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;padding:9px 16px!important;border-top:1px solid #25344a!important;background:rgba(15,23,42,.42)!important}
.admin-history-management-bar>.muted{margin:0!important;max-width:72ch!important}
.admin-history-management-bar .button-row{margin:0!important;justify-content:flex-end!important}
.admin-history-management-table col.c-code{width:11%!important}
.admin-history-management-table col.c-unit{width:34%!important}
.admin-history-management-table col.c-ects{width:8%!important}
.admin-history-management-table col.c-grade{width:22%!important}
.admin-history-management-table col.c-result{width:13%!important}
.admin-history-management-table col.c-actions{width:12%!important}
.admin-history-management-table td.actions-cell{vertical-align:middle!important}
@media(max-width:760px){.admin-history-management-bar{align-items:stretch!important;flex-direction:column!important}.admin-history-management-bar .button-row{justify-content:flex-start!important}}


/* HOTFIX Admin Histórico — ações sempre visíveis no percurso expandido */
.admin-history-section-title{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;flex-wrap:wrap!important}
.admin-history-course-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:10px!important;flex-wrap:wrap!important;margin-left:auto!important}
.admin-history-course-actions>.muted{font-size:.78rem!important;font-weight:500!important}
.admin-history-delete-course{display:inline-flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important}
.admin-history-empty{padding:12px 8px!important}
@media(max-width:760px){.admin-history-section-title{align-items:stretch!important;flex-direction:column!important}.admin-history-course-actions{align-items:stretch!important;justify-content:flex-start!important;margin-left:0!important}.admin-history-delete-course{align-self:flex-start!important}}

/* HOTFIX final Admin Histórico — eliminação sempre visível */
.admin-history-direct-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:12px!important;padding:8px 14px!important;border-top:1px solid #25344a!important;background:rgba(7,16,34,.30)!important}
.admin-history-direct-actions .admin-history-delete-course{display:inline-flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important}
@media(max-width:760px){.admin-history-direct-actions{align-items:stretch!important;flex-direction:column!important}.admin-history-direct-actions .admin-history-delete-course{align-self:flex-start!important}}


/* PATCH 2026-08-23 - Home publica e Simulador publico: densidade visual equivalente ao Portal */
.home-hero{max-width:760px;margin-top:10px}
.home-hero .hero-guide-logo{width:min(280px,62vw);margin-bottom:14px}
.home-hero h1{font-size:clamp(2rem,3.1vw,3.35rem);line-height:1.08;margin:.24em 0}
.home-hero .eyebrow{font-size:.72rem}
.home-hero-lead{max-width:700px;font-size:.92rem;line-height:1.58;margin-top:10px}
.home-hero .actions{margin-top:18px}

.home-simulator-heading{max-width:820px;margin-bottom:.8rem}
.home-simulator-heading h1{font-size:clamp(1.7rem,2.4vw,2.25rem);line-height:1.15;margin:.3rem 0 .65rem}
.home-simulator-heading>p:last-child{font-size:.9rem;line-height:1.5;margin:.4rem auto 0}
.home-simulator-toolbar{grid-template-columns:repeat(2,minmax(220px,320px));gap:12px;margin:8px auto 14px}
.home-simulator-toolbar label{gap:5px;font-size:.82rem;line-height:1.2;font-weight:750}
.home-simulator-toolbar select{min-height:38px;padding:7px 10px;border-radius:9px;font-size:.84rem;line-height:1.2}

/* O mapa publico usa a mesma escala compacta do Simulador no Portal do Aluno. */
.home-public-graph-viewport{min-height:430px;max-height:68vh}
.home-public-graph-viewport .curriculum-graph{padding:10px;min-height:410px}
.home-public-graph-viewport .curriculum-columns{gap:10px}
.home-public-graph-viewport .curriculum-column,
.home-public-graph-viewport .curriculum-semester-column{width:170px;flex:0 0 170px}
.home-public-graph-viewport .curriculum-path-column{width:160px;flex:0 0 160px}
.home-public-graph-viewport .curriculum-column>h3{margin-bottom:7px;padding:6px 7px;border-radius:8px;font-size:.75rem}
.home-public-graph-viewport .curriculum-column-body{gap:7px}
.home-public-graph-viewport .curriculum-section{gap:5px;padding:6px;border-radius:9px}
.home-public-graph-viewport .curriculum-section+.curriculum-section{margin-top:6px}
.home-public-graph-viewport .curriculum-section-title{font-size:.62rem;gap:4px}
.home-public-graph-viewport .curriculum-node{border-left-width:4px;border-radius:8px;padding:7px;box-shadow:0 3px 9px #0002}
.home-public-graph-viewport .curriculum-node .node-title{font-size:.76rem;line-height:1.18}
.home-public-graph-viewport .curriculum-node .node-code{font-size:.64rem;margin-top:3px}
.home-public-graph-viewport .curriculum-node small{font-size:.64rem;line-height:1.18;margin-top:4px}
.home-public-graph-viewport .curriculum-path-card{padding:9px;border-radius:9px;gap:4px;box-shadow:0 4px 12px #0003}
.home-public-graph-viewport .curriculum-path-card strong{font-size:.78rem;line-height:1.2}
.home-public-graph-viewport .curriculum-path-card .node-code{font-size:.64rem;margin-top:2px}
.home-public-graph-viewport .curriculum-path-card small{font-size:.64rem;line-height:1.25;margin-top:2px}
.home-public-graph-viewport .curriculum-empty.compact{min-height:34px;padding:5px;font-size:.65rem}
@media(max-width:1100px){
  .home-public-graph-viewport .curriculum-column,
  .home-public-graph-viewport .curriculum-semester-column{width:165px;flex-basis:165px}
  .home-public-graph-viewport .curriculum-path-column{width:155px;flex-basis:155px}
}
@media(max-width:720px){
  .home-hero h1{font-size:clamp(1.85rem,9vw,2.55rem)}
  .home-hero .hero-guide-logo{width:min(235px,68vw)}
  .home-simulator-toolbar{grid-template-columns:1fr}
  .home-public-graph-viewport{min-height:420px}
}

/* Definicoes do aluno: seguranca da conta em coluna unica e largura de leitura controlada. */
.account-security-card{max-width:760px;width:100%}
.account-security-form{grid-template-columns:1fr!important;max-width:620px;width:100%;align-items:stretch}
.account-security-form>label,.account-security-form>button{width:100%;max-width:100%}
@media(max-width:800px){.account-security-card,.account-security-form{max-width:100%}}
