/* ==========================================================================
   Identidade visual mrk (mesmos tokens do mrk educa)
   Azul profundo #0A3A8C / #0056B3, turquesa #00A896 e verde-lima #8AC926.
   Os tokens ficam em :root e em html[data-theme] para alcançar também
   diálogos e menus do MUI, que são renderizados fora do .app-shell.
   ========================================================================== */
:root {
  --c-bg: #eef2f7;
  --c-surface: #ffffff;
  --c-surface2: #f3f6fa;
  --c-line: #dde5ef;
  --c-ink: #13294b;
  --c-muted: #5d6f88;
  --c-brand: #0056b3;
  --c-brand-strong: #0a3a8c;
  --c-brand-soft: #e6effa;
  --c-accent: #00a896;
  --c-accent-soft: #e0f5f2;
  --c-lime: #5f9a12;
  --c-lime-soft: #eef7df;
  --c-danger: #d64550;
  --c-danger-soft: #fdecee;
  --c-warn: #c9730f;
  --c-warn-soft: #fdf1e1;
  --c-ok: #3f8a12;
  --c-ok-soft: #ebf6dd;
  --c-on-brand: #ffffff;
  --gradient: linear-gradient(135deg, #0a3a8c 0%, #0056b3 55%, #0a8fb0 100%);
  --shadow-card: 0 1px 2px rgba(20, 40, 74, .04), 0 4px 16px -8px rgba(20, 40, 74, .10);
  --shadow-stat: 0 1px 2px rgba(20, 40, 74, .04), 0 3px 10px -6px rgba(20, 40, 74, .10);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
html[data-theme="escuro"], .app-shell[data-theme="escuro"] {
  --c-bg: #0a1322;
  --c-surface: #101c2f;
  --c-surface2: #15233a;
  --c-line: #22344f;
  --c-ink: #e6edf6;
  --c-muted: #93a4ba;
  --c-brand: #5aa2f0;
  --c-brand-strong: #82bbf6;
  --c-brand-soft: #142f52;
  --c-accent: #2fd3bd;
  --c-accent-soft: #0e3330;
  --c-lime: #a6dd4c;
  --c-lime-soft: #1f2f0d;
  --c-danger: #f26b70;
  --c-danger-soft: #3a1619;
  --c-warn: #f0b350;
  --c-warn-soft: #3a2a10;
  --c-ok: #a6dd4c;
  --c-ok-soft: #1f2f0d;
  --c-on-brand: #06142b;
  --shadow-card: 0 16px 40px -20px rgba(0, 0, 0, .6);
  --shadow-stat: 0 10px 24px -16px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #root { min-height: 100%; width: 100%; }
body { margin: 0; overflow-x: hidden; background: var(--c-bg); color: var(--c-ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--c-brand); }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes network-pulse { 0%, 100% { opacity: .45; transform: scale(.82); } 50% { opacity: 1; transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ============================================================ Marca */
.brand-lockup { display: inline-flex; min-width: 0; align-items: center; gap: 12px; }
.brand-logo { width: 48px; height: 48px; flex: 0 0 auto; padding: 5px; object-fit: contain; border-radius: 16px; background: #fff; box-shadow: 0 4px 10px rgba(10, 58, 140, .15); outline: 1px solid var(--c-line); }
.brand-copy { min-width: 0; display: flex; flex-direction: column; }
.brand-word { font-size: 21px; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--c-brand-strong); white-space: nowrap; }
.brand-word-accent { color: #7cb82f; }
html[data-theme="escuro"] .brand-word-accent { color: var(--c-lime); }
.brand-sub { margin-top: 4px; overflow: hidden; color: var(--c-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.brand-lockup.is-compact .brand-logo { width: 40px; height: 40px; border-radius: 14px; }
.brand-lockup.is-light .brand-word { color: #fff; }
.brand-lockup.is-light .brand-word-accent { color: #b5e05a; }
.brand-lockup.is-light .brand-sub { color: rgba(255, 255, 255, .75); }
.brand-lockup.is-light .brand-logo { outline: 0; }

/* ============================================================ Login (painel dividido) */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--c-bg); }
.login-hero { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 48px 48px; color: #fff; background: linear-gradient(155deg, #255294 0%, #346bb5 42%, #4484cc 78%, #3a9bb3 100%); }
.login-network { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.login-network-node { transform-box: fill-box; transform-origin: center; animation: network-pulse 4.8s ease-in-out infinite; }
.login-hero > :not(svg) { position: relative; z-index: 1; width: 100%; max-width: 576px; margin-inline: auto; }
.login-hero-body { margin-block: auto; padding-block: 56px; }
.login-kicker { display: flex; align-items: center; gap: 8px; margin: 0; color: rgba(255, 255, 255, .9); font-size: 14px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.login-kicker span { width: 12px; height: 12px; border-radius: 50%; background: #8ac926; }
.login-headline { margin: 28px 0 0; font-size: 52px; font-weight: 800; line-height: 1.04; letter-spacing: -.035em; }
.login-headline span { color: #b5e05a; }
.login-subtitle { max-width: 512px; margin: 28px 0 0; color: rgba(255, 255, 255, .85); font-size: 17px; line-height: 1.65; }
.login-pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 44px; }
.login-pillar { padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .3); }
.login-pillar svg { width: 20px; height: 20px; color: #b5e05a; }
.login-pillar-title { margin: 12px 0 0; font-size: 16px; font-weight: 700; }
.login-pillar-text { margin: 6px 0 0; color: rgba(255, 255, 255, .75); font-size: 13px; line-height: 1.5; }
.login-hero-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; color: rgba(255, 255, 255, .8); font-size: 13px; }
.login-hero-foot svg { width: 16px; height: 16px; }
.login-panel { display: flex; flex-direction: column; padding: 40px 24px; background: linear-gradient(180deg, #f7f9fc 0%, #eaf0f7 100%); }
html[data-theme="escuro"] .login-panel { background: var(--c-bg); }
.login-panel-eyebrow { margin: 0; color: rgba(19, 41, 75, .7); font-size: 11px; font-weight: 700; letter-spacing: .2em; text-align: center; text-transform: uppercase; }
.login-panel-eyebrow span { margin: 0 8px; }
.login-panel-body { flex: 1; display: flex; align-items: center; justify-content: center; padding-block: 40px; }
.login-form { width: 100%; max-width: 400px; }
.login-form .eyebrow { font-size: 11px; }
.login-mobile-logo { display: none; width: 80px; height: 80px; margin-bottom: 24px; padding: 10px; object-fit: contain; border-radius: 24px; background: #fff; box-shadow: 0 10px 24px rgba(10, 58, 140, .1); outline: 1px solid var(--c-line); }
.login-title { margin: 12px 0 0; color: var(--c-ink); font-size: 32px; font-weight: 800; letter-spacing: -.03em; }
.login-lead { margin: 12px 0 0; color: var(--c-muted); font-size: 14px; line-height: 1.5; }
.login-label { display: block; margin-top: 24px; color: var(--c-ink); font-size: 13px; font-weight: 700; }
.login-lead + .login-label { margin-top: 32px; }
.login-input { display: block; width: 100%; height: 48px; margin-top: 8px; padding: 0 16px; border: 1px solid var(--c-line); border-radius: 12px; outline: 0; background: var(--c-surface); color: var(--c-ink); font: inherit; font-size: 14px; }
.login-input::placeholder { color: rgba(93, 111, 136, .7); }
.login-input:focus { border-color: var(--c-brand); box-shadow: 0 0 0 3px rgba(0, 86, 179, .15); }
.login-password { position: relative; }
.login-password .login-input { padding-right: 96px; }
.login-show { position: absolute; top: 6px; right: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-surface2); color: var(--c-ink); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.login-show:hover { background: var(--c-brand-soft); }
.login-forgot { margin-top: 12px; text-align: right; }
.login-text-link { padding: 0; border: 0; background: none; color: var(--c-brand); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.login-text-link:hover { text-decoration: underline; }
.login-text-link.is-center { display: block; width: 100%; margin-top: 16px; text-align: center; }
.login-alert { margin-top: 16px; }
.login-submit { display: flex; width: 100%; height: 52px; align-items: center; gap: 8px; margin-top: 28px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--c-brand-strong); color: var(--c-on-brand); font: inherit; font-size: 14px; font-weight: 600; box-shadow: 0 10px 15px -3px rgba(10, 58, 140, .25); cursor: pointer; transition: background .15s; }
.login-submit span { flex: 1; text-align: left; }
.login-submit svg { width: 18px; height: 18px; }
.login-submit:hover { background: var(--c-brand); }
.login-submit:disabled { opacity: .6; cursor: not-allowed; }
.login-submit.is-center { justify-content: center; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--c-muted); font-size: 12px; }
.login-divider span { flex: 1; height: 1px; background: var(--c-line); }
.login-secondary { display: flex; width: 100%; height: 48px; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-surface); color: var(--c-ink); font: inherit; font-size: 14px; font-weight: 700; box-shadow: 0 1px 2px rgba(20, 40, 74, .05); cursor: pointer; }
.login-secondary:hover { border-color: rgba(0, 86, 179, .4); }
.login-secondary svg { width: 18px; height: 18px; color: var(--c-brand); }
.login-secondary strong { color: #1351b4; font-weight: 800; }
.login-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 28px 0 0; font-size: 12px; }
.login-links a { color: var(--c-brand); font-weight: 600; text-decoration: none; }
.login-links a:hover { text-decoration: underline; }
.login-panel-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; color: var(--c-muted); font-size: 12px; }
.login-panel-foot img { width: 20px; height: 20px; object-fit: contain; }
@media (min-width: 1280px) { .login-hero { padding-inline: 80px; } .login-headline { font-size: 60px; } }
@media (max-width: 1023px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-mobile-logo { display: block; }
}

/* ============================================================ Shell: menu lateral */
.app-shell { min-height: 100vh; display: flex; background: var(--c-bg); color: var(--c-ink); font-family: var(--font-sans); }
.side-desktop { position: sticky; top: 0; flex: 0 0 292px; width: 292px; height: 100vh; border-right: 1px solid var(--c-line); background: var(--c-surface); }
.side-mobile { width: 292px; max-width: calc(100vw - 40px); background: var(--c-surface) !important; }
.side-mobile-close { position: absolute !important; top: 24px; right: 12px; z-index: 2; }
.sidebar { height: 100%; display: flex; flex-direction: column; }
.sidebar-head { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 20px 20px 16px; }
.sidebar-crest { width: 48px; height: 48px; flex: 0 0 auto; object-fit: contain; }
.sidebar-head-copy { min-width: 0; display: flex; flex-direction: column; }
.sidebar-kicker { color: var(--c-muted); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-city { overflow: hidden; color: var(--c-brand-strong); font-size: 17px; font-weight: 800; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-org { margin-top: 2px; overflow: hidden; color: var(--c-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-search-wrap { padding: 0 16px 8px; }
.sidebar-search { position: relative; display: block; }
.sidebar-search svg { position: absolute; top: 50%; left: 14px; width: 16px; height: 16px; transform: translateY(-50%); color: var(--c-muted); pointer-events: none; }
.sidebar-search input { width: 100%; height: 44px; padding: 0 12px 0 40px; border: 1px solid var(--c-line); border-radius: 12px; outline: 0; background: var(--c-surface); color: var(--c-ink); font: inherit; font-size: 14px; box-shadow: 0 1px 2px rgba(20, 40, 74, .05); }
.sidebar-search input::placeholder { color: rgba(93, 111, 136, .8); }
.sidebar-search input:focus { border-color: var(--c-brand); box-shadow: 0 0 0 3px rgba(0, 86, 179, .15); }
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 16px; scrollbar-width: thin; }
.sidebar-section { margin-top: 16px; }
.sidebar-section-title { margin: 0; padding: 0 12px 8px; color: var(--c-muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-group { margin-bottom: 4px; }
.sidebar-group-btn { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--c-ink); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.sidebar-group-btn:hover { background: var(--c-surface2); }
.sidebar-group-btn.is-active { background: var(--c-brand-soft); color: var(--c-brand-strong); }
.sidebar-group-icon { display: flex; width: 32px; height: 32px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 8px; background: var(--c-surface2); color: var(--c-muted); }
.sidebar-group-icon svg { width: 18px; height: 18px; }
.sidebar-group-btn.is-active .sidebar-group-icon { background: var(--c-surface); color: var(--c-brand); box-shadow: 0 1px 2px rgba(20, 40, 74, .08); }
.sidebar-group-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-chevron { width: 16px !important; height: 16px !important; color: var(--c-muted); transition: transform .18s; }
.sidebar-chevron.is-open { transform: rotate(180deg); }
.sidebar-items { position: relative; display: flex; flex-direction: column; gap: 2px; margin: 4px 0 0 27px; padding-left: 12px; border-left: 1px solid var(--c-line); }
.sidebar-item { position: relative; display: block; overflow: hidden; padding: 8px 12px; border-radius: 8px; color: rgba(19, 41, 75, .8); font-size: 13.5px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; transition: background .15s, color .15s; }
html[data-theme="escuro"] .sidebar-item { color: rgba(230, 237, 246, .8); }
.sidebar-item:hover { background: var(--c-surface2); color: var(--c-ink); }
.sidebar-item.is-active { background: var(--c-brand-soft); color: var(--c-brand-strong); font-weight: 600; }
.sidebar-item.is-active::before { content: ''; position: absolute; top: 6px; bottom: 6px; left: -13px; width: 2px; border-radius: 2px; background: var(--c-brand); }
.sidebar-empty { padding: 16px 12px; color: var(--c-muted); font-size: 14px; }
.sidebar-foot { padding: 12px 20px; border-top: 1px solid var(--c-line); }

/* ============================================================ Shell: barra superior */
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; min-height: 76px; align-items: center; gap: 12px; padding: 0 28px; border-bottom: 1px solid var(--c-line); background: color-mix(in srgb, var(--c-surface) 95%, transparent); backdrop-filter: blur(8px); }
.topbar-spacer { flex: 1; }
.square-btn { display: inline-flex; width: 44px; height: 44px; flex: 0 0 auto; align-items: center; justify-content: center; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-surface); color: var(--c-ink); box-shadow: 0 1px 2px rgba(20, 40, 74, .05); cursor: pointer; }
.square-btn:hover { border-color: rgba(0, 86, 179, .4); color: var(--c-brand); }
.square-btn svg { width: 20px; height: 20px; }
.round-btn { display: inline-flex; width: 44px; height: 44px; flex: 0 0 auto; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--c-muted); cursor: pointer; }
.round-btn:hover { background: var(--c-surface2); color: var(--c-ink); }
.round-btn svg { width: 19px; height: 19px; }
.topbar-user-copy { display: flex; min-width: 0; max-width: 300px; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.topbar-user-name { max-width: 100%; overflow: hidden; color: var(--c-ink); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user-role { max-width: 100%; overflow: hidden; color: var(--c-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-avatar { display: flex; width: 44px; height: 44px; flex: 0 0 auto; align-items: center; justify-content: center; overflow: hidden; padding: 0; border: 0; border-radius: 50%; background: var(--c-brand-strong); color: var(--c-on-brand); font: inherit; font-size: 14px; font-weight: 700; box-shadow: 0 0 0 2px var(--c-surface), 0 4px 8px rgba(10, 58, 140, .2); cursor: pointer; }
.topbar-avatar:hover { box-shadow: 0 0 0 2px rgba(0, 86, 179, .4); }
.topbar-avatar img, .account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-logout { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; border: 0; background: none; color: var(--c-muted); font: inherit; font-size: 14px; cursor: pointer; }
.topbar-logout:hover { color: var(--c-ink); }
.topbar-logout svg { width: 16px; height: 16px; }
.content-wrap { width: 100%; max-width: 1600px; flex: 1; margin: 0 auto; padding: 32px; animation: fade-in .18s ease-out; }
@media (max-width: 1279px) { .topbar-user-copy { display: none; } }
@media (max-width: 640px) {
  .topbar { min-height: 64px; padding: 0 16px; }
  .topbar-logout { display: none; }
  .content-wrap { padding: 24px 16px; }
}

/* Menu da conta */
.account-menu { width: min(92vw, 360px); padding: 16px; }
.account-menu .MuiList-root { padding: 0; }
.account-head { display: flex; align-items: center; gap: 12px; }
.account-avatar { display: grid; width: 56px; height: 56px; flex: 0 0 auto; place-items: center; overflow: hidden; border-radius: 50%; background: var(--c-brand-strong); color: var(--c-on-brand); font-size: 18px; font-weight: 700; }
.account-name { color: var(--c-ink); font-weight: 600 !important; }
.account-email { color: var(--c-muted); font-size: 12px !important; }
.account-info { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--c-surface2); font-size: 12px; }
.account-info p { margin: 0; }
.account-info p + p { margin-top: 8px; }
.account-info span { color: var(--c-muted); }
.account-info strong { color: var(--c-ink); }
.account-block { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--c-line); }
.account-block-title { margin: 0 0 8px; color: var(--c-muted); font-size: 12px; font-weight: 600; }
.account-select { width: 100%; height: 40px; padding: 0 8px; border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-surface); color: var(--c-ink); font: inherit; font-size: 14px; }

/* ============================================================ Cabeçalho de página */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.page-header-copy { min-width: 0; }
.page-header .eyebrow { margin-bottom: 6px; }
.page-title { margin: 0; color: var(--c-ink); font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -.025em; }
.page-subtitle { max-width: 960px; margin: 4px 0 0; color: var(--c-muted); font-size: 15px; line-height: 1.5; }
.page-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 640px) { .page-title { font-size: 24px; } .page-header-actions, .page-header-actions .MuiStack-root { width: 100%; } }

/* ============================================================ Indicadores (Stat) */
.stat-card { position: relative; display: flex; min-height: 74px; min-width: 0; align-items: center; gap: 12px; overflow: hidden; padding: 10px 14px; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-surface); box-shadow: var(--shadow-stat); }
.stat-bar { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; }
.stat-icon { display: flex; width: 36px; height: 36px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 8px; }
.stat-icon svg { width: 18px; height: 18px; }
.stat-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.stat-value { color: var(--c-ink); font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-value.size-lg { font-size: 22px; } .stat-value.size-md { font-size: 19px; } .stat-value.size-sm { font-size: 17px; } .stat-value.size-xs { font-size: 15px; }
.stat-label { overflow: hidden; color: var(--c-ink); font-size: 12.5px; font-weight: 600; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.stat-hint { overflow: hidden; color: var(--c-muted); font-size: 11.5px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.stat-card.tone-brand .stat-bar { background: var(--c-brand); } .stat-card.tone-brand .stat-icon { background: var(--c-brand-soft); color: var(--c-brand); }
.stat-card.tone-accent .stat-bar { background: var(--c-accent); } .stat-card.tone-accent .stat-icon { background: var(--c-accent-soft); color: var(--c-accent); }
.stat-card.tone-ok .stat-bar { background: var(--c-ok); } .stat-card.tone-ok .stat-icon { background: var(--c-ok-soft); color: var(--c-ok); }
.stat-card.tone-lime .stat-bar { background: var(--c-lime); } .stat-card.tone-lime .stat-icon { background: var(--c-lime-soft); color: var(--c-lime); }
.stat-card.tone-warn .stat-bar { background: var(--c-warn); } .stat-card.tone-warn .stat-icon { background: var(--c-warn-soft); color: var(--c-warn); }
.stat-card.tone-danger .stat-bar { background: var(--c-danger); } .stat-card.tone-danger .stat-icon { background: var(--c-danger-soft); color: var(--c-danger); }
.stat-card.is-destaque { border-color: transparent; background: var(--gradient); color: #fff; box-shadow: 0 4px 8px rgba(10, 58, 140, .2); }
.stat-card.is-destaque .stat-icon { background: rgba(255, 255, 255, .15); color: #fff; }
.stat-card.is-destaque .stat-value, .stat-card.is-destaque .stat-label { color: #fff; }
.stat-card.is-destaque .stat-hint { color: rgba(255, 255, 255, .75); }
.list-stat-grid, .hero-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mini-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1280px) { .mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .list-stat-grid, .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .list-stat-grid, .hero-grid, .mini-grid { grid-template-columns: 1fr; gap: 10px; } }

/* ============================================================ Cartões, tabelas e filtros */
.content-wrap .MuiCard-root { width: 100%; min-width: 0; }
.content-wrap .MuiCardContent-root { min-width: 0; }
.content-wrap .MuiCardContent-root h6, .content-wrap .MuiCard-root .MuiTypography-h6 { color: var(--c-ink); font-size: 15px; font-weight: 600; }
.admin-table-content { padding: 0 !important; overflow: hidden; }
.table-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--c-line); }
.list-toolbar .table-search { flex: 0 1 400px; }
.resource-table-toolbar { justify-content: space-between; }
.resource-filters { align-items: center; flex: 0 0 auto; }
.resource-filters .MuiFormControl-root { min-width: 130px; }
.table-search { width: min(100%, 400px); }
.table-result-count { margin-left: auto !important; color: var(--c-muted); font-size: 13px !important; }
.resource-table-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; }
.take-select { width: 132px; }
.resource-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--c-line); }
.filter-tabs { min-height: 40px; }
.filter-tabs .MuiTab-root { min-width: auto; min-height: 40px; padding: 8px 14px; color: var(--c-muted); font-size: 13px; }
.filter-tabs .Mui-selected { color: var(--c-brand-strong) !important; }
.filter-tabs .MuiTabs-indicator { height: 2px; border-radius: 2px; background: var(--c-brand); }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { min-width: 760px; }
.data-table .MuiTableHead-root .MuiTableCell-root { padding: 11px 16px; border-color: var(--c-line); background: var(--c-surface2); color: var(--c-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.data-table .MuiTableBody-root .MuiTableCell-root { padding: 11px 16px; border-color: var(--c-line); color: var(--c-ink); font-size: 14px; }
.data-table .MuiTableBody-root .MuiTableRow-root:hover { background: color-mix(in srgb, var(--c-brand-soft) 55%, transparent); }
.data-table .MuiTypography-root { font-size: inherit; }
.data-table .MuiTypography-caption { color: var(--c-muted); font-size: 12px; }
.table-avatar { width: 36px !important; height: 36px !important; border: 1px solid var(--c-line); background: var(--c-brand-soft) !important; color: var(--c-brand-strong) !important; font-size: 14px !important; font-weight: 700; }
.table-loading, .dashboard-loading { display: flex; min-height: 190px; align-items: center; justify-content: center; gap: 10px; color: var(--c-muted); font-size: 14px; }
.org-type-chip, .org-chip, .soft-chip { border: 1px solid var(--c-line) !important; background: var(--c-surface2) !important; color: var(--c-muted) !important; }
.org-type-chip.type-prefeitura { border-color: transparent !important; background: var(--c-ok-soft) !important; color: var(--c-ok) !important; }
.org-type-chip.type-smtt, .org-type-chip.type-dmtt { border-color: transparent !important; background: var(--c-brand-soft) !important; color: var(--c-brand) !important; }
.MuiChip-colorSuccess { border: 0 !important; background: var(--c-ok-soft) !important; color: var(--c-ok) !important; }
.MuiChip-colorWarning { border: 0 !important; background: var(--c-warn-soft) !important; color: var(--c-warn) !important; }
.MuiChip-colorError { border: 0 !important; background: var(--c-danger-soft) !important; color: var(--c-danger) !important; }
.MuiChip-colorDefault:not(.org-type-chip):not(.org-chip):not(.soft-chip) { background: var(--c-surface2); color: var(--c-muted); }
.row-context-menu { min-width: 220px; }
.row-context-menu .MuiMenuItem-root { min-height: 38px; margin: 2px 6px; border-radius: 8px; font-size: 14px; }
.row-context-menu .MuiListItemIcon-root { min-width: 30px; color: var(--c-muted); }
.row-context-menu .context-danger, .row-context-menu .context-danger .MuiListItemIcon-root { color: var(--c-danger); }
.row-context-menu .context-danger:hover { background: var(--c-danger-soft); }
@media (max-width: 720px) {
  .table-toolbar { align-items: stretch; padding: 12px; }
  .table-search, .list-toolbar .table-search { width: 100%; flex: 1 1 100%; }
  .table-result-count { margin-left: 0 !important; }
  .resource-filters { flex-wrap: wrap; }
  .resource-table-meta, .resource-pagination { align-items: flex-start; flex-direction: column; }
}

/* ============================================================ Painel: gráfico de atividade */
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(360px, 1fr); gap: 16px; align-items: stretch; }
.chart-card-content { padding: 20px !important; }
.chart-heading { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 16px; }
.chart-heading > div:first-child { min-width: 0; }
.chart-heading .MuiTypography-body2 { margin-top: 2px; color: var(--c-muted); font-size: 13px; }
.chart-mode-active { background: var(--c-brand-soft) !important; color: var(--c-brand) !important; }
.chart-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.chart-metric { display: flex; min-width: 0; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-surface2); }
.chart-metric-label { color: var(--c-muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.chart-metric-value { color: var(--c-ink); font-size: 18px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.chart-metric-note { overflow: hidden; color: var(--c-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.chart-series-tabs { margin-top: 12px; }
.chart-series-tabs .MuiButton-root { min-width: 0; min-height: 32px; padding: 4px 12px; font-size: 13px; }
.activity-chart { position: relative; width: 100%; margin-top: 12px; }
.activity-chart svg { display: block; width: 100%; height: 280px; overflow: visible; }
.chart-gridline { stroke: var(--c-line); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-baseline { stroke-dasharray: none; }
.chart-axis-label { fill: var(--c-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--chart-series-color, var(--c-brand)); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-focus-line { stroke: var(--chart-series-color, var(--c-brand)); stroke-width: 1.5; stroke-dasharray: 3 5; opacity: .32; vector-effect: non-scaling-stroke; }
.chart-point-hit { fill: transparent; stroke: none; cursor: pointer; }
.chart-point-hit:focus { outline: none; }
.chart-point-hit:focus-visible { stroke: var(--chart-series-color, var(--c-brand)); stroke-width: 2; stroke-opacity: .48; }
.chart-point-halo { fill: color-mix(in srgb, var(--chart-series-color, var(--c-brand)) 18%, transparent); }
.chart-point { fill: var(--c-surface); stroke: var(--chart-series-color, var(--c-brand)); stroke-width: 2.5; pointer-events: none; vector-effect: non-scaling-stroke; }
.chart-selected-value { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--c-line); border-radius: 10px; color: var(--c-muted); font-size: 13px; }
.chart-selected-value > span { display: inline-flex; align-items: center; gap: 8px; }
.chart-selected-value i { width: 8px; height: 8px; border-radius: 50%; background: var(--chart-series-color, var(--c-brand)); }
.chart-selected-value strong { color: var(--c-ink); font-weight: 700; }
.chart-empty { display: grid; min-height: 180px; place-items: center; border: 1px dashed var(--c-line); border-radius: 12px; text-align: center; }
@media (max-width: 1120px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ============================================================ Boas-vindas */
.welcome-page { display: grid; min-height: calc(100vh - 9rem); place-items: center; padding: 24px 0; }
.welcome-card { position: relative; width: 100%; max-width: 672px; overflow: hidden; border: 1px solid var(--c-line); border-radius: 24px; background: var(--c-surface); text-align: center; box-shadow: 0 2px 4px rgba(20, 40, 74, .04), 0 24px 60px -28px rgba(20, 40, 74, .35); }
.welcome-card-glow { position: absolute; inset: 0 0 auto; height: 160px; pointer-events: none; background: linear-gradient(180deg, color-mix(in srgb, var(--c-brand-soft) 70%, transparent), transparent); }
.welcome-card-content { position: relative; display: flex; flex-direction: column; align-items: center; padding: 40px 48px; }
.welcome-crest { width: 192px; height: 192px; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(10, 40, 90, .18)); }
.welcome-municipality-eyebrow { margin: 24px 0 0; color: var(--c-muted); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.welcome-municipality-title { margin: 4px 0 0; color: var(--c-brand-strong); font-size: 36px; font-weight: 800; line-height: 1.15; letter-spacing: -.025em; }
.welcome-agency-name { margin: 8px 0 0; color: var(--c-ink); font-size: 15px; font-weight: 600; }
.welcome-agency-logo { max-width: 220px; height: 56px; margin-top: 20px; object-fit: contain; }
.welcome-divider { width: 96px; height: 1px; margin: 28px 0; background: var(--c-line); }
.welcome-greeting { margin: 0; color: var(--c-ink); font-size: 20px; font-weight: 600; }
.welcome-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin: 16px 0 0; padding: 0; color: var(--c-muted); font-size: 13px; list-style: none; }
.welcome-meta li { display: inline-flex; align-items: center; gap: 6px; }
.welcome-meta svg { width: 16px; height: 16px; }
.welcome-date::first-letter { text-transform: uppercase; }
@media (max-width: 640px) {
  .welcome-card-content { padding: 32px 22px; }
  .welcome-crest { width: 160px; height: 160px; }
  .welcome-municipality-title { font-size: 30px; }
}

/* ============================================================ Diálogos e formulários */
.MuiDialog-paper { box-shadow: 0 24px 70px rgba(20, 40, 74, .25) !important; }
.MuiDialogTitle-root { position: relative; padding: 18px 56px 16px 24px !important; color: var(--c-ink); font-size: 17px !important; font-weight: 700 !important; }
.dialog-close { position: absolute !important; top: 12px; right: 12px; }
.MuiDialogContent-root { padding: 20px 24px !important; border-color: var(--c-line) !important; }
.MuiDialogActions-root { gap: 8px; padding: 14px 24px 18px !important; border-top: 1px solid var(--c-line); background: var(--c-surface); }
.MuiDialogActions-root > :not(style) ~ :not(style) { margin-left: 0 !important; }
.record-dialog .MuiDialog-paper { display: flex; max-height: calc(100vh - 48px); overflow: hidden; }
.record-dialog .MuiDialogContent-root { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
.dialog-content-scroll { max-height: min(72vh, 720px); overflow-y: auto !important; scrollbar-width: thin; }
.modal-80 .MuiDialog-paper, .MuiDialog-paper.modal-80 { width: 80vw !important; max-width: 80vw !important; }
.MuiDialog-paperWidthXl { width: min(1540px, calc(100vw - 48px)); }
.MuiDialog-paperWidthLg { width: min(1280px, calc(100vw - 48px)); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-top: 8px; align-items: start; }
.form-grid > * { min-width: 0; }
.form-grid .MuiTextField-root, .form-grid .MuiFormControl-root, .form-grid .upload-box { width: 100%; }
.form-grid.docs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-span-2 { grid-column: span 2; }
.field-span-3 { grid-column: span 3; }
.field-span-all { grid-column: 1 / -1; }
.orgao-multi-select .MuiOutlinedInput-root { min-height: 44px; }
.upload-box { padding: 10px 12px; border: 1px dashed var(--c-line) !important; border-radius: 12px !important; background: var(--c-surface2) !important; box-shadow: none !important; }
.upload-box.compact { padding: 8px; }
.upload-box .MuiAvatar-root { background: var(--c-brand-soft); color: var(--c-brand); }
.permission-heading, .permission-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.permission-group { padding: 16px; border: 1px solid var(--c-line); border-radius: 12px !important; background: var(--c-surface2) !important; box-shadow: none !important; }
.permission-group-heading { padding-bottom: 8px; border-bottom: 1px solid var(--c-line); text-transform: capitalize; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.permission-grid .MuiFormControlLabel-label { color: var(--c-ink); font-size: 14px; }
@media (max-width: 1100px) {
  .modal-80 .MuiDialog-paper, .MuiDialog-paper.modal-80 { width: 94vw !important; max-width: 94vw !important; }
  .form-grid, .form-grid.docs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-span-3 { grid-column: span 2; }
}
@media (max-width: 720px) {
  .modal-80 .MuiDialog-paper, .MuiDialog-paper.modal-80 { width: calc(100vw - 20px) !important; max-width: calc(100vw - 20px) !important; }
  .form-grid, .form-grid.docs-grid, .permission-grid { grid-template-columns: 1fr; }
  .field-span-2, .field-span-3 { grid-column: 1 / -1; }
  .MuiDialogTitle-root { padding: 16px 52px 12px 18px !important; }
  .MuiDialogContent-root { padding: 16px 18px !important; }
}

/* ============================================================ Relatórios */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.report-icon { display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; background: var(--c-brand-soft); color: var(--c-brand); }
.report-icon svg { width: 20px; height: 20px; }
.builder-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .85fr); gap: 16px; align-items: start; }
.report-preview { min-height: 320px; margin-top: 12px; padding: 18px; border: 1px solid var(--c-line); background: var(--c-surface2) !important; box-shadow: none !important; }
.preview-table { margin-top: 18px; overflow: auto; }
.drag-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px dashed var(--c-line); border-radius: 10px !important; box-shadow: none !important; cursor: grab; font-size: 14px; }
.saved-model { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--c-line); border-radius: 12px !important; box-shadow: none !important; }
@media (max-width: 1300px) { .builder-grid { grid-template-columns: 1fr; } }

/* ============================================================ Área pública (validação de documentos)
   Paleta mais suave e arejada, como a área pública do mrk educa. */
.public-site { --c-brand: #5b7cf0; --c-brand-strong: #3f5fd6; --c-brand-soft: #eef2fe; --c-line: #e5e9f2; --c-ink: #1e2a45; --c-muted: #66718a; --c-bg: #f6f7fb; --c-surface: #ffffff; --c-surface2: #f3f5fa;
  min-height: 100vh; display: flex; flex-direction: column; background: var(--c-bg); color: var(--c-ink); }
.public-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--c-line); background: color-mix(in srgb, #fff 72%, transparent); backdrop-filter: saturate(1.6) blur(14px); }
.public-header-inner { width: min(1100px, calc(100% - 32px)); min-height: 72px; margin: 0 auto; display: flex; align-items: center; gap: 28px; }
.public-nav { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 24px; }
.public-nav a, .public-nav button { padding: 6px 0; border: 0; background: none; color: var(--c-muted); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; }
.public-nav a:hover, .public-nav button:hover { color: var(--c-brand-strong); }
.public-login-button { border-radius: 12px !important; background: var(--c-brand-strong) !important; }
.public-frame-main { flex: 1 0 auto; display: flex; flex-direction: column; }
.public-landing { width: min(680px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0; }
.public-page-heading { display: flex; align-items: flex-start; gap: 16px; }
.public-heading-icon { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 16px; background: var(--c-brand-soft); color: var(--c-brand); }
.public-eyebrow { color: var(--c-brand) !important; font-size: 12px !important; font-weight: 700 !important; letter-spacing: .14em !important; text-transform: uppercase; }
.public-title { margin-top: 4px !important; color: var(--c-ink); font-size: clamp(26px, 3.4vw, 34px) !important; font-weight: 800 !important; line-height: 1.15 !important; letter-spacing: -.025em !important; }
.public-lead { max-width: 560px; margin-top: 8px !important; color: var(--c-muted); font-size: 15px !important; line-height: 1.55 !important; }
.public-check-card { margin-top: 28px; padding: 24px; border: 1px solid var(--c-line) !important; border-radius: 24px !important; box-shadow: 0 1px 2px rgba(30, 42, 69, .04), 0 16px 40px -20px rgba(30, 42, 69, .16) !important; }
.public-code-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.public-code-form .MuiOutlinedInput-root { height: 48px; border-radius: 12px; }
.public-code-form input { letter-spacing: .14em; }
.public-code-form .MuiButton-root { min-height: 48px; border-radius: 12px; background: var(--c-brand-strong); }
.public-helper { margin-top: 12px !important; color: var(--c-muted); font-size: 13px !important; line-height: 1.5 !important; }
.public-footer { border-top: 1px solid var(--c-line); background: #fff; }
.public-footer-inner { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 24px; display: grid; grid-template-columns: 1.45fr .8fr 1fr; gap: clamp(28px, 6vw, 76px); }
.public-footer-description { max-width: 360px; margin-top: 12px !important; color: var(--c-muted); font-size: 13px !important; line-height: 1.6 !important; }
.public-footer-column { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.public-footer-column a, .public-footer-column button { padding: 0; border: 0; background: none; color: var(--c-ink); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.public-footer-column a:hover, .public-footer-column button:hover { color: var(--c-brand-strong); }
.public-footer-note { color: var(--c-muted); font-size: 13px !important; line-height: 1.5 !important; }
.public-footer-bottom { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--c-line); color: var(--c-muted); font-size: 13px; text-align: center; }
.public-footer-bottom svg { font-size: 16px; color: var(--c-brand); }
.public-result-page { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 56px; }
.public-result-heading { margin-bottom: 24px; }
.public-result-card { overflow: hidden; border: 1px solid var(--c-line) !important; border-radius: 24px !important; box-shadow: 0 1px 2px rgba(30, 42, 69, .04), 0 16px 40px -20px rgba(30, 42, 69, .16) !important; }
.public-result-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 28px; color: #fff; background: linear-gradient(155deg, #255294 0%, #346bb5 55%, #3a9bb3 100%); }
.public-result-banner .public-eyebrow { color: rgba(255, 255, 255, .8) !important; }
.public-driver-avatar { width: 80px !important; height: 80px !important; border: 3px solid rgba(255, 255, 255, .7); background: #fff !important; color: #255294 !important; font-size: 2rem !important; font-weight: 800 !important; }
.public-driver-summary { min-width: 0; }
.public-driver-summary h5 { margin-top: 4px; color: #fff; }
.public-driver-summary > p:not(.public-eyebrow) { margin-top: 4px; color: rgba(255, 255, 255, .8); font-size: 14px; }
.public-driver-summary .MuiChip-root { margin-top: 12px; font-weight: 700; }
.public-status-valid { background: #e8f6ee !important; color: #2f9466 !important; }
.public-status-valid .MuiChip-icon { color: #2f9466 !important; }
.public-status-pending { background: #fdf4e6 !important; color: #c27d23 !important; }
.public-status-pending .MuiChip-icon { color: #c27d23 !important; }
.public-result-logos { align-self: flex-start; }
.public-result-logos img { width: 52px; height: 52px; padding: 5px; object-fit: contain; border-radius: 12px; background: #fff; }
.public-result-content { padding: 24px 28px 28px; }
.public-data-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.public-data-item { min-width: 0; padding: 12px 14px; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-surface2); }
.public-data-item p { margin: 0; color: var(--c-muted); font-size: 12px; line-height: 1.4; }
.public-data-item strong { display: block; margin-top: 4px; color: var(--c-ink); font-size: 14px; overflow-wrap: anywhere; }
.public-result-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 12px 28px; border-top: 1px solid var(--c-line); background: var(--c-surface2); color: var(--c-muted); }
.public-state { flex: 1; min-height: 430px; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; color: var(--c-muted); text-align: center; }
.public-state-card { width: min(500px, calc(100vw - 32px)); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px; border-radius: 24px !important; text-align: center; }
.public-state-card > svg { font-size: 46px; }
@media (max-width: 720px) {
  .public-nav { display: none; }
  .public-login-button { margin-left: auto !important; }
  .public-footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .public-footer-about { grid-column: 1 / -1; }
  .public-data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .public-code-form { grid-template-columns: 1fr; }
  .public-result-banner { align-items: flex-start; flex-direction: column; padding: 20px; }
  .public-result-content { padding: 20px; }
  .public-data-grid { grid-template-columns: 1fr; }
  .public-result-foot { padding: 12px 20px; }
}

/* ============================================================ Análise da produção: gráficos
   Paleta categórica validada (daltonismo e contraste) nos dois temas; status com cor + rótulo. */
:root {
  --viz-1: #257de0; --viz-2: #f47230; --viz-3: #00b894; --viz-neutral: #9aa6b8;
  --status-good: #0aac23; --status-warning: #fbb315; --status-serious: #f18a59; --status-critical: #dc3c3d;
}
html[data-theme="escuro"] { --viz-1: #338ced; --viz-2: #e76624; --viz-3: #00a888; --viz-neutral: #5d6f88; }
.analise-page { display: flex; flex-direction: column; gap: 16px; }
.analise-periodo { min-width: 170px; }
.analise-section-title { margin: 8px 0 -6px; color: var(--c-muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.analise-h2 { margin: 18px 0 -4px; color: var(--c-ink); font-size: 20px; font-weight: 700; letter-spacing: -.015em; }
.analise-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.analise-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.analise-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 1100px) { .analise-grid { grid-template-columns: 1fr; } }
.viz-card .MuiCardContent-root { display: flex; height: 100%; flex-direction: column; }
.viz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.viz-head-copy { min-width: 0; }
.viz-title { margin: 0; color: var(--c-ink); font-size: 15px; font-weight: 600; }
.viz-subtitle { margin: 2px 0 0; color: var(--c-muted); font-size: 13px; line-height: 1.45; }
.viz-toggle { display: flex; flex: 0 0 auto; gap: 2px; }
.viz-body { flex: 1; min-width: 0; }
.viz-chart { position: relative; width: 100%; }
.viz-chart svg { display: block; overflow: visible; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; color: var(--c-ink); font-size: 13px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend i { width: 10px; height: 10px; border-radius: 3px; }
.viz-grid { stroke: var(--c-line); stroke-width: 1; stroke-dasharray: 2 4; }
.viz-baseline { stroke: var(--c-line); stroke-width: 1; }
.viz-axis { fill: var(--c-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-band { fill: var(--c-brand-soft); opacity: .55; }
.viz-dim { opacity: .45; transition: opacity .12s; }
.viz-chart rect[role="button"] { cursor: pointer; outline: none; }
.viz-chart rect[role="button"]:focus-visible { stroke: var(--c-brand); stroke-width: 2; }
.viz-tooltip { position: absolute; z-index: 2; min-width: 170px; padding: 10px 12px; transform: translateX(-50%); border: 1px solid var(--c-line); border-radius: 10px; background: var(--c-surface); box-shadow: 0 12px 28px -12px rgba(20, 40, 74, .35); pointer-events: none; }
.viz-tooltip-title { margin: 0 0 6px; color: var(--c-muted); font-size: 12px; font-weight: 600; }
.viz-tooltip-row { display: flex; align-items: center; gap: 8px; margin: 3px 0 0; font-size: 13px; }
.viz-tooltip-row i { width: 12px; height: 3px; flex: 0 0 auto; border-radius: 2px; }
.viz-tooltip-row strong { color: var(--c-ink); font-variant-numeric: tabular-nums; }
.viz-tooltip-row span { color: var(--c-muted); }
.viz-empty { display: grid; min-height: 120px; place-items: center; margin: 0; border: 1px dashed var(--c-line); border-radius: 12px; color: var(--c-muted); font-size: 14px; }
.viz-note { margin-top: 12px; }
.viz-table .compact-table { min-width: 0; }
.meter-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.meter-list li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr minmax(96px, auto); align-items: center; gap: 12px; }
.meter-label { overflow: hidden; color: var(--c-ink); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.meter-track { height: 10px; overflow: hidden; border-radius: 5px; background: var(--c-surface2); }
.meter-fill { display: block; height: 100%; min-width: 2px; border-radius: 5px; }
.meter-value { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.meter-value strong { color: var(--c-ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.meter-value small { color: var(--c-muted); font-size: 11.5px; white-space: nowrap; }
@media (max-width: 560px) { .meter-list li { grid-template-columns: 1fr auto; } .meter-track { grid-column: 1 / -1; grid-row: 2; } }
.status-pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.status-pill svg { width: 14px; height: 14px; }
.status-pill.is-critical { background: var(--c-danger-soft); color: var(--c-danger); }
.status-pill.is-serious { background: var(--c-warn-soft); color: var(--c-warn); }
.status-pill.is-warning { background: color-mix(in srgb, var(--status-warning) 18%, transparent); color: var(--c-ink); }
.status-dot { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.status-dot::before { content: ''; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--dot, var(--viz-neutral)); }
.planilha-tabs { padding: 4px 12px 0; border-bottom: 1px solid var(--c-line); }
.planilha-toolbar { border-bottom: 0; }
.sort-btn { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.sort-btn:hover { color: var(--c-ink); }
.data-table.compact-table .MuiTableBody-root .MuiTableCell-root { padding: 8px 12px; font-size: 13.5px; }
.data-table.compact-table .MuiTableHead-root .MuiTableCell-root { padding: 9px 12px; }
