/* 314 Evolução — experiência de tablet e modo escuro.
   Preferência exclusivamente local ao navegador (não armazena dados clínicos).
   A identidade bordô permanece na marca; o bordô claro é usado em textos sobre
   superfícies escuras para manter contraste.
*/

/* Comum aos dois temas: economia de espaço sem reduzir áreas de toque. */
.workspace-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:13px;flex-wrap:wrap}
.workspace-header-actions .account{gap:9px}
.theme-toggle{
  background:transparent;color:#FFF5DA;border-color:rgba(255,245,218,.55);
  border-radius:10px;padding:9px 12px;min-height:44px;font-size:13px;
  white-space:nowrap
}
.theme-toggle:hover{background:rgba(255,245,218,.1)}
.fiche-compact-bar{display:flex;align-items:center;gap:13px;flex-wrap:wrap;margin:2px 0 11px}
.fiche-compact-bar .back{margin:0;flex-shrink:0;min-height:44px}
.fiche-compact-identity{min-width:0;flex:1}
.fiche-compact-identity .eyebrow{display:block;font-size:11px;letter-spacing:.08em;margin-bottom:2px}
.fiche-compact-identity h2{
  font:clamp(28px,3.6vw,36px)/1 'Bebas Neue',sans-serif;
  color:var(--wine);margin:0;overflow-wrap:anywhere
}
/* Mais conteúdo visível ao abrir a ficha, especialmente em modo paisagem. */
body.fiche-mode .workspace-header{padding-block:10px}
body.fiche-mode .workspace-header .brand strong{font-size:39px}
body.fiche-mode .workspace-main{margin-top:9px;padding-bottom:18px}
body.fiche-mode #workspaceContent>.fiche-section{margin-top:10px}
body.fiche-mode #workspaceContent>.fiche-section .fiche-section-heading{
  margin-bottom:13px;padding-bottom:10px
}
body.fiche-mode #workspaceContent>.fiche-section .fiche-section-heading h3{margin:2px 0 4px}
body.fiche-mode #workspaceContent>.fiche-section .fiche-section-heading p{margin:0}
@media(max-width:700px){
  .workspace-header-actions{gap:8px}
  .theme-toggle{padding-inline:9px}
  .fiche-compact-identity h2{font-size:30px}
  body.fiche-mode .workspace-main{margin-top:9px}
}
@media(orientation:landscape) and (max-height:920px){
  body.fiche-mode .demo-banner{padding-block:5px;font-size:10px}
  body.fiche-mode .workspace-header{padding-block:7px}
  body.fiche-mode .workspace-main{margin-top:8px}
  body.fiche-mode .fiche-section{padding-block:16px}
}

/* Dark: preto acinzentado próximo do OLED off, com cartão ligeiramente mais
   claro para facilitar contraste. Economia real depende da tecnologia da tela. */
html[data-theme="dark"]{
  color-scheme:dark;
  --wine:#f0aaaa;
  --cream:#fff5da;
  --sky:#95d7e9;
  --ink:#f2ece7;
  --muted:#c7bcb5;
  --line:#4b4547;
  --paper:#1b1d20;
  --bg:#101113;
  --warn:#f5ca8c;
  --panel2:#242528;
  --panel3:#2b2526;
}
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] .workspace-header{background:#530c13}
html[data-theme="dark"] .demo-banner{
  background:#14252c;color:#d5f0f5;border-color:#325664
}
html[data-theme="dark"] .theme-toggle{background:#32171c;color:#fff5da;border-color:#b47777}
html[data-theme="dark"] .theme-toggle:hover{background:#482027}
html[data-theme="dark"] .workspace-header .account button{
  background:transparent;border-color:#aa7877;color:#fff5da
}
html[data-theme="dark"] .workspace-header .account button:hover{
  background:rgba(255,245,218,.12)
}
html[data-theme="dark"] button:not(.primary):not(.theme-toggle){
  color:#f2d4cf;background:#2b262a;border-color:#625051
}
html[data-theme="dark"] button:not(.primary):not(.theme-toggle):hover{
  background:#3a3035;border-color:#cb8b87
}
html[data-theme="dark"] button.primary,
html[data-theme="dark"] nav button.selected{
  background:#781b26;color:#fff5da;border-color:#ab5660
}
html[data-theme="dark"] nav button.selected:hover,
html[data-theme="dark"] button.primary:hover{background:#902832}
html[data-theme="dark"] .panel,
html[data-theme="dark"] .class-card,
html[data-theme="dark"] .fiche-box,
html[data-theme="dark"] .fiche-triage,
html[data-theme="dark"] .fiche-initial,
html[data-theme="dark"] .fiche-clinical,
html[data-theme="dark"] .observation-panel,
html[data-theme="dark"] .goal-manager,
html[data-theme="dark"] .report-version-list,
html[data-theme="dark"] .offline-export-panel{
  background:var(--paper);border-color:var(--line);
  box-shadow:0 4px 14px rgba(0,0,0,.18)
}
html[data-theme="dark"] .fiche-tools-section{background:#18191b}
html[data-theme="dark"] .fiche-section-heading{border-color:var(--line)}
html[data-theme="dark"] .fiche-box p{color:var(--muted)}
html[data-theme="dark"] .fiche-grid{
  color:var(--ink)
}
html[data-theme="dark"] .class-student,
html[data-theme="dark"] .directory-entry,
html[data-theme="dark"] .report-version-button,
html[data-theme="dark"] .goal-creation,
html[data-theme="dark"] .goal-list-item,
html[data-theme="dark"] .obs-compose,
html[data-theme="dark"] .clinical-note-compose,
html[data-theme="dark"] .clinical-review,
html[data-theme="dark"] .initial-answers,
html[data-theme="dark"] .goal-assessment-editor,
html[data-theme="dark"] .goal-settings,
html[data-theme="dark"] .resolve-box,
html[data-theme="dark"] .report-editor,
html[data-theme="dark"] .report-entry-card,
html[data-theme="dark"] .offline-info,
html[data-theme="dark"] .offline-consent{
  background:var(--panel2);color:var(--ink);border-color:var(--line)
}
html[data-theme="dark"] .report-entry-card{background:var(--paper)}
html[data-theme="dark"] .class-student:hover,
html[data-theme="dark"] .directory-entry:hover,
html[data-theme="dark"] .report-version-button:hover{background:#3a3033}
html[data-theme="dark"] .report-version-button.is-selected{
  background:#45252a;border-color:#c9898b
}
html[data-theme="dark"] .work-input,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select{
  background:#151619;color:#f2ece7;border-color:#716364;
  caret-color:#f7d8d8
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#b2a49d}
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] textarea:focus-visible,
html[data-theme="dark"] select:focus-visible{outline:3px solid #95d7e9;outline-offset:1px}
html[data-theme="dark"] .pill,
html[data-theme="dark"] .pill.neutral,
html[data-theme="dark"] .incomplete,
html[data-theme="dark"] .report-tag{
  background:#393031;color:#eed8cc
}
html[data-theme="dark"] .pill.sky{background:#1f424f;color:#d3f3ff}
html[data-theme="dark"] .pill.warn{background:#55401f;color:#ffe1a8}
html[data-theme="dark"] .pill.good{background:#254a38;color:#c3f4cf}
html[data-theme="dark"] .work-notice,
html[data-theme="dark"] .attention,
html[data-theme="dark"] .triage-alert,
html[data-theme="dark"] .current-caution,
html[data-theme="dark"] .caution-summary,
html[data-theme="dark"] .obs-care-note,
html[data-theme="dark"] .offline-warning{
  background:#38291f;border-color:#88613e;color:#f6dcb8
}
html[data-theme="dark"] .current-caution>p,
html[data-theme="dark"] .observation-snippet p{color:var(--ink)}
html[data-theme="dark"] .triage-new-link,
html[data-theme="dark"] .initial-link-box,
html[data-theme="dark"] .goal-method-warning{
  background:#193641;border-color:#487988;color:#d4eff5
}
html[data-theme="dark"] .goal-change{background:#214432;color:#cbefd7}
html[data-theme="dark"] .empty{background:#212123;border-color:var(--line);color:var(--muted)}
html[data-theme="dark"] .outline{
  background:transparent;color:var(--ink);border-color:var(--line)
}
html[data-theme="dark"] .obs-item-head strong,
html[data-theme="dark"] .initial-answer strong,
html[data-theme="dark"] .observation-snippet strong,
html[data-theme="dark"] .goal-teaser strong,
html[data-theme="dark"] .goal-line strong,
html[data-theme="dark"] .directory-entry strong,
html[data-theme="dark"] .class-hour,
html[data-theme="dark"] .date-heading strong{
  color:var(--wine)
}
html[data-theme="dark"] .initial-answer,
html[data-theme="dark"] .observation-snippet,
html[data-theme="dark"] .goal-assessment-history{border-color:var(--line)}
html[data-theme="dark"] .report-selection-toolbar,
html[data-theme="dark"] .report-editable-section{
  background:#252529;border-color:#625658;color:var(--ink)
}
html[data-theme="dark"] .report-selection-count{color:var(--muted)}
html[data-theme="dark"] .report-section-heading>button,
html[data-theme="dark"] .report-item-toolbar>button{
  background:#3b2d31;color:#f6dbd7;border-color:#826b6d
}
html[data-theme="dark"] .report-page>.work-notice{background:#38291f}
html[data-theme="dark"] .report-editor h3,
html[data-theme="dark"] .report-version-list h3{color:var(--wine)}
html[data-theme="dark"] .offline-warning h3{color:#ffdbb7}
html[data-theme="dark"] .offline-info h3{color:var(--wine)}
html[data-theme="dark"] .report-screen-heading button{color:var(--ink)}

/* O documento A4 da prévia deve permanecer branco: é a representação fiel
   do PDF/JPEG e não deve sofrer alterações devido ao tema de consulta. */
html[data-theme="dark"] .report-paper{
  background:#ffffff;color:#292724;border-color:#d6c7b5
}
html[data-theme="dark"] .report-paper .report-goal h4{color:#4b2929}
html[data-theme="dark"] .report-paper .report-item-toolbar>button{
  background:#fffdf9;color:#674640;border-color:#d9c8bd
}
html[data-theme="dark"] .report-paper .report-editable-section{
  background:#fff;border-color:#d8caba
}
html[data-theme="dark"] .report-paper .report-section-heading h3{color:#620000}
html[data-theme="dark"] .report-paper .report-preview-hidden-section{
  background:#f0f0ef;border-color:#b5b5b4
}
@media print{
  /* Qualquer impressão mantém a folha clara; o exportador E4.2 usa canvas. */
  html[data-theme="dark"] .report-paper{
    background:#fff!important;color:#292724!important
  }
}
/* E6.2 — interface de vínculos, temporária até gestão administrativa pelo 314 Gestão. */
.access-admin-panel{max-width:1000px}
.access-admin-panel>h2{font:29px 'Bebas Neue',sans-serif;color:var(--wine);margin:5px 0 8px}
.access-admin-note{margin:17px 0;padding:13px 15px;border-radius:10px;
 background:#f1f6f7;border:1px solid #c7e0e5;font-size:14px;line-height:1.5}
.access-admin-form{display:grid;grid-template-columns:minmax(130px,1fr) minmax(175px,2fr);
 gap:9px 14px;margin:20px 0;padding:17px;border:1px solid var(--line);border-radius:13px}
.access-admin-form label{font-size:14px;font-weight:700;align-self:center}
.access-admin-form button{grid-column:2;justify-self:start;margin-top:5px}
.access-admin-list-header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:20px 0 10px}
.access-admin-list-header h3{margin:0;color:var(--wine)}
.access-admin-list{display:grid;gap:9px}
.access-admin-item{border:1px solid var(--line);background:var(--paper);
 border-radius:11px;padding:13px;display:flex;justify-content:space-between;align-items:center;gap:10px}
.access-admin-item>div{display:flex;flex-direction:column;gap:3px}
.access-admin-item small{font-size:12px}
.access-admin-success{background:#edf8f0;color:#275b37;border:1px solid #b5ddbe;
 border-radius:10px;padding:12px;margin:12px 0}
@media(max-width:620px){
 .access-admin-form{grid-template-columns:1fr}
 .access-admin-form button{grid-column:1;width:100%}
 .access-admin-item{flex-wrap:wrap}
 .access-admin-item button{width:100%}
}
html[data-theme="dark"] .access-admin-form,html[data-theme="dark"] .access-admin-item{
 background:var(--panel2);border-color:var(--line);color:var(--ink)
}
html[data-theme="dark"] .access-admin-note{
 background:#17323b;border-color:#42636d;color:#d3ecf1
}
html[data-theme="dark"] .access-admin-success{
 background:#214432;color:#caefd6;border-color:#5d9272
}


/* E6.3: ocultação de informações quando o navegador/tela vai para o fundo. */
body.privacy-covered #workspaceArea{visibility:hidden}
.audit-admin-panel{max-width:1080px}
.audit-admin-panel>h2{font:29px 'Bebas Neue',sans-serif;color:var(--wine);margin:5px 0 10px}
.audit-toolbar{display:flex;flex-wrap:wrap;gap:9px;align-items:center;margin:20px 0 15px}
.audit-toolbar label{font-size:14px;font-weight:700}
.audit-toolbar select{flex:1;min-width:190px}
.audit-list{display:grid;gap:7px}
.audit-entry{display:grid;grid-template-columns:120px 1fr;align-items:start;gap:14px;
  border:1px solid var(--line);border-radius:10px;padding:12px 14px;
  background:var(--paper);overflow-wrap:anywhere}
.audit-entry strong{display:block;margin-bottom:4px}
.audit-date{font-size:13px;color:var(--muted);white-space:nowrap}
html[data-theme="dark"] .audit-entry{background:var(--panel2);border-color:var(--line)}
@media(max-width:600px){.audit-entry{grid-template-columns:1fr;gap:5px}
.audit-toolbar select,.audit-toolbar button{width:100%}}


/* E6.3: visão principal enxuta + histórico completo sob demanda. */
.audit-view-toggle{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0 12px}
.audit-view-toggle button{min-height:44px;border-radius:10px;padding:10px 14px;font-weight:600}
.audit-view-toggle button.selected{background:var(--wine);color:#fff5da;border-color:var(--wine)}
.audit-toolbar[hidden]{display:none!important}
.audit-summary-controls{display:flex;justify-content:flex-end;margin:10px 0 13px}
@media(max-width:520px){.audit-view-toggle button{flex:1}.audit-summary-controls button{width:100%}}


/* E6.2 — relações professor-aluno agrupadas por profissional. */
.access-teacher-list{display:grid;gap:15px;margin-top:13px}
.access-teacher-group{border:1px solid var(--line);border-radius:13px;
 overflow:hidden;background:var(--paper)}
.access-teacher-heading{display:flex;justify-content:space-between;align-items:center;
 gap:12px;flex-wrap:wrap;padding:15px 18px;background:var(--panel2);
 border-bottom:1px solid var(--line)}
.access-teacher-heading h4{font-size:17px;margin:0;color:var(--wine);
 font-family:'Barlow',sans-serif;font-weight:700}
.access-teacher-meta{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.access-teacher-count{display:inline-block;padding:6px 11px;border-radius:99px;
 border:1px solid var(--line);font-size:12px;font-weight:600}
.access-teacher-inactive{font-size:12px;font-weight:700;color:#a53434}
.access-teacher-roster{width:100%}
.access-teacher-roster-head,.access-teacher-roster-row{display:grid;
 grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(88px,.5fr);
 gap:12px;align-items:center;padding:11px 18px}
.access-teacher-roster-head{font-size:12px;font-weight:700;color:var(--muted);
 background:rgba(149,215,233,.08);border-bottom:1px solid var(--line)}
.access-teacher-roster-row{min-height:57px}
.access-teacher-roster-row+.access-teacher-roster-row{border-top:1px solid var(--line)}
.access-teacher-roster-row>strong{font-size:14px;font-weight:600;overflow-wrap:anywhere}
.access-teacher-roster-row .muted{font-size:13px}
.access-teacher-action{display:flex;justify-content:flex-end}
.access-teacher-action button{min-height:39px}
.access-teacher-empty{margin:0;padding:16px 18px;font-size:14px;color:var(--muted)}
html[data-theme="dark"] .access-teacher-group{background:var(--panel2);
 border-color:var(--line)}
html[data-theme="dark"] .access-teacher-heading{background:#292326;
 border-color:var(--line)}
html[data-theme="dark"] .access-teacher-inactive{color:#ffc1b6}
@media(max-width:640px){
 .access-teacher-heading{padding:13px 14px}
 .access-teacher-roster-head{display:none}
 .access-teacher-roster-row{grid-template-columns:1fr;gap:5px;padding:13px 14px}
 .access-teacher-action{justify-content:flex-start;margin-top:5px}
 .access-teacher-action button{min-width:125px}
}


/* E6.3.1 — três cartões clínicos aproveitam toda a largura sem relatório. */
.fiche-grid-clinical>.fiche-box:last-child{grid-column:1/-1}
