/*
 * Direção visual da Controladoria a partir do guia do Nexu (docs/design/guia-nexu-referencia.md):
 * fundo neutro claro, cartões brancos com borda fina, um único destaque (o azul-marinho da MRD),
 * Manrope em títulos e números, DM Sans no texto. Carregar por último: troca os valores dos tokens
 * (todos os componentes leem deles) e refina shell, cabeçalho, cartões, botões e abas.
 */

@font-face { font-family: 'DM Sans'; font-style: normal; font-display: swap; font-weight: 400; src: url('./fonts/dm-sans-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-display: swap; font-weight: 400; src: url('./fonts/dm-sans-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-display: swap; font-weight: 500; src: url('./fonts/dm-sans-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-display: swap; font-weight: 500; src: url('./fonts/dm-sans-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-display: swap; font-weight: 600; src: url('./fonts/dm-sans-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-display: swap; font-weight: 600; src: url('./fonts/dm-sans-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-display: swap; font-weight: 700; src: url('./fonts/dm-sans-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-display: swap; font-weight: 700; src: url('./fonts/dm-sans-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-display: swap; font-weight: 600; src: url('./fonts/manrope-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-display: swap; font-weight: 600; src: url('./fonts/manrope-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-display: swap; font-weight: 700; src: url('./fonts/manrope-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-display: swap; font-weight: 700; src: url('./fonts/manrope-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-display: swap; font-weight: 800; src: url('./fonts/manrope-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-display: swap; font-weight: 800; src: url('./fonts/manrope-latin-ext-800-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Tokens: claro */
:root {
  --font-text: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Manrope', var(--font-text);

  --navy: #123552;
  --blue: #164d7c;
  --blue-hover: #103d65;
  --accent-fill: #164d7c;
  --accent-fill-hover: #103d65;
  --selection: #164d7c;
  --blue-soft: #e9f0f7;
  --blue-line: #c8d7e6;

  --ink: #1e2633;
  --muted: #677285;
  --subtle: #66717f;
  --placeholder: #7a8494;

  --paper: #fff;
  --background: #f5f6f9;
  --surface-subtle: #f5f6f9;
  --surface-raised: #fff;
  --surface-hover: #f1f3f7;
  --surface-sunken: #eff1f5;
  --line: #e5e8ee;
  --line-soft: #eceef3;
  --line-strong: #d4d9e1;
  --bar: rgba(255, 255, 255, 0.88);
  --side: #fbfcfd;
  --thumb: var(--blue-soft);
  --topbar-bg: #fff;
  --topbar-ink: #1e2633;
  --topbar-muted: #677285;
  --topbar-control: #f5f6f9;
  --brand-plate: transparent;

  --success: #1f8a75;
  --success-soft: #e6f4f0;
  --success-line: #bfe2d8;
  --warning: #a26d0e;
  --warning-soft: #fbf3e2;
  --warning-line: #efdcb2;
  --danger: #c2434b;
  --danger-soft: #fcefef;
  --danger-line: #f1cdd0;
  --info: #164d7c;
  --info-soft: #e9f0f7;

  --focus-ring: #164d7c;
  --focus-halo: rgba(22, 77, 124, 0.18);

  --radius-sm: 7px;
  --radius-md: 9px;
  --radius-lg: 14px;
  --radius-xl: 16px;

  --shadow-sm: 0 3px 18px rgba(30, 38, 51, 0.03);
  --shadow-soft: 0 3px 18px rgba(30, 38, 51, 0.03);
  --shadow-hover: 0 9px 23px rgba(22, 77, 124, 0.08);

  --topbar-height: 64px;
  font-family: var(--font-text);
}

/* Tokens: escuro (os dois blocos repetem os valores, como em ui-tokens-dark.css) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --navy: #1d2a3a;
    --blue: #8fb8e6;
    --blue-hover: #a9c9ee;
    --accent-fill: #3a78b5;
    --accent-fill-hover: #4685c3;
    --selection: #3a78b5;
    --blue-soft: #1f2b3b;
    --blue-line: #33465e;
    --ink: #ecf0f6;
    --muted: #a5afbe;
    --subtle: #9ea9b8;
    --placeholder: #8792a3;
    --paper: #1d2028;
    --background: #14161c;
    --surface-subtle: #14161c;
    --surface-raised: #1d2028;
    --surface-hover: #252935;
    --surface-sunken: #181b22;
    --line: #2e3340;
    --line-soft: #272b36;
    --line-strong: #3b4251;
    --bar: rgba(29, 32, 40, 0.88);
    --side: #181b22;
    --thumb: var(--blue-soft);
    --topbar-bg: #1d2028;
    --topbar-ink: #ecf0f6;
    --topbar-muted: #a5afbe;
    --topbar-control: #14161c;
    --brand-plate: #ecf0f6;
    --success: #4cc3a9;
    --success-soft: #16302a;
    --success-line: #275446;
    --warning: #e3b34a;
    --warning-soft: #33290f;
    --warning-line: #5d4a1f;
    --danger: #ec7a80;
    --danger-soft: #3a1e22;
    --danger-line: #683238;
    --info: #8fb8e6;
    --info-soft: #1f2b3b;
    --focus-ring: #8fb8e6;
    --focus-halo: rgba(143, 184, 230, 0.25);
    --shadow-sm: none;
    --shadow-soft: none;
    --shadow-hover: 0 9px 23px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme='dark'] {
  --navy: #1d2a3a;
  --blue: #8fb8e6;
  --blue-hover: #a9c9ee;
  --accent-fill: #3a78b5;
  --accent-fill-hover: #4685c3;
  --selection: #3a78b5;
  --blue-soft: #1f2b3b;
  --blue-line: #33465e;
  --ink: #ecf0f6;
  --muted: #a5afbe;
  --subtle: #9ea9b8;
  --placeholder: #8792a3;
  --paper: #1d2028;
  --background: #14161c;
  --surface-subtle: #14161c;
  --surface-raised: #1d2028;
  --surface-hover: #252935;
  --surface-sunken: #181b22;
  --line: #2e3340;
  --line-soft: #272b36;
  --line-strong: #3b4251;
  --bar: rgba(29, 32, 40, 0.88);
  --side: #181b22;
  --thumb: var(--blue-soft);
  --topbar-bg: #1d2028;
  --topbar-ink: #ecf0f6;
  --topbar-muted: #a5afbe;
  --topbar-control: #14161c;
  --brand-plate: #ecf0f6;
  --success: #4cc3a9;
  --success-soft: #16302a;
  --success-line: #275446;
  --warning: #e3b34a;
  --warning-soft: #33290f;
  --warning-line: #5d4a1f;
  --danger: #ec7a80;
  --danger-soft: #3a1e22;
  --danger-line: #683238;
  --info: #8fb8e6;
  --info-soft: #1f2b3b;
  --focus-ring: #8fb8e6;
  --focus-halo: rgba(143, 184, 230, 0.25);
  --shadow-sm: none;
  --shadow-soft: none;
  --shadow-hover: 0 9px 23px rgba(0, 0, 0, 0.35);
}

/* Base */
body {
  font-family: var(--font-text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.admin-main h1,
.admin-main h2,
.admin-main h3 {
  font-family: var(--font-display);
}
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
td,
.business-kpi strong,
.pauta-metric strong,
.pauta-metric b,
time {
  font-variant-numeric: tabular-nums;
}

/* Topo claro, com borda fina */
.topbar {
  align-items: center;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Navegação lateral: item ativo em fundo suave, texto no destaque e linha de 3px à esquerda */
.app-sidebar {
  background: var(--side);
  border-right: 1px solid var(--line);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.area-nav button {
  color: var(--muted);
  font-size: 13px;
  transition: color 160ms, transform 160ms;
}
.area-nav button:not(.active):hover {
  color: var(--ink);
  transform: translateX(2px);
}
.area-nav .nav-group button.active,
.area-nav.has-indicator button.active {
  color: var(--blue);
  font-weight: 600;
}
.area-nav button.active .nav-item-icon,
.area-nav .nav-group button.active .nav-item-icon,
.nav-item-icon {
  color: inherit;
}
.area-nav:not(.has-indicator) .nav-group button.active,
.nav-indicator {
  background: var(--blue-soft);
  box-shadow: inset 3px 0 var(--accent-fill);
}

/* Cabeçalho da página: sobrelinha no destaque, título-frase, descrição de uma linha */
.page-heading .eyebrow,
#page-context {
  display: block;
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.page-heading #page-title,
.page-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(24px, 2.15vw, 34px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.12;
}
.page-heading #page-description {
  display: block;
  max-width: 72ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Títulos de seção e de painel */
.pauta-subheading,
.section-heading > h3,
.section-heading > h4 {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.admin-main h3 {
  letter-spacing: -0.005em;
  word-spacing: 0.04em;
}
.card h3,
.panel h3 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.eyebrow {
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.monitor-note,
.overview-footnote {
  color: var(--muted);
  font-size: 11px;
}

/* Cartões e painéis: branco, borda fina, raio 14, sombra quase nula */
.card,
.panel,
.business-kpi,
.conference-card,
.finding-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.business-kpi:has(button):hover,
.conference-card:has(button):hover {
  border-color: var(--blue-line);
  box-shadow: var(--shadow-hover);
}

/* Indicadores: número grande em Manrope, rótulo pequeno; nenhum cartão pintado inteiro */
.business-kpi strong {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1;
}
.business-kpi .business-kpi-icon {
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 9px;
}
.business-kpi-focus {
  background: var(--paper);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.business-kpi-focus > div > span,
.business-kpi-focus small {
  color: var(--muted);
}
.business-kpi-focus strong {
  color: var(--ink);
}
.business-kpi-focus .business-kpi-icon {
  color: var(--blue);
  background: var(--blue-soft);
}
.business-kpi-focus .business-kpi-context {
  color: var(--muted);
  background: var(--surface-subtle);
  border-color: var(--line-soft);
}
.business-kpi-focus button {
  color: var(--blue);
  border-color: var(--line-soft);
}
.pauta-metric strong,
.pauta-metric b {
  font-family: var(--font-display);
  font-weight: 750;
  letter-spacing: -0.02em;
}

/* Botões: raio 9, 12px/600; primário no destaque, secundário em painel com borda */
button.primary,
a.primary,
.primary {
  font-size: 12.5px;
  font-weight: 600;
  background: var(--accent-fill);
  border: 1px solid var(--accent-fill);
  border-radius: var(--radius-md);
  box-shadow: 0 3px 6px rgba(22, 77, 124, 0.08);
  transition: background 160ms, box-shadow 160ms, border-color 160ms;
}
button.primary:hover,
.primary:hover {
  background: var(--accent-fill-hover);
}
button.secondary,
.secondary {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: border-color 160ms, background 160ms;
}
button.secondary:hover,
.secondary:hover {
  border-color: var(--blue);
}
button:disabled {
  opacity: 0.45;
}

/* Campos: fundo do app, borda fina, raio 8 */
.admin-main input:not([type='checkbox']):not([type='radio']):not([type='range']),
.admin-main select,
.admin-main textarea {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.admin-main label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* Controle segmentado: caixa com borda; o selecionado ganha fundo suave e texto no destaque */
.ui-tabs {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.ui-tabs > [role='tab'],
.ui-tabs > button {
  color: var(--muted);
}
.ui-tabs > [aria-selected='true'],
.ui-tabs > [aria-pressed='true'],
.ui-tabs > .active {
  color: var(--blue);
  font-weight: 600;
}
.ui-tab-indicator {
  background: var(--blue-soft);
  box-shadow: none;
}

/* Tabelas: sem bordas verticais, cabeçalho pequeno e cinza */
.admin-main th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.admin-main td {
  font-size: 12.5px;
}
.admin-main tr:hover td {
  background: var(--background);
}

/* Selos e pílulas */
.badge,
.chip,
.status-pill {
  border-radius: 999px;
}

/* Alerta do sistema: aviso no fluxo, no tom de "ruim", sem faixa sangrando */
.agent-system-alert-banner,
.agent-system-alert-banner.warning {
  margin: 0 0 20px;
  padding: 12px 16px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: 12px;
  box-shadow: none;
  animation: none;
  font-weight: 400;
}
.agent-system-alert-banner.warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: var(--warning-line);
}
.agent-system-alert-banner .alert-banner-content b:first-of-type {
  display: inline-block;
  text-transform: lowercase;
  font-weight: 600;
}
.agent-system-alert-banner .alert-banner-content b:first-of-type::first-letter {
  text-transform: uppercase;
}
.agent-system-alert-banner .agent-system-alert-link {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  color: inherit;
  text-align: left;
  font-weight: 400;
  background: transparent;
  border: 0;
}
.agent-system-alert-banner .alert-banner-icon {
  font-size: 18px;
  animation: none;
}
.agent-system-alert-banner .alert-banner-btn {
  flex: 0 0 auto;
  padding: 6px 12px;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: var(--radius-md);
}

/* Fatos dos cartões em duas colunas (rótulo | valor) */
.conference-card-facts {
  gap: 6px;
}
.conference-card-facts > div {
  display: grid;
  grid-template-columns: minmax(96px, 36%) 1fr;
  gap: 12px;
  align-items: baseline;
}
.conference-card-facts dt {
  margin: 0;
  color: var(--muted);
}

/* Abrir e fechar: chevron fino no lugar do triângulo */
main details > summary {
  list-style: none;
  cursor: pointer;
}
main details > summary::-webkit-details-marker {
  display: none;
}
main details > summary::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 10px 2px 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.55;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}
main details[open] > summary::before {
  transform: rotate(45deg);
}

/* Assistente: botão discreto em painel, sem anel nem salto */
.argon-chat .argon-chat-launcher {
  min-height: 40px;
  padding: 0 16px 0 12px;
  color: var(--ink);
  font-weight: 600;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(30, 38, 51, 0.1);
}
.argon-chat .argon-chat-launcher:hover {
  border-color: var(--blue);
  transform: none;
}
.argon-chat .argon-chat-launcher svg {
  color: var(--blue);
}

/* Entrada: os blocos sobem 7px e aparecem, com 40ms entre um e o seguinte */
@keyframes nexu-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}
.admin-main > .page-heading,
.admin-main > nav,
.admin-main > section:not([hidden]) {
  animation: nexu-enter 300ms ease-out backwards;
}
.admin-main > :nth-child(2) { animation-delay: 40ms; }
.admin-main > :nth-child(3) { animation-delay: 80ms; }
.admin-main > :nth-child(4) { animation-delay: 120ms; }
.admin-main > :nth-child(n + 5) { animation-delay: 160ms; }

@media (prefers-reduced-motion: reduce) {
  .admin-main > *,
  main details > summary::before,
  .area-nav button {
    animation: none !important;
    transition: none !important;
  }
}

/* Nada de rolagem horizontal da página */
.admin-main,
.admin-main > * {
  min-width: 0;
}
.admin-main {
  overflow-wrap: anywhere;
}

/* Celular: o título da página já diz onde se está; o topo fica só com menu, busca e conta */
@media (max-width: 600px) {
  .product-heading h1 {
    margin: 0;
  }
  .admin-main {
    padding: 23px 18px 86px;
  }
  .business-kpi strong {
    font-size: 28px;
  }
}
