:root {
  color-scheme: light;
  --navy: #1a1a1a;
  --navy-2: #262626;
  --ink: #171717;
  --muted: #757575;
  --line: #e6e6e6;
  --surface: #ffffff;
  --canvas: #f5f5f5;
  --teal: #ff8a3d;
  --teal-soft: #ececec;
  --blue: #ff8a3d;
  --blue-soft: #f2f2f2;
  --amber: #d18a20;
  --amber-soft: #fff2d9;
  --red: #c84c52;
  --red-soft: #fdebec;
  --green: #2f8f62;
  --green-soft: #e6f4ec;
  --shadow: 0 14px 40px rgba(32, 32, 32, .08);
}
[data-theme="dark"] {
  color-scheme: dark;
  --navy: #222222;
  --navy-2: #303030;
  --ink: #f4f4f4;
  --muted: #b8b8b8;
  --line: #363636;
  --surface: #141414;
  --canvas: #202020;
  --teal: #ff8a3d;
  --teal-soft: #32251d;
  --blue: #ffab70;
  --blue-soft: #32251d;
  --accent-gradient: linear-gradient(var(--teal), var(--teal));
  --accent-ink: #17110d;
  --amber: #e8a947;
  --amber-soft: #49391f;
  --red: #ef7378;
  --red-soft: #4a292f;
  --green: #63c58d;
  --green-soft: #1d4131;
  --shadow: 0 16px 44px rgba(0, 0, 0, .24);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 400 1rem/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
/* Paleta grafite e laranja da referência de Fabiano; cartões pretos sobre fundo grafite. */
[data-theme="dark"] body { background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.auth-locked { overflow: hidden; }
.auth-locked .app-shell { display: none; }
.login-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 18% 18%, rgba(255, 138, 61,.18), transparent 32%), linear-gradient(145deg, #0e0e0e, #1b1b1b 60%, #1e1e1e); }
.login-card { width: min(460px, 100%); padding: 34px; border: 1px solid rgba(255, 255, 255,.14); border-radius: 22px; color: #f1f1f1; background: rgba(17, 17, 17,.88); box-shadow: 0 30px 90px rgba(0, 0, 0,.34); backdrop-filter: blur(16px); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.login-brand .brand-mark { color: #ff8a3d; }
.login-brand strong, .login-brand small { display: block; }
.login-brand small { color: #a6a6a6; font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.login-copy h1 { margin-bottom: 9px; }
.login-copy > p:last-child { color: #bdbdbd; }
.login-form { display: grid; gap: 15px; margin-top: 24px; }
.login-form label { color: #e3e3e3; font-size: .82rem; font-weight: 700; }
.login-form input { margin-top: 6px; color: #f1f1f1; background: #151515; border-color: #323232; }
.login-form input::placeholder { color: #868686; }
.login-form .primary { margin-top: 3px; color: #101010; background: #ff8a3d; }
.login-error { margin: 0; padding: 9px 11px; border-radius: 9px; color: #ffc6ca; background: rgba(157, 49, 58,.28); font-size: .78rem; }
.demo-login-hint { margin-top: 18px; padding: 12px; border: 1px dashed #5d5d5d; border-radius: 10px; color: #cacaca; background: rgba(21, 21, 21,.7); font-size: .75rem; }
.demo-login-hint strong { display: block; color: #ffab70; margin-bottom: 3px; }
.login-security { margin: 18px 0 0; color: #969696; font-size: .7rem; text-align: center; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px 22px; color: #fff; background: linear-gradient(175deg, var(--navy), #141414); display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 34px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255,.34); border-radius: 14px; color: var(--teal); font-weight: 800; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.04rem; }
.brand small { color: #bfbfbf; font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; }
nav { display: grid; gap: 7px; }
.nav-item { width: 100%; border: 0; border-radius: 14px; padding: 12px 13px; display: flex; gap: 12px; align-items: center; color: #c9c9c9; background: transparent; text-align: left; font-weight: 600; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255,.1); }
.nav-item.active { color: var(--ink); background: #30261f; box-shadow: inset 3px 0 var(--teal); }
.nav-item span { color: var(--teal); font-size: 1.2rem; }
.nav-item.active span { color: var(--teal); }
.nav-badge { min-width: 21px; height: 21px; margin-left: auto; display: grid; place-items: center; border-radius: 999px; color: #fff; background: var(--red); font-size: .68rem; }
.sidebar-foot { margin-top: auto; padding: 16px 9px 0; border-top: 1px solid rgba(255, 255, 255,.12); }
.sync-state { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: #cecece; font-size: .78rem; }
.sync-state i { width: 8px; height: 8px; border-radius: 50%; background: #57d7a6; box-shadow: 0 0 0 4px rgba(87, 215, 166,.12); }
.text-button { border: 0; padding: 6px 0; background: none; color: #fff; font-size: .79rem; text-align: left; }
.text-button.muted { color: #a5a5a5; }
main { width: 100%; max-width: 1500px; padding: 32px clamp(24px, 4vw, 58px) 60px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 2px; font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.14; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 1.28rem; letter-spacing: -.02em; }
h3 { margin-bottom: 0; font-size: 1rem; }
.eyebrow { margin-bottom: 5px; color: var(--teal); font-size: .72rem; font-weight: 800; letter-spacing: .13em; }
.today-label, .microcopy { color: var(--muted); font-size: .86rem; }
.scope-note { display: inline-block; margin: 7px 0 0; padding: 4px 9px; border-radius: 999px; color: #2f2f2f; background: var(--teal-soft); font-size: .72rem; font-weight: 750; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.authenticated .profile-switcher { display: none; }
.session-badge { min-width: 170px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.session-badge strong, .session-badge small { display: block; }
.session-badge strong { font-size: .78rem; }
.session-badge small { color: var(--muted); font-size: .66rem; }
.logout-button { padding-inline: 12px; }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; }
.theme-toggle #themeIcon { font-size: 1.05rem; }
.profile-switcher { min-width: 190px; color: var(--muted); font-size: .68rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.profile-switcher span { display: block; margin-bottom: 3px; }
.profile-switcher select { min-height: 32px; padding-block: 4px; color: var(--ink); font-size: .8rem; font-weight: 650; text-transform: none; letter-spacing: 0; }
.primary, .secondary { min-height: 42px; border-radius: 12px; border: 1px solid transparent; padding: 9px 16px; font-weight: 750; }
.primary { color: #fff; background: var(--navy); box-shadow: 0 8px 18px rgba(26, 26, 26,.14); }
.primary:hover { background: var(--navy-2); }
.secondary { color: var(--navy); background: var(--surface); border-color: var(--line); }
.command-card { display: grid; grid-template-columns: auto 1fr; gap: 15px; padding: 20px; border: 1px solid #dadada; border-radius: 18px; background: linear-gradient(120deg, #fcfcfc, #f2f2f2); box-shadow: var(--shadow); }
.command-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; color: var(--accent-ink); background: var(--accent-gradient); font-size: 1.2rem; }
.command-body label { display: block; margin-bottom: 9px; font-weight: 780; }
.assistant-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.assistant-title-row label { margin-bottom: 9px; }
.ai-state { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 9px; padding: 4px 9px; border-radius: 999px; color: #626262; background: #eeeeee; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.ai-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #999999; }
.ai-state.ai-online { color: #176b50; background: #dff5eb; }
.ai-state.ai-online::before { background: #2f9e6f; box-shadow: 0 0 0 3px rgba(47, 158, 111,.12); }
.ai-state.ai-busy { color: #ff8a3d; background: var(--blue-soft); }
.ai-state.ai-busy::before { background: var(--blue); animation: ai-pulse 1s ease-in-out infinite; }
.assistant-privacy { margin: 7px 0 0; color: var(--muted); font-size: .7rem; }
@keyframes ai-pulse { 50% { opacity: .35; transform: scale(.75); } }
#questionForm { display: flex; gap: 9px; }
input, select, textarea { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; color: var(--ink); background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(255, 138, 61,.12); }
textarea { resize: vertical; }
.suggestions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.suggestions button { border: 1px solid #dedede; border-radius: 999px; padding: 5px 10px; color: #313131; background: rgba(255, 255, 255,.72); font-size: .78rem; }
.answer-panel { margin-top: 15px; padding: 19px 20px; border-left: 4px solid var(--teal); border-radius: 5px 14px 14px 5px; background: #fff; box-shadow: var(--shadow); }
.answer-head { display: flex; justify-content: space-between; color: var(--teal); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.answer-head button { border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; }
#answerText { max-width: 900px; margin: 9px 0 12px; font-size: 1.02rem; }
.answer-items { display: flex; gap: 8px; flex-wrap: wrap; }
.answer-chip { border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; background: #fafafa; color: var(--ink); font-size: .82rem; }
.view { display: none; margin-top: 24px; }
.active-view { display: block; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-card { position: relative; min-height: 128px; padding: 19px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(32, 32, 32,.05); }
.kpi-card::after { content: ""; position: absolute; width: 62px; height: 62px; right: -21px; bottom: -25px; border-radius: 50%; background: var(--tone, var(--blue-soft)); }
.kpi-card .kpi-value { display: block; margin: 8px 0 2px; font-size: 1.68rem; font-weight: 820; letter-spacing: -.045em; }
.kpi-card .kpi-label { color: var(--muted); font-size: .84rem; }
.kpi-trend { color: var(--tone-text, var(--blue)); font-size: .72rem; font-weight: 750; }
.report-executive-alert { width: 100%; margin-top: 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 13px 15px; border: 1px solid #ecc1c4; border-radius: 12px; color: #7e252c; background: #fff5f5; text-align: left; }
.report-executive-alert .alert-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--red); font-weight: 850; }
.report-executive-alert strong, .report-executive-alert small { display: block; }
.report-executive-alert small { color: #95565b; font-size: .76rem; }
.report-executive-alert b { color: #9c3037; font-size: .78rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr); gap: 16px; margin-top: 16px; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgba(32, 32, 32,.045); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 19px 20px 13px; }
.link-button { border: 0; background: none; color: var(--blue); font-weight: 700; }
.attention-list { padding: 0 10px 10px; }
.attention-row { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 13px 10px; border: 0; border-top: 1px solid #f0f0f0; background: none; text-align: left; }
.attention-row:hover { background: #fafafa; }
.attention-row .risk { width: 8px; height: 38px; border-radius: 8px; background: var(--red); }
.attention-row .risk.amber { background: var(--amber); }
.attention-row strong { display: block; font-size: .92rem; }
.attention-row small { color: var(--muted); font-size: .75rem; }
.status-badge { display: inline-flex; align-items: center; min-height: 26px; border-radius: 999px; padding: 4px 9px; font-size: .72rem; font-weight: 750; white-space: nowrap; }
.status-pendente { color: #8f611a; background: var(--amber-soft); }
.status-andamento { color: #ff8a3d; background: var(--blue-soft); }
.status-aguardando { color: #a53940; background: var(--red-soft); }
.status-concluido { color: #24734d; background: var(--green-soft); }
.pulse-content { display: flex; align-items: center; justify-content: center; gap: 30px; padding: 10px 22px 18px; }
.donut { width: 126px; height: 126px; flex: 0 0 auto; border-radius: 50%; display: grid; place-content: center; position: relative; text-align: center; background: conic-gradient(var(--amber) 0 54%, var(--blue) 54% 62%, var(--red) 62% 89%, var(--green) 89% 100%); }
.donut::before { content: ""; position: absolute; inset: 15px; border-radius: 50%; background: #fff; }
.donut strong, .donut span { position: relative; z-index: 1; }
.donut strong { font-size: 1.55rem; }
.donut span { color: var(--muted); font-size: .7rem; }
.legend { display: grid; gap: 8px; min-width: 140px; }
.legend-row { display: grid; grid-template-columns: 9px 1fr auto; gap: 7px; align-items: center; font-size: .78rem; }
.legend-row i { width: 8px; height: 8px; border-radius: 50%; }
.health-note { margin: 0 18px 18px; padding: 10px 12px; border-radius: 9px; color: #62501f; background: #fff8e7; font-size: .78rem; }
.directorates-panel { margin-top: 16px; }
.directorate-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; padding: 0 18px 18px; }
.directorate-card { border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: #fcfcfc; text-align: left; }
.directorate-card:hover { border-color: var(--teal); transform: translateY(-1px); }
.directorate-card strong { display: block; margin: 6px 0 2px; font-size: 1.45rem; }
.directorate-card small { color: var(--muted); }
.section-title { display: flex; justify-content: space-between; align-items: end; margin-bottom: 15px; }
.section-title span { color: var(--muted); font-size: .85rem; }
.filter-bar { display: grid; grid-template-columns: minmax(260px,1fr) 230px 190px; gap: 10px; margin-bottom: 14px; }
.demand-list { display: grid; gap: 9px; }
.demand-card { display: grid; grid-template-columns: minmax(240px,1.8fr) minmax(140px,.8fr) minmax(140px,.8fr) auto; gap: 18px; align-items: center; padding: 15px 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(32, 32, 32,.035); }
.demand-card:hover { border-color: #c6c6c6; }
.demand-main button { border: 0; padding: 0; color: var(--ink); background: none; font-weight: 780; text-align: left; }
.demand-main small, .demand-meta small { display: block; color: var(--muted); font-size: .75rem; }
.demand-meta strong { display: block; font-size: .84rem; }
.demand-value { font-weight: 780; font-variant-numeric: tabular-nums; }
.report-title { align-items: center; }
.report-title .today-label { margin: 5px 0 0; }
.report-kpis { margin-bottom: 15px; }
.privacy-note { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 13px 15px; border: 1px solid #313131; border-radius: 14px; color: #e4e4e4; background: #32251d; }
.privacy-note strong { white-space: nowrap; }
.privacy-note span { color: #c0c0c0; font-size: .82rem; }
.report-filters { grid-template-columns: 230px 230px; justify-content: end; }
.report-list { display: grid; gap: 11px; }
.report-card { display: grid; grid-template-columns: minmax(220px,1.2fr) minmax(145px,.7fr) minmax(260px,1fr) auto; gap: 17px; align-items: center; padding: 17px; border: 1px solid var(--line); border-left: 4px solid var(--status-color, var(--line)); border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(32, 32, 32,.035); }
.report-card h3 { margin-bottom: 3px; }
.report-card p { margin: 0; color: var(--muted); font-size: .78rem; }
.report-period strong, .report-period span { display: block; }
.report-period span { color: var(--muted); font-size: .74rem; }
.report-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.metric-mini { padding: 8px 9px; border-radius: 8px; background: #f6f6f6; }
.metric-mini span, .metric-mini strong { display: block; }
.metric-mini span { color: var(--muted); font-size: .64rem; }
.metric-mini strong { margin-top: 2px; font-size: .8rem; font-variant-numeric: tabular-nums; }
.report-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 7px; }
.report-actions button { min-height: 34px; padding: 6px 10px; font-size: .76rem; }
.report-status { display: inline-flex; border-radius: 999px; padding: 4px 9px; font-size: .7rem; font-weight: 800; }
.report-atrasado { color: #9c3037; background: var(--red-soft); }
.report-cobrado { color: #8b5c13; background: var(--amber-soft); }
.report-pendente { color: #ff8a3d; background: var(--blue-soft); }
.report-recebido { color: #24734d; background: var(--green-soft); }
.calculated { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 13px; border-radius: 11px; background: var(--canvas); }
.calculated div { padding: 8px; border-left: 3px solid var(--teal); }
.calculated span, .calculated strong { display: block; }
.calculated span { color: var(--muted); font-size: .7rem; }
.calculated strong { margin-top: 2px; font-size: 1rem; }
.manager-chip { display: inline-block; margin-top: 5px; padding: 3px 7px; border-radius: 999px; color: #2e2e2e; background: var(--teal-soft); font-size: .68rem; font-weight: 750; }
.meeting-hero { display: flex; justify-content: space-between; gap: 20px; padding: 24px; border-radius: 18px; color: #fff; background: linear-gradient(120deg, var(--navy), #303030); box-shadow: var(--shadow); }
.meeting-hero p:not(.eyebrow) { margin: 8px 0 0; color: #d7d7d7; }
.meeting-hero .primary { align-self: center; color: var(--navy); background: #fff; }
.meeting-agenda { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 15px; }
.agenda-column { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.agenda-column h3 { margin-bottom: 12px; }
.agenda-column ol { padding-left: 20px; margin-bottom: 0; }
.agenda-column li { margin: 8px 0; font-size: .86rem; }
.agenda-column button { border: 0; padding: 0; background: none; color: var(--ink); text-align: left; }
.notes-panel { margin-top: 15px; padding: 18px; }
.notes-panel label { display: block; margin-bottom: 8px; font-weight: 780; }
.notes-panel span { display: block; margin-top: 5px; color: var(--muted); font-size: .72rem; }
.dialog { width: min(680px, calc(100vw - 30px)); max-height: 90vh; border: 0; border-radius: 20px; padding: 26px; box-shadow: 0 28px 80px rgba(17, 17, 17,.3); }
.dialog::backdrop { background: rgba(14, 14, 14,.56); backdrop-filter: blur(2px); }
.dialog-close { position: absolute; top: 13px; right: 16px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--muted); background: #f4f4f4; font-size: 1.3rem; }
.dialog-heading { margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { color: #393939; font-size: .78rem; font-weight: 700; }
.form-grid label input, .form-grid label select, .form-grid label textarea { margin-top: 5px; font-weight: 400; }
.wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.detail-head { padding-right: 36px; }
.detail-head h2 { margin: 5px 0 8px; font-size: 1.45rem; }
.detail-sub { color: var(--muted); font-size: .83rem; }
.detail-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin: 20px 0; }
.detail-grid label { color: var(--muted); font-size: .74rem; font-weight: 700; }
.detail-grid input, .detail-grid select, .detail-grid textarea { margin-top: 4px; color: var(--ink); }
.activity { padding-top: 15px; border-top: 1px solid var(--line); }
.activity h3 { margin-bottom: 10px; }
.activity-entry { display: grid; grid-template-columns: 8px 1fr; gap: 10px; margin: 10px 0; font-size: .8rem; }
.activity-entry i { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--teal); }
.activity-entry small { display: block; color: var(--muted); }
.comment-box { display: flex; gap: 7px; margin-top: 12px; }
.comment-box button { min-height: 42px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; padding: 11px 15px; border-radius: 10px; color: #fff; background: var(--navy); box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.empty-state { padding: 28px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed #d0d0d0; border-radius: 12px; }
[data-theme="dark"] .sidebar { background: linear-gradient(175deg, #191919, #191919); }
[data-theme="dark"] .secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .primary { color: var(--accent-ink); background: var(--accent-gradient); box-shadow: 0 8px 22px rgba(255, 171, 112,.22); }
[data-theme="dark"] .primary:hover { filter: brightness(1.08); }
[data-theme="dark"] .command-card { border-color: #363636; background: linear-gradient(120deg, #191919, #191919); }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea { color: var(--ink); background: #1c1c1c; border-color: var(--line); }
[data-theme="dark"] .suggestions button { color: #e8d6c8; background: rgba(26, 26, 26,.8); border-color: #57402e; }
[data-theme="dark"] .ai-state { color: #c8c8c8; background: #292929; }
[data-theme="dark"] .ai-state.ai-online { color: #a7e8d1; background: #183c32; }
[data-theme="dark"] .ai-state.ai-busy { color: #ffbd8f; background: #32251d; }
[data-theme="dark"] .answer-panel,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .demand-card,
[data-theme="dark"] .agenda-column,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .dialog { background: var(--surface); border-color: #363636; box-shadow: 0 12px 30px rgba(0, 0, 0,.35); }
[data-theme="dark"] .attention-row { color: var(--ink); }
[data-theme="dark"] .attention-row:hover { background: #292929; }
[data-theme="dark"] .attention-row,
[data-theme="dark"] .activity { border-color: var(--line); }
[data-theme="dark"] .donut::before { background: var(--surface); }
[data-theme="dark"] .health-note { color: #f4d99a; background: #382f1e; }
[data-theme="dark"] .directorate-card { color: var(--ink); background: #191919; border-color: var(--line); }
[data-theme="dark"] .report-card { color: var(--ink); background: #191919; }
[data-theme="dark"] .metric-mini { background: #121212; }
[data-theme="dark"] .scope-note,
[data-theme="dark"] .manager-chip { color: #ffbd8f; background: #32251d; }
[data-theme="dark"] .report-executive-alert { color: #ffc8cb; background: #3b2229; border-color: #67363e; }
[data-theme="dark"] .report-executive-alert small { color: #e1a3a8; }
[data-theme="dark"] .report-executive-alert b { color: #ffb8bc; }
[data-theme="dark"] .directorate-card:hover { border-color: var(--teal); }
[data-theme="dark"] .answer-chip { color: var(--ink); background: #191919; border-color: var(--line); }
[data-theme="dark"] .dialog-close { color: var(--ink); background: #292929; }
[data-theme="dark"] .meeting-hero { background: linear-gradient(120deg, #1b1b1b, #272727); }
[data-theme="dark"] .meeting-hero .primary { color: #0f0f0f; background: #ffab70; }
[data-theme="dark"] .status-pendente { color: #ffd990; }
[data-theme="dark"] .status-andamento { color: #ffbd8f; }
[data-theme="dark"] .status-aguardando { color: #ffb8bc; }
[data-theme="dark"] .status-concluido { color: #a7e6c1; }
@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 80px minmax(0,1fr); }
  .sidebar { padding-inline: 11px; }
  .brand { justify-content: center; margin-inline: 0; }
  .brand > span:last-child, .nav-item:not(.active) { font-size: 0; }
  .nav-item { justify-content: center; font-size: 0; }
  .nav-item span { font-size: 1.25rem; }
  .sidebar-foot { display: none; }
  .kpi-grid, .directorate-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .meeting-agenda { grid-template-columns: 1fr; }
  .report-card { grid-template-columns: 1fr 1fr; }
  .report-actions { align-items: flex-start; }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0; z-index: 10; width: auto; height: 68px; padding: 8px 12px; flex-direction: row; }
  .brand, .sidebar-foot { display: none; }
  .sidebar nav { width: 100%; grid-template-columns: repeat(4,1fr); }
  .manager-mode .sidebar nav { grid-template-columns: repeat(2,1fr); }
  .nav-item, .nav-item:not(.active), .nav-item.active { justify-content: center; gap: 6px; font-size: .7rem; box-shadow: none; }
  .nav-item span { font-size: 1rem; }
  main { padding: 22px 15px 92px; }
  .topbar { display: block; }
  .top-actions { margin-top: 16px; }
  .top-actions button { flex: 1; }
  .command-card { grid-template-columns: 1fr; }
  .command-icon { display: none; }
  #questionForm { display: grid; }
  .kpi-grid, .directorate-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card { min-height: 116px; }
  .pulse-content { align-items: flex-start; }
  .filter-bar { grid-template-columns: 1fr; }
  .demand-card { grid-template-columns: 1fr auto; gap: 10px; }
  .demand-card .demand-meta { display: none; }
  .meeting-hero { display: block; }
  .meeting-hero button { margin-top: 17px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .profile-switcher { order: 3; width: 100%; }
  .report-card { grid-template-columns: 1fr; }
  .report-metrics, .calculated { grid-template-columns: 1fr 1fr 1fr; }
  .report-filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 430px) {
  .kpi-grid, .directorate-grid { grid-template-columns: 1fr; }
  .suggestions button:nth-child(n+3) { display: none; }
  .pulse-content { flex-direction: column; align-items: center; }
  .report-metrics, .calculated, .report-filters { grid-template-columns: 1fr; }
  .nav-item, .nav-item:not(.active), .nav-item.active { font-size: .62rem; padding-inline: 4px; }
}

/* Acessos (gestão de usuários pela Presidência) */
#passwordForm .text-button, .password-logout { color: #b3b3b3; text-align: center; }
.password-logout { width: 100%; margin-top: 14px; }
.access-create { margin-bottom: 15px; }
.access-form { display: grid; grid-template-columns: 1.1fr 1.2fr .8fr 1fr auto; gap: 12px; align-items: end; padding: 0 20px 20px; }
.access-form label, .user-profile small { color: var(--muted); font-size: .78rem; font-weight: 700; }
.access-form label input, .access-form label select { margin-top: 5px; font-weight: 400; }
.user-list { display: grid; gap: 10px; }
.user-card { display: grid; grid-template-columns: minmax(220px,1.3fr) minmax(200px,1fr) minmax(170px,.8fr) auto; gap: 16px; align-items: center; padding: 15px 17px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 12px; background: #fff; }
.user-card.user-provisorio { border-left-color: var(--amber); }
.user-card.user-inativo { border-left-color: var(--muted); opacity: .72; }
.user-card h3 { margin: 0 0 2px; font-size: 1rem; }
.user-card p { margin: 0; color: var(--muted); font-size: .8rem; word-break: break-all; }
.user-profile select { margin-top: 4px; min-height: 36px; padding-block: 5px; font-size: .84rem; }
.user-state small { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; }
.user-badge { display: inline-flex; border-radius: 999px; padding: 4px 9px; font-size: .7rem; font-weight: 800; }
.user-badge-ativo { color: #24734d; background: var(--green-soft); }
.user-badge-provisorio { color: #8b5c13; background: var(--amber-soft); }
.user-badge-inativo { color: var(--muted); background: var(--canvas); }
.danger-text { color: var(--red) !important; }
.temp-password-dialog { width: min(520px, calc(100vw - 30px)); }
.temp-password-box { display: grid; gap: 12px; margin-bottom: 20px; padding: 16px; border: 1px dashed var(--teal); border-radius: 12px; background: var(--teal-soft); }
.temp-password-box small { display: block; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.temp-password-box strong { word-break: break-all; }
.temp-password-box code { display: block; margin-top: 3px; font: 700 1.35rem/1.3 ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: .06em; color: var(--ink); user-select: all; }
[data-theme="dark"] .user-card { color: var(--ink); background: #191919; }
[data-theme="dark"] .user-badge-ativo { color: #a7e8c3; }
[data-theme="dark"] .user-badge-provisorio { color: #f4d99a; }
@media (max-width: 1050px) {
  .access-form { grid-template-columns: 1fr 1fr; }
  .user-card { grid-template-columns: 1fr 1fr; }
  .user-card .report-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
}
@media (max-width: 720px) {
  .access-form, .user-card { grid-template-columns: 1fr; }
}
#passwordGateUser { text-transform: none; letter-spacing: 0; }

/* Manutenção / TI: somente leitura */
.read-only .access-create, .read-only [data-charge], .read-only #resetBtn, .read-only .comment-box, .read-only #detailForm .form-actions { display: none !important; }
@media (max-width: 720px) {
  /* barra inferior: uma coluna por item visível (Presidência 5, gerente 2) */
  .sidebar nav, .manager-mode .sidebar nav { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
  .nav-item { min-width: 0; text-align: center; line-height: 1.15; }
}
@media (max-width: 720px) {
  .sidebar { height: 64px; padding: 6px 8px; }
  .nav-item, .nav-item:not(.active), .nav-item.active { position: relative; flex-direction: column; gap: 2px; padding: 5px 2px; font-size: .64rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-item span { font-size: 1.05rem; line-height: 1; }
  .nav-badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 17px; height: 17px; margin: 0; font-size: .6rem; }
}
/* Tablet / iPad (721–1050px): colunas flexíveis para não vazar da tela */
@media (max-width: 1050px) {
  .brand > span:last-child { display: none; }
}
@media (min-width: 721px) and (max-width: 1050px) {
  .filter-bar { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .filter-bar input[type="search"] { grid-column: 1 / -1; }
  .report-filters { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .demand-card { grid-template-columns: minmax(0,1.6fr) minmax(0,.8fr) minmax(0,.8fr) auto; gap: 12px; }
}

/* Mostrar/ocultar senha */
.password-field { position: relative; display: block; margin-top: 6px; }
.password-field input { margin-top: 0 !important; padding-right: 46px; }
.password-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 36px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #a0a0a0; font-size: 1rem; line-height: 1; opacity: .7; }
.password-toggle:hover, .password-toggle.on { opacity: 1; background: rgba(255, 255, 255,.08); }
.password-toggle.on { color: #ff8a3d; }

/* Verificação em 2 etapas */
.user-badge-2fa { margin-left: 4px; color: #ff8a3d; background: var(--blue-soft); }
[data-theme="dark"] .user-badge-2fa { color: #d8d8d8; }
.twofa-dialog { width: min(560px, calc(100vw - 30px)); }
.twofa-steps { display: grid; gap: 12px; margin: 0 0 16px 18px; padding: 0; }
.twofa-secret { display: block; margin: 8px 0; padding: 12px 14px; border: 1px dashed var(--teal); border-radius: 12px; background: var(--teal-soft); font: 700 1.1rem/1.5 ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: .08em; word-break: break-all; user-select: all; }
.twofa-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 12px 0; padding: 14px; border: 1px dashed var(--amber); border-radius: 12px; background: var(--amber-soft); }
.twofa-codes code { font: 700 1rem/1.4 ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: .05em; user-select: all; }
.twofa-note { margin: 0 0 14px; color: var(--muted); font-size: .86rem; }
.twofa-field { display: grid; gap: 6px; margin-bottom: 12px; font-size: .82rem; font-weight: 700; }
.twofa-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.twofa-check { display: flex; align-items: center; gap: 8px; margin: 10px 0 14px; font-size: .86rem; font-weight: 700; }
@media (max-width: 480px) { .twofa-codes { grid-template-columns: 1fr; } }

/* Página mais compacta: menu do usuário e assistente só na tela inicial */
.topbar { margin-bottom: 16px; }
h1 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }
.top-actions { align-items: flex-start; }
.user-menu { position: relative; }
.session-button { min-width: 170px; padding: 5px 30px 5px 11px; text-align: left; color: inherit; font: inherit; cursor: pointer; position: relative; }
.session-button::after { content: "▾"; position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .8rem; }
.session-button:hover, .user-menu.open .session-button { border-color: var(--teal); }
.user-menu-list { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; padding: 6px; gap: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.user-menu.open .user-menu-list { display: grid; }
.user-menu-list button { width: 100%; text-align: left; border-color: transparent; background: transparent; }
.user-menu-list button:hover { background: var(--canvas); }
.user-menu-list .logout-button { color: var(--red); }
body:not(.assistant-on) .command-card, body:not(.assistant-on) .answer-panel { display: none !important; }

/* Versão em uso (menu lateral e menu do usuário) */
.app-version { margin: 12px 0 0; color: #a2a2a2; font-size: .72rem; letter-spacing: .02em; }
.app-version.stale { color: var(--amber); font-weight: 700; }
.app-version-menu { margin: 4px 8px 4px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Histórico de perguntas do assistente */
#answerText { white-space: pre-line; }
.assistant-history { margin-top: 10px; }
.assistant-history > .text-button { font-size: .8rem; font-weight: 700; color: var(--teal); cursor: pointer; }
.history-panel { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(14, 14, 14, .35); }
.history-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; font-size: .82rem; }
.history-head .text-button { font-size: .76rem; cursor: pointer; }
.history-list { margin: 0; padding: 0; list-style: none; max-height: 240px; overflow: auto; display: grid; gap: 4px; }
.history-item { display: flex; align-items: stretch; gap: 4px; }
.history-open { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.history-open:hover { border-color: var(--teal); background: rgba(255, 138, 61, .08); }
.history-q { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; font-weight: 700; }
.history-open small { color: var(--muted); font-size: .7rem; }
.history-mode { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: .64rem; font-weight: 800; }
.history-del { width: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.history-del:hover { color: var(--red); background: var(--red-soft); }
.history-empty { padding: 8px 4px; color: var(--muted); font-size: .8rem; }

/* Busca por voz */
.voice-field { position: relative; display: block; min-width: 0; }
#questionForm .voice-field { flex: 1; }
.voice-field input { width: 100%; padding-right: 48px; }
.mic-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.mic-btn[hidden] { display: none; }
.mic-btn:hover { color: var(--teal); background: rgba(255, 138, 61, .1); }
.mic-btn.listening { color: #fff; background: var(--red); animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 115, 120, .55); } 50% { box-shadow: 0 0 0 9px rgba(239, 115, 120, 0); } }
@media (prefers-reduced-motion: reduce) { .mic-btn.listening { animation: none; } }

.ai-state.ai-problem { color: #ffd9a3; background: rgba(209, 138, 32, .22); }
.ai-state.ai-problem::before { background: var(--amber); }

/* ===== Login: visual técnico e funcional ===== */
.login-gate.login-tech { min-height: 100vh; display: grid; place-items: center; padding: 24px; color: #e6e6e6;
  background:
    linear-gradient(rgba(255, 138, 61, .045) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 138, 61, .045) 1px, transparent 1px) 0 0 / 44px 44px,
    radial-gradient(900px 520px at 12% 8%, rgba(255, 138, 61, .14), transparent 60%),
    #202020; }
.login-tech .login-shell { width: min(980px, 100%); display: grid; grid-template-columns: 1.05fr .95fr; border: 1px solid #363636; border-radius: 16px; overflow: hidden; background: #141414; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.login-tech .login-aside { display: flex; flex-direction: column; gap: 22px; padding: 38px 36px; border-right: 1px solid #363636; background: linear-gradient(160deg, #191919, #141414 70%); }
.login-tech .login-brand { display: flex; align-items: center; gap: 12px; margin: 0; }
.login-tech .login-brand strong { display: block; font-size: 1rem; }
.login-tech .login-brand small { display: block; color: #969696; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.login-tech .login-brand .brand-mark { color: #ff8a3d; }
.login-tech .login-brand-compact { display: none; margin-bottom: 20px; }
.login-tech .login-hero { margin: 8px 0 0; font-size: 1.45rem; line-height: 1.3; letter-spacing: -.02em; color: #f6f6f6; }
.login-tech .login-facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; color: #bbbbbb; font-size: .88rem; }
.login-tech .login-facts li { display: flex; align-items: baseline; gap: 10px; }
.login-tech .login-facts i { flex: none; width: 7px; height: 7px; border-radius: 2px; background: #ff8a3d; transform: translateY(-1px); }
.login-tech .login-status { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid #363636; border-radius: 9px; background: rgba(32, 32, 32, .7); font: 600 .76rem/1.2 ui-monospace, "Cascadia Code", Consolas, monospace; color: #bbbbbb; }
.login-tech .login-status i { width: 8px; height: 8px; border-radius: 50%; background: #969696; }
.login-tech .login-status.ok i { background: #57d7a6; box-shadow: 0 0 0 4px rgba(87, 215, 166, .16); }
.login-tech .login-status.down i { background: #ef7378; box-shadow: 0 0 0 4px rgba(239, 115, 120, .16); }
.login-tech .login-card { width: auto; padding: 38px 36px; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; color: inherit; align-self: center; }
.login-tech .login-copy h1 { margin: 2px 0 8px; font-size: 1.7rem; color: #f6f6f6; }
.login-tech .login-copy > p:last-child { color: #bbbbbb; font-size: .9rem; }
.login-tech .login-copy .eyebrow { margin-bottom: 4px; }
.login-tech .login-form { display: grid; gap: 14px; margin-top: 22px; }
.login-tech .login-form label { color: #dcdcdc; font-size: .82rem; font-weight: 700; }
.login-tech .login-form input:not([type="checkbox"]) { margin-top: 6px; color: #f1f1f1; background: #202020; border: 1px solid #414141; border-radius: 12px; }
.login-tech .login-form input:not([type="checkbox"]):focus { outline: 2px solid #ff8a3d; outline-offset: 1px; border-color: #ff8a3d; }
.login-tech .login-form .primary { margin-top: 2px; min-height: 46px; color: var(--accent-ink); background: var(--accent-gradient); border-radius: 12px; font-weight: 800; box-shadow: 0 8px 22px rgba(255, 171, 112,.22); }
.login-tech .login-form .primary:hover:not(:disabled) { filter: brightness(1.08); }
.login-tech .login-form .primary:disabled { opacity: .85; cursor: progress; }
.login-tech .login-form .primary:disabled::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 9px; vertical-align: -2px; border: 2px solid rgba(15, 15, 15, .35); border-top-color: #0f0f0f; border-radius: 50%; animation: login-spin .8s linear infinite; }
@keyframes login-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .login-tech .login-form .primary:disabled::before { animation: none; } }
.login-tech .caps-hint { margin: -4px 0 0; color: #ffd9a3; font-size: .78rem; font-weight: 700; }
.login-tech .login-extras { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.login-tech .remember { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .78rem; color: #bbbbbb; cursor: pointer; }
.login-tech .remember input { width: 16px; height: 16px; margin: 0; accent-color: #ff8a3d; }
.login-tech .login-extras .text-button { color: #ff8a3d; font-size: .78rem; font-weight: 700; cursor: pointer; }
.login-tech .forgot-help { margin: 0; padding: 10px 12px; border: 1px dashed #414141; border-radius: 9px; color: #bbbbbb; font-size: .8rem; }
.login-tech .login-security { margin: 20px 0 0; color: #868686; font: .7rem/1.4 ui-monospace, "Cascadia Code", Consolas, monospace; text-align: left; }
.login-tech .login-error { border: 1px solid rgba(239, 115, 120, .4); }
/* A tela de troca de senha usa o mesmo tema */
#passwordGate.login-gate { background: linear-gradient(rgba(255, 138, 61, .045) 1px, transparent 1px) 0 0 / 44px 44px, linear-gradient(90deg, rgba(255, 138, 61, .045) 1px, transparent 1px) 0 0 / 44px 44px, #202020; }
#passwordGate .login-card { border: 1px solid #363636; border-radius: 16px; background: #141414; backdrop-filter: none; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
#passwordGate .login-form .primary { color: #0f0f0f; background: #ff8a3d; border-radius: 9px; font-weight: 800; }
@media (max-width: 820px) {
  .login-tech .login-shell { grid-template-columns: 1fr; max-width: 460px; }
  .login-tech .login-aside { display: none; }
  .login-tech .login-brand-compact { display: flex; }
  .login-tech .login-card { padding: 28px 22px; }
}

/* Provedor de IA (menu Acessos) */
.ai-provider-list { display: grid; gap: 10px; padding: 0 20px 20px; }
.ai-provider-option { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.ai-provider-option input { grid-row: 1 / span 2; margin: 0; }
.ai-provider-name { font-weight: 700; }
.ai-provider-model { grid-column: 2; color: var(--muted); font-size: .78rem; font: .78rem ui-monospace, "Cascadia Code", Consolas, monospace; }
.ai-provider-active { border-color: var(--teal); background: var(--teal-soft); }
.ai-provider-pending { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.ai-provider-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 0 20px 20px; }
.ai-provider-hint { margin: 0; color: var(--muted); font-size: .82rem; }
.ai-provider-actions .primary:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }
.ai-provider-off { opacity: .55; cursor: not-allowed; }
.ai-provider-off input { cursor: not-allowed; }

/* Calendário Nexus: o mês orienta a navegação; a linha de horários organiza o dia. */
.nexus-heading { display:flex; justify-content:space-between; align-items:center; gap:18px; margin-bottom:20px; }
.nexus-heading h2 { margin:0; }
.nexus-notice { color:var(--muted); font-size:.86rem; }
.nexus-grid { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(280px,1fr); gap:20px; align-items:start; }
.nexus-month-head h3 { text-transform:capitalize; margin:0; text-align:center; }
.nexus-weekdays,.nexus-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); padding:0 16px; gap:4px; }
.nexus-weekdays { color:var(--muted); font-size:.75rem; text-align:center; margin:10px 0; }
.nexus-days button { position:relative; min-height:58px; background:transparent; color:var(--ink); border:1px solid transparent; border-radius:12px; font:500 .95rem ui-monospace,Consolas,monospace; }
.nexus-days button:hover { background:var(--blue-soft); }
.nexus-days button[aria-pressed="true"] { background:var(--accent-gradient); color:var(--accent-ink); font-weight:800; }
.nexus-days button.nexus-today { border-color:var(--teal); }
.nexus-days button.nexus-has-event::after { content:""; position:absolute; width:5px; height:5px; border-radius:50%; background:currentColor; bottom:7px; left:calc(50% - 2.5px); }
.nexus-calendar-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px; font-size:.7rem; color:var(--muted); }
.nexus-calendar-foot .text-button { color:var(--teal); white-space:nowrap; }
.nexus-list { padding:0 20px 20px; }
.nexus-entry { padding:15px 0; border-top:1px solid var(--line); overflow-wrap:anywhere; }
.nexus-attachments { margin-top:10px; }
.nexus-attachments-body { margin-top:6px; }
.nexus-attachments-list { margin:0; padding:0; list-style:none; display:grid; gap:8px; }
.nexus-attachments-list li { font-size:.85rem; }
.nexus-entry h4 { margin:5px 0; font-size:.95rem; }
.nexus-entry p { margin:5px 0; font-size:.8rem; color:var(--muted); }
.nexus-entry time { font:600 .8rem ui-monospace,Consolas,monospace; color:var(--teal); }
.nexus-status { display:inline-block; padding:3px 8px; border-radius:6px; background:var(--blue-soft); color:var(--blue); font-size:.72rem; }
.nexus-status[data-status="approved"],.nexus-status[data-status="confirmed"] { color:var(--green); background:var(--green-soft); }
.nexus-status[data-status="pending"],.nexus-status[data-status="alternative"] { color:var(--amber); background:var(--amber-soft); }
.nexus-status[data-status="cancelled"],.nexus-status[data-status="rejected"] { color:var(--muted); background:var(--canvas); }
.nexus-category { display:inline-block; margin-left:6px; padding:3px 8px; border-radius:6px; background:var(--canvas); color:var(--muted); font-size:.72rem; }
.nexus-availability { display:grid; gap:10px; border-top:1px solid var(--line); padding:20px; }
.nexus-availability h3,.nexus-availability p { margin:0; }
.nexus-availability label,.nexus-form label { display:grid; gap:6px; font-size:.8rem; }
.nexus-times { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.nexus-requests { margin-top:20px; }
.nexus-request-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.nexus-request-actions button { font-size:.76rem; }
.nexus-dialog { width:min(580px,calc(100vw - 28px)); }
.nexus-form,.nexus-form #nexusCreateFields,.nexus-form #nexusPeriodFields { display:grid; gap:14px; }
.nexus-form fieldset { border:1px solid var(--line); border-radius:12px; padding:12px; }
#nexusParticipants { display:grid; gap:8px; max-height:170px; overflow:auto; }
#nexusParticipants label { display:flex; gap:8px; align-items:center; }
#nexusParticipants input { width:auto; }
.nexus-preview { overflow-wrap:anywhere; }
.nexus-preview dl { display:grid; grid-template-columns:auto 1fr; gap:8px 18px; }
.nexus-preview dt { color:var(--muted); }
.nexus-preview dd { margin:0; }
.nexus-warning { border-left:3px solid var(--amber); padding:10px; background:var(--amber-soft); color:var(--ink); }
#nexusChatLog { max-height:280px; overflow:auto; padding:0; }
#nexusChatLog .nexus-entry { padding:10px 14px; border-radius:12px; border-top:none; margin-bottom:8px; max-width:85%; }
#nexusChatLog .nexus-entry p { margin:0; color:var(--ink); font-size:.85rem; }
#nexusChatLog .nexus-chat-user { background:var(--blue-soft); margin-left:auto; }
#nexusChatLog .nexus-chat-assistant { background:var(--canvas); margin-right:auto; }
.nexus-dialog button:focus-visible,.nexus-days button:focus-visible { outline:2px solid var(--teal); outline-offset:3px; }
@media(max-width:1000px) { .nexus-grid { grid-template-columns:1fr; } }
@media(max-width:560px) { .nexus-heading { align-items:stretch; flex-direction:column; } .nexus-days button { min-height:44px; } .nexus-calendar-foot { align-items:flex-start; } .nexus-preview dl { grid-template-columns:1fr; gap:3px; } .nexus-preview dd { margin-bottom:8px; } }

.nexus-command { padding:20px; margin:0 0 20px; display:grid; gap:12px; }
.nexus-command h3,.nexus-command p { margin:0; }
#nexusMessageForm { display:flex; gap:10px; }
#nexusMessageForm .voice-field { flex:1; min-width:0; }
.nexus-examples { display:flex; gap:14px; flex-wrap:wrap; }
.nexus-examples .text-button { color:var(--teal); font-size:.78rem; text-align:left; }
#nexusMessageResult { overflow-wrap:anywhere; }
@media(max-width:560px) { #nexusMessageForm { flex-direction:column; } }

/* A esfera acompanha a pergunta à IA existente, sem criar um segundo chat. */
.command-card .nexus-home-orb-wrap { width:80px; height:80px; align-self:center; justify-self:center; }
@media(max-width:600px) { .command-card .nexus-home-orb-wrap { width:70px; height:70px; } }

.nexus-jump { display:flex; align-items:center; gap:12px; padding:0 20px; color:var(--muted); font-size:.78rem; }
.nexus-jump input { flex:1; width:auto; min-width:0; }

/* Marca Nexus: assinatura completa no acesso e símbolo compacto na navegação. */
.nexus-brand-icon { display:block; flex:none; width:44px; height:44px; background:url("nexus-logo-transparent.png?v=6.12.6") -15px -10px / 190px 63px no-repeat; }
.login-logo-panel { position:relative; width:100%; padding:0; border:0; background:transparent; box-shadow:none; }
.nexus-logo-full { display:block; width:100%; height:auto; object-fit:contain; }
.nexus-logo-light { position:absolute; inset:0; pointer-events:none; background:url("nexus-logo-transparent.png?v=6.12.6") center / 100% 100% no-repeat; filter:brightness(0) invert(1); opacity:.92; }
.nexus-logo-light-left { clip-path:inset(26% 40% 33% 34%); }
.nexus-logo-light-right { clip-path:inset(26% 4% 33% 72%); }
.nexus-logo-light-subtitle { clip-path:inset(69% 4% 20% 34%); }
.login-tech .login-brand-compact.login-logo-panel { max-width:300px; margin-bottom:24px; padding:0; }
@media (max-width:430px) { .login-tech .login-brand-compact.login-logo-panel { max-width:260px; } }

.nexus-mobile-brand { display:none; }
@media (max-width:720px) { .nexus-mobile-brand { display:flex; align-items:center; gap:8px; margin-bottom:14px; font-size:.82rem; font-weight:800; letter-spacing:.04em; text-transform:uppercase; } .nexus-mobile-brand .nexus-brand-icon { width:38px; height:38px; background-size:164px 55px; background-position:-13px -8px; } }

/* iPad/Safari: calendário em sete colunas e campos nativos contidos no painel. */
.nexus-grid, .nexus-month, .nexus-day { min-width:0; }
.nexus-month .nexus-month-head { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; }
.nexus-month-head h3 { min-width:0; }
.nexus-weekdays, .nexus-days { width:100%; min-width:0; grid-template-columns:repeat(7,minmax(0,1fr)); }
.nexus-weekdays span { min-width:0; text-align:center; white-space:nowrap; }
.nexus-days button { display:block; width:100%; min-width:0; -webkit-appearance:none; appearance:none; text-align:center; }
.nexus-jump { display:grid; grid-template-columns:max-content minmax(0,1fr); align-items:center; }
.nexus-jump input, .nexus-times input { display:block; width:100%; max-width:100%; min-width:0; box-sizing:border-box; }
.nexus-times { grid-template-columns:repeat(2,minmax(0,1fr)); }
.nexus-times label { min-width:0; }
@media(max-width:560px) { .nexus-jump { grid-template-columns:1fr; gap:6px; } .nexus-weekdays,.nexus-days { padding-inline:4px; gap:2px; } }

/* O Nexus usa a caixa de conversa global também na tela do calendário. */
.nexus-command[hidden] { display: none !important; }
.answer-panel #answerText { white-space: pre-line; }


/* Controles da resposta falada na caixa única do Nexus. */
.nexus-voice-controls { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.nexus-voice-settings, .nexus-voice-actions { display: flex; align-items: end; gap: 9px; flex-wrap: wrap; }
.nexus-voice-settings label { min-width: 130px; color: var(--muted); font-size: .74rem; font-weight: 700; }
.nexus-voice-settings select { display: block; min-height: 36px; margin-top: 4px; font-size: .82rem; }
.nexus-voice-actions { align-items: center; margin-top: 10px; }
.nexus-voice-actions button { min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); }
.nexus-voice-actions button:first-child { border-color: var(--teal); color: var(--accent-ink); background: var(--accent-gradient); font-weight: 750; }
.nexus-voice-actions button:disabled { opacity: .48; cursor: not-allowed; }
#nexusVoiceStatus { color: var(--muted); font-size: .76rem; }
.nexus-voice-disclosure { margin: 9px 0 0; color: var(--muted); font-size: .7rem; }
@media (max-width: 520px) { .nexus-voice-settings label { flex: 1 1 42%; } .nexus-voice-actions button { flex: 1 1 auto; } }

/* Calculadora: painel próprio no menu, com digitação e teclas para toque. */
.calculator-dialog { width: min(420px, calc(100vw - 24px)); max-height: min(90vh, 740px); overflow-y: auto; padding: 24px; }
.calculator-dialog .dialog-heading { padding-right: 28px; margin-bottom: 16px; }
.calculator-dialog .today-label { margin: 8px 0 0; }
.calculator-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .76rem; font-weight: 700; }
.calculator-expression { min-height: 56px; text-align: right; font: 700 1.45rem/1.2 ui-monospace, "Cascadia Code", Consolas, monospace; font-variant-numeric: tabular-nums; }
.calculator-result { display: block; min-height: 66px; margin: 10px 0 14px; padding: 13px 14px; border: 1px solid #2e2e2e; border-radius: 12px; color: #dedede; background: #141414; text-align: right; font: 750 1.35rem/1.4 ui-monospace, "Cascadia Code", Consolas, monospace; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calculator-result.calculator-error { color: #ffd1d3; border-color: #8c444d; background: #38242c; font-family: inherit; font-size: .87rem; font-weight: 600; line-height: 1.4; }
.calculator-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.calculator-keys button { min-height: 49px; border: 1px solid #323232; border-radius: 11px; color: #f2f2f2; background: #202020; font: 750 1.08rem/1 ui-monospace, "Cascadia Code", Consolas, monospace; }
.calculator-keys button:hover { background: #2b2b2b; }
.calculator-keys button:nth-child(4n), .calculator-keys button[data-calc-key="% de "] { color: #ffab70; background: #1d1d1d; }
.calculator-keys button[data-calc-action] { color: #cccccc; font-family: inherit; font-size: .82rem; }
.calculator-keys button:focus-visible, .calculator-equals:focus-visible, #calculatorBtn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.calculator-equals { width: 100%; min-height: 48px; margin-top: 10px; font-size: 1rem; }
@media (max-width: 430px) {
  .calculator-dialog { padding: 18px; }
  .calculator-keys { gap: 6px; }
  .calculator-keys button { min-height: 44px; }
}

/* No celular, cinco destinos principais permanecem legíveis na barra inferior.
   Reunião continua no botão do topo; Acessos fica no menu da conta. */
@media (min-width: 721px) { #accessMenuBtn { display: none !important; } }
@media (max-width: 720px) {
  .sidebar nav .nav-item[data-view="reuniao"],
  .sidebar nav .nav-item[data-view="acessos"] { display: none !important; }
  .sidebar nav, .manager-mode .sidebar nav { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .sidebar .nav-item { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.1; }
}

@media (min-width: 1051px) { #exportMenuBtn { display: none !important; } }

/* PWA: instalação opcional e bloqueio visual de dados enquanto a conexão cai. */
.install-app-button { width: fit-content; padding: 4px 0; border: 0; color: var(--teal); background: none; font-size: .78rem; font-weight: 700; text-align: left; }
.install-app-button:hover { text-decoration: underline; }
.login-card .install-app-button { margin-top: 14px; color: #ffab70; }
.offline-overlay { position: fixed; z-index: 10000; inset: 0; display: grid; place-items: center; padding: 24px; background: #202020; }
.offline-card { width: min(440px, 100%); padding: 32px; border: 1px solid #363636; border-radius: 20px; color: #f4f4f4; background: #141414; }
.offline-card h2 { margin: 22px 0 10px; font-size: 1.5rem; }
.offline-card p { color: #bcbcbc; }
.offline-card .primary { margin-top: 12px; }
.offline-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; color: #17110d; background: var(--accent-gradient); font-size: 30px; font-weight: 900; }
.install-help-dialog { width: min(430px, calc(100% - 32px)); }
.install-help-dialog p { color: var(--muted); }

.sector-nav { display:grid; gap:4px; margin-top:16px; padding-top:16px; border-top:1px solid #282828; }
.sector-item { display:flex; align-items:center; gap:12px; min-height:44px; border:0; border-radius:9px; padding:9px 14px; text-align:left; color:#c4c4c4; background:transparent; }
.sector-icon { width:20px; height:20px; flex-shrink:0; color:var(--teal); }
.sector-item:hover, .sector-item.active { color:var(--ink); background:#30261f; box-shadow:inset 3px 0 var(--teal); }
.sector-item:hover .sector-icon, .sector-item.active .sector-icon { color:var(--teal); }
.nexus-sector-filter { display:flex; align-items:center; gap:12px; margin:16px 0; }
@media (min-width:761px) and (max-width:1050px) { .sector-item { justify-content:center; padding-inline:9px; gap:0; } .sector-item > span { display:none; } .sector-nav > .eyebrow { font-size:.6rem; } }
@media(max-width:760px) { .sector-nav { display:none; } .nexus-sector-filter select { max-width:75%; } }

.nexus-state-label { color: var(--accent, #ff8a3d); font-size: .85rem; margin: .35rem 0; }
#nexusMemoryPanel { margin: .8rem 0; }
#nexusMemoryPanel textarea { width: 100%; box-sizing: border-box; }

/* Marca existente em cinza, coerente com os cartões grafite. */
.nexus-logo-full, .nexus-brand-icon { filter: grayscale(1); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--teal); }

/* Conta da Presidência: visão executiva mais limpa (sem o gráfico "Status geral" e sem o quadro "Diretorias"). Só esta conta; os demais perfis ficam como antes. */
body.executive-clean .pulse-panel, body.executive-clean .directorates-panel { display: none; }
body.executive-clean .dashboard-grid { grid-template-columns: 1fr; }
