/* Barra global do Kit EducaNexo v2.4 / App Referência v1.2.3.
   Prefixos isolam o design global da classe .brand do Mercado.
   Único logout visual: usa o evento /api/logout preexistente. */
:root{
 --enx-bar-bg:#fff;--enx-bar-text:#1f2937;--enx-bar-muted:#667085;
 --enx-bar-border:#e5e7eb;--enx-bar-brand:#1f4f8f;--enx-bar-hover:#eef2f7;
}
html[data-theme="dark"]{
 color-scheme:dark;
 --enx-bar-bg:#111827;--enx-bar-text:#f8fafc;--enx-bar-muted:#cbd5e1;
 --enx-bar-border:#334155;--enx-bar-brand:#8ab4f8;--enx-bar-hover:#1e293b;
 /* Tema integral do Mercado, conservando as suas cores de ação. */
 --bg:#0f1722;--card:#172536;--ink:#e8f0f7;--muted:#b1c1d0;
 --line:#35475a;--p:#1b825d;--p2:#0e6049;--gold:#e1b650;
 --soft:#233a38;--warn:#443a20;--danger:#ff9ca5;--shadow:0 10px 24px #0005;
 --surface:#172536;--text:#e8f0f7;
}
.enx-global-bar{
 box-sizing:border-box;position:sticky;top:0;z-index:100;height:38px;min-height:38px;
 display:flex;align-items:center;justify-content:space-between;gap:10px;
 padding:0 12px;background:var(--enx-bar-bg);color:var(--enx-bar-text);
 border-bottom:1px solid var(--enx-bar-border);font-family:Inter,Segoe UI,Arial,sans-serif;
 white-space:nowrap;
}
.enx-global-left,.enx-global-right{height:100%;display:flex;align-items:center;min-width:0}
.enx-global-left{gap:7px;overflow:hidden}.enx-global-right{gap:2px;flex-shrink:0}
.enx-global-brand{display:flex;align-items:center;gap:6px;color:var(--enx-bar-brand);font-size:13px;font-weight:800;text-decoration:none;white-space:nowrap;min-width:0}
.enx-global-brand:hover{color:var(--enx-bar-brand)}
.enx-brand-favicon{width:20px;height:20px;display:block;object-fit:contain;flex:0 0 auto}
.enx-global-separator{color:#9ca3af;font-size:13px;user-select:none}
.enx-global-app{max-width:250px;overflow:hidden;text-overflow:ellipsis;font-size:12.5px;font-weight:600;color:var(--enx-bar-muted)}
.enx-global-action{height:26px;display:flex;align-items:center;justify-content:center;padding:0 7px;border:0;border-radius:5px;background:transparent;color:var(--enx-bar-muted);font:600 12px Inter,Segoe UI,Arial,sans-serif;cursor:pointer;text-decoration:none;white-space:nowrap}
.enx-global-action:hover{background:var(--enx-bar-hover);color:var(--enx-bar-text)}
.enx-global-action:focus-visible,.enx-global-brand:focus-visible{outline:2px solid var(--enx-bar-brand);outline-offset:1px}
.enx-global-profile{color:var(--enx-bar-text);max-width:180px;overflow:hidden;text-overflow:ellipsis;cursor:default}
.enx-global-profile:hover{background:transparent}
.enx-global-icon{width:28px;padding:0;font-size:15px}
.enx-global-hidden{display:none!important}
.enx-visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
html.enx-fullscreen-active.enx-fullscreen-hide .enx-global-bar{display:none}
/* Barra interna compacta abaixo dos 38px oficiais. */
.topbar{top:38px;min-height:66px;padding:7px 16px;flex-wrap:wrap}
.topbar .brand-mark{width:42px;height:42px;border-radius:12px;font-size:24px}
.topbar .brand h1{font-size:20px;line-height:1.15}
.topbar .brand small{font-size:11px}
.topbar .session-actions{flex-wrap:wrap;justify-content:flex-end}
.market-cart{top:120px}
.student-nav{top:110px}
html.enx-fullscreen-active.enx-fullscreen-hide .topbar{top:0}
/* Tema escuro: cobrir superfícies com cores fixas presentes no Mercado. */
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] .hero-card{background:linear-gradient(145deg,#172536,#1a3437);border-color:var(--line)}
html[data-theme="dark"] .card,html[data-theme="dark"] .metric,html[data-theme="dark"] .chip,
html[data-theme="dark"] .roadmap-step,html[data-theme="dark"] .pedagogical-plan,
html[data-theme="dark"] .teacher-activity-stage .teacher-activity-content>details,
html[data-theme="dark"] .teacher-activity-stage,
html[data-theme="dark"] .teacher-activity-stage .activity-stage-status,
html[data-theme="dark"] .activity-grade-summary{background:var(--card);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .secondary,html[data-theme="dark"] .tab,html[data-theme="dark"] .student-nav,
html[data-theme="dark"] .activity-selection-note{background:#24394a;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .tab.active,html[data-theme="dark"] .student-nav button.active{background:var(--p);color:#fff}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea,
html[data-theme="dark"] .inline-input{background:#102031!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#aab8c9}
html[data-theme="dark"] .ghost{background:#fff1;color:#fff}
html[data-theme="dark"] .activity-grade.correct{background:#163c2b;color:#b5f0cc}
html[data-theme="dark"] .activity-grade.retry{background:#44361a;color:#ffe4b0}
html[data-theme="dark"] .notice,html[data-theme="dark"] .status-box{background:var(--warn);color:#fce8b5}
html[data-theme="dark"] .pill,html[data-theme="dark"] .activity-grade,
html[data-theme="dark"] .market-card,html[data-theme="dark"] .student-nav button:not(.active){color:var(--ink)}
html[data-theme="dark"] .table-wrap,html[data-theme="dark"] table,html[data-theme="dark"] th,html[data-theme="dark"] td{border-color:var(--line)}
html[data-theme="dark"] th{background:#233747!important;color:var(--ink)}
html[data-theme="dark"] td{background-color:var(--card);color:var(--ink)}
html[data-theme="dark"] .teacher-activity-stage{background:var(--card)}
@media(max-width:720px){
 .enx-global-bar{height:38px;padding:0 8px;gap:5px}
 .enx-global-brand{font-size:12.5px}.enx-brand-favicon{width:19px;height:19px}
 .enx-global-app{max-width:125px;font-size:12px}.enx-brand-text{display:none}
 .enx-global-profile{max-width:90px;font-size:11.5px}
 .enx-global-action{height:25px;padding:0 5px;font-size:11.5px}.enx-global-icon{width:25px;padding:0}
}
@media(max-width:620px){
 .topbar{padding:7px 10px;min-height:60px;gap:5px}
 .topbar .brand h1{font-size:16px}.topbar .brand-mark{width:36px;height:36px;font-size:20px}
 .topbar .session-actions{gap:5px}.topbar .session-actions button{padding:6px 8px;font-size:12px}
 .market-cart{top:44px}.student-nav{top:98px}
}
@media(max-width:360px){.enx-global-app{max-width:90px}.enx-global-profile{max-width:60px}}
@media print{.enx-global-bar,.topbar{display:none!important}html[data-theme="dark"] body{background:#fff;color:#000}}
