@font-face {
  font-family: 'Marcellus';
  src: url('/fonts/Marcellus-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #ede8df;
  --surface: #ffffff;
  --surface-strong: #f5f1eb;
  --ink: #0f1d3d;
  --muted: #6f7687;
  --line: rgba(15, 29, 61, 0.08);
  --line-strong: rgba(15, 29, 61, 0.14);
  --accent: #c9a84c;
  --accent-dark: #b8932d;
  --navy: #0d1f44;
  --navy-strong: #081832;
  --card-radius: 16px;
  --input-radius: 10px;
  --btn-radius: 24px;
  --login-navy: #0e2f4f;
  --login-navy-dark: #102b3f;
  --login-gold: #d1af48;
  --login-gold-dark: #c29c2e;
  --login-cream: #f7f1ea;
  --login-input-border: #d9cab6;
  --login-text-light: #f7f1ea;
  --login-text-muted-blue: #aab9cc;
  --login-placeholder-blue: #b6c8e8;
  --login-footer-blue: #9aaed0;
  --danger: #b42318;
  --grid: rgba(15, 29, 61, 0.04);
  --shadow: 0 18px 48px rgba(15, 29, 61, 0.1);
  --font-display: 'Marcellus', Georgia, Cambria, "Times New Roman", serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  --sev-grave: var(--danger);
  --sev-moderado: var(--accent-dark);
  --sev-leve: #1c7d4d;
  --focus-ring: 0 0 0 3px rgba(201, 168, 76, 0.45);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.28), transparent 34%);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

button,
input,
select {
  height: 46px;
  border-radius: 999px;
  font: inherit;
}

button {
  padding: 0 22px;
  color: white;
  border: 0;
  border-radius: var(--btn-radius);
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

input,
select {
  min-width: 0;
  padding: 0 18px;
  border: 1.5px solid rgba(15, 29, 61, 0.13);
  border-radius: var(--input-radius);
  background: #ffffff;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
  outline: 0;
}

#login-submit-btn .trilha-loader {
  display: none;
}

#login-submit-btn.carregando .trilha-loader {
  display: inline-flex;
}

/* ============================================================
   Login — cartão central sobre palco navy (diagramação 26/08)
   Marca oficial gigante à esquerda, águia MIDAS em marca-d'água
   à direita, cartão branco ao centro, rodapé legal dourado.
   ============================================================ */
.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 18%, rgba(201, 168, 76, 0.08), transparent 42%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-strong) 100%);
}

/* Palco em 3 colunas: mão dourada | cartão | trilha — cada gráfico ancorado
   ao centro da sua própria coluna, sem offsets soltos em vw/translateY. */
.login-palco {
  position: relative;
  display: grid;
  /* a coluna central carrega o min() (não o .login-cartao) — resolver a
     percentagem contra uma coluna "auto" é ambíguo e infla a track */
  grid-template-columns: minmax(0, 1fr) min(468px, 100%) minmax(0, 1fr);
  align-items: center;
  min-height: 100vh;
  padding: 48px 24px 110px;
  overflow: hidden;
}

.login-palco-lado {
  display: grid;
  place-items: center;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.login-palco-esquerda {
  grid-column: 1;
}

/* Trilha de auditoria: elemento sólido, sem esmaecer */
.login-trilha-fundo {
  width: min(17vw, 300px);
  height: auto;
}

.login-cartao {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(3, 12, 30, 0.5);
  text-align: center;
  overflow: hidden;
}

/* Faixa da marca: o logotipo tem "HERMES" em branco, então precisa de fundo
   navy para ficar legível — as cores originais do arquivo ficam intactas. */
.login-cartao-marca {
  display: grid;
  place-items: center;
  padding: 24px 36px 22px;
  background: var(--navy);
  border-bottom: 2px solid var(--accent);
}

.login-cartao-marca img {
  display: block;
  width: min(252px, 74%);
  height: auto;
}

.login-cartao-corpo {
  padding: 26px 34px 22px;
}

.login-cartao-cabeca h2 {
  color: var(--login-navy-dark);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
}

.login-cartao-sub {
  margin-top: 6px;
  color: #8a9bb7;
  font-size: 15px;
}

.login-access-form {
  display: grid;
  gap: 0;
  margin-top: 6px;
  text-align: left;
}

.login-access-form label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: #123b63;
  font-size: 14px;
  font-weight: 700;
}

/* Campos exclusivos do modo "Criar conta" — ocultos no login.
   !important é proposital: `.login-access-form label` (classe+tipo) e
   `.login-form-row` (mesma especificidade, declarada depois) venceriam
   um display:none comum — mesma armadilha do hidden-vs-classe já vista
   nesta página (olho da senha, contagem do admin). */
.cadastro-somente {
  display: none !important;
}

body.modo-cadastro .cadastro-somente {
  display: grid !important;
}

.login-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.login-form-row label {
  margin-top: 0;
}

/* Cartão mais largo em modo cadastro — cabe os pares de campo em 2 colunas */
@media (min-width: 1101px) {
  body.modo-cadastro .login-palco {
    grid-template-columns: minmax(0, 1fr) min(620px, 100%) minmax(0, 1fr);
  }
}

.login-access-form input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 16px;
}

.login-access-form input::placeholder {
  color: var(--login-placeholder-blue);
  font-weight: 600;
}

.login-senha-campo {
  position: relative;
  display: block;
}

.login-senha-campo input {
  padding-right: 54px;
}

.login-senha-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--login-placeholder-blue);
  cursor: pointer;
  transform: translateY(-50%);
}

.login-senha-toggle:hover {
  color: var(--login-navy-dark);
  background: transparent;
}

.login-senha-toggle .olho-fechado,
.login-senha-toggle.senha-visivel .olho-aberto {
  display: none;
}

.login-senha-toggle.senha-visivel .olho-fechado {
  display: block;
}

.login-capslock {
  color: var(--login-gold-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-access-form > button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  margin-top: 26px;
  border: 0;
  border-radius: 10px;
  background: var(--login-gold);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.login-access-form > button:hover {
  background: var(--login-gold-dark);
}

.login-access-form > button:active {
  transform: translateY(1px);
}

.login-access-form > button:disabled {
  opacity: 0.75;
  cursor: default;
  transform: none;
}

.login-access-form input:focus-visible,
.login-access-form button:focus-visible,
.login-senha-toggle:focus-visible,
.login-inline-button:focus-visible {
  outline: 2px solid var(--login-gold-dark);
  outline-offset: 2px;
}

.login-feedback {
  min-height: 18px;
  margin-top: 12px;
  color: #8a9bb7;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.login-feedback.tom-erro,
.login-feedback.tom-andamento,
.login-feedback.tom-sucesso {
  padding: 10px 13px;
  border-left: 3px solid;
  border-radius: 0 8px 8px 0;
}

.login-feedback.tom-erro {
  color: var(--danger);
  border-left-color: var(--danger);
  background: rgba(180, 35, 24, 0.07);
}

.login-feedback.tom-andamento {
  color: var(--login-navy-dark);
  border-left-color: var(--login-gold);
  background: rgba(209, 175, 72, 0.12);
}

.login-feedback.tom-sucesso {
  color: var(--sev-leve);
  border-left-color: var(--sev-leve);
  background: rgba(28, 125, 77, 0.08);
}

.login-cartao-alternar {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 29, 61, 0.08);
  color: #8a9bb7;
  font-size: 14px;
}

.login-inline-button {
  height: auto;
  padding: 0;
  color: var(--login-gold-dark);
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
  font-weight: 700;
  cursor: pointer;
}

.login-inline-button:hover {
  color: var(--login-navy-dark);
  background: transparent;
}

.login-legal {
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  z-index: 1;
  display: grid;
  gap: 3px;
  padding: 0 24px;
  text-align: center;
  line-height: 1.5;
}

.login-legal strong {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-legal span {
  color: var(--login-text-muted-blue);
  font-size: 12px;
  font-weight: 400;
}

@media (prefers-reduced-motion: no-preference) {
  .login-trilha-fundo {
    animation: login-aparecer 0.6s ease-out both;
  }

  .login-cartao {
    animation: login-surgir 0.45s ease-out 0.1s both;
  }

  .login-legal {
    animation: login-aparecer 0.45s ease-out 0.2s both;
  }
}

@keyframes login-surgir {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes login-aparecer {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Abaixo de 1100px não sobra vão lateral para os gráficos respirarem —
   o cartão passa a ocupar a largura disponível sozinho. */
@media (max-width: 1100px) {
  .login-palco-lado {
    display: none;
  }

  .login-palco {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .login-palco {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 26px;
    min-height: 100svh;
    padding: 36px 18px 28px;
  }

  .login-cartao-marca {
    padding: 20px 24px 18px;
  }

  .login-cartao-corpo {
    padding: 22px 20px 20px;
  }

  .login-cartao-cabeca h2 {
    font-size: 24px;
  }

  .login-legal {
    position: static;
    margin-top: 2px;
    padding: 0;
  }

  .login-form-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

.page {
  width: min(1380px, calc(100vw - 56px));
  margin: 32px auto 80px;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--page);
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  min-height: 100vh;
  padding: 0;
  color: #d8e0f4;
  background: var(--navy);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden auto;
}

/* Brand header — logotipo oficial Hermes Oráculo */
.sidebar-brand {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-img {
  display: block;
  width: 100%;
  max-width: 206px;
  height: auto;
}

.brand-glifo-img {
  display: none;
  width: 34px;
  height: auto;
}

.sidebar-brand small {
  margin-top: 2px;
  color: rgba(174, 185, 212, 0.4);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Seal / logo area */
.sidebar-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: var(--navy-strong);
}

.sidebar-seal img {
  width: 100%;
  max-width: 190px;
  height: auto;
  object-fit: contain;
  opacity: 0.88;
}

/* Profile row */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transition: background 0.15s;
}

.sidebar-profile[data-clickable] {
  cursor: pointer;
}

.sidebar-profile[data-clickable]:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #2e4d7a;
  color: white;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.sidebar-profile-info {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.sidebar-profile-info strong {
  color: white;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-info span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sidebar-profile-chevron {
  flex-shrink: 0;
  color: rgba(174, 185, 212, 0.45);
  font-size: 22px;
  line-height: 1;
  font-weight: 300;
}

/* Navigation */
.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px 12px;
}

.sidebar-button {
  justify-content: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  height: 54px;
  padding: 0 18px;
  color: #8a9bbf;
  border-radius: 14px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  transition: background 0.13s, color 0.13s;
}

.sidebar-button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-button.active {
  color: var(--navy-strong);
  background: var(--accent);
  font-weight: 700;
}

.sidebar-button.active .sidebar-icon {
  color: var(--navy-strong);
}

/* Admin nav button */
.sidebar-admin-button {
  color: #f87171;
  background: rgba(80, 10, 10, 0.5);
}

.sidebar-admin-button:hover {
  color: #fca5a5;
  background: rgba(100, 15, 15, 0.65);
}

.sidebar-admin-button.active {
  color: #fca5a5;
  background: rgba(120, 20, 20, 0.75);
}

/* Icons */
.sidebar-icon {
  display: inline-flex;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 20px;
  height: 20px;
  color: inherit;
}

.sidebar-icon::before,
.sidebar-icon::after {
  content: "";
  display: block;
}

.dashboard-icon {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  grid-template-rows: repeat(2, 6px);
  gap: 3px;
}

.dashboard-icon::before,
.dashboard-icon::after {
  width: 6px;
  height: 6px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  box-shadow: 9px 0 0 -0.5px currentColor, 0 9px 0 -0.5px currentColor, 9px 9px 0 -0.5px currentColor;
}

.search-icon {
  border: 2px solid currentColor;
  border-radius: 999px;
}

.search-icon::after {
  width: 7px;
  height: 2px;
  background: currentColor;
  transform: translate(9px, 8px) rotate(45deg);
}

.radar-icon {
  border: 2px solid currentColor;
  border-radius: 999px;
}

.radar-icon::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

/* Logout icon */
.settings-icon {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.settings-icon::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.logout-icon {
  width: 18px;
  height: 14px;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 3px 0 0 3px;
}

.logout-icon::after {
  width: 10px;
  height: 2px;
  background: currentColor;
  transform: translateX(8px);
  box-shadow: -3px -4px 0 -0.5px currentColor, -3px 4px 0 -0.5px currentColor;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 10px 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.app-main.page {
  width: auto;
  margin: 0;
  padding: 0 28px 36px;
}

.app-main .section-shell {
  margin-top: 0;
}

.app-main .section-heading h2,
.app-main .monitoring-header h2 {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(34px, 4.5vw, 64px);
  font-style: normal;
  font-weight: 820;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
  margin: 0 -28px 26px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.app-eyebrow {
  color: #5b7fa6;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
}

.app-topbar h1 {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-style: normal;
  font-weight: 820;
  line-height: 1.15;
  margin-bottom: 2px;
}

.app-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 360px);
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  background: #f0f1f6;
  color: var(--muted);
}

.app-search span {
  font-size: 0;
}

.app-search span::before {
  content: "";
  display: block;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.app-search span::after {
  content: "";
  display: block;
  width: 7px;
  height: 2px;
  margin-top: -1px;
  margin-left: 11px;
  background: currentColor;
  transform: rotate(45deg);
}

.app-search input {
  width: 100%;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.app-search input:focus {
  box-shadow: none;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

/* Dashboard nav cards */
.dashboard-grid-nav {
  margin-top: 8px;
}

.dashboard-nav-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dashboard-nav-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(208, 173, 69, 0.12);
}

.dashboard-nav-card .sidebar-icon {
  color: var(--accent);
  width: 26px;
  height: 26px;
}

.dashboard-nav-card strong {
  font-size: 16px;
  font-weight: 700;
}

.dashboard-nav-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-card,
.dashboard-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 10px 22px rgba(15, 29, 61, 0.05);
}

.dashboard-card {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 22px;
}

.dashboard-card span {
  color: var(--muted);
  font-size: 14px;
}

.dashboard-card strong {
  color: var(--ink);
  font-size: 28px;
}

.dashboard-card small {
  color: var(--muted);
}

.dashboard-card.highlight {
  background: linear-gradient(135deg, white 0%, #fff8df 100%);
}

.dashboard-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  margin-top: 24px;
  padding: 28px;
}

.dashboard-panel h2 {
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.98;
}

.dashboard-panel p:last-child {
  max-width: 540px;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.dashboard-action {
  color: var(--navy-strong);
  background: var(--accent);
  font-weight: 820;
}

.page-shell,
.section-shell {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background-color: var(--surface);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 88px 88px;
  box-shadow: var(--shadow);
}

.hero-section {
  min-height: calc(100vh - 64px);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.38fr);
  grid-template-rows: auto minmax(430px, auto);
  column-gap: 28px;
  min-height: calc(100vh - 190px);
  padding: 28px 32px 34px;
  border-bottom: 1px solid var(--line);
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  height: 34px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(251, 250, 243, 0.78);
  font-size: 14px;
  font-weight: 850;
}

.brand-pill span,
.availability span {
  display: inline-block;
  border-radius: 999px;
}

.brand-pill span {
  width: 8px;
  height: 8px;
  background: var(--ink);
}

.topnav {
  display: flex;
  justify-content: flex-end;
  gap: 30px;
}

.topnav button {
  height: 34px;
  padding: 0;
  color: var(--ink);
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
}

.topnav button:hover {
  color: var(--accent);
  background: transparent;
}

.hero-copy {
  grid-column: 1;
  align-self: end;
  max-width: 960px;
}

.hero-brand-mark {
  grid-column: 2;
  align-self: center;
  justify-self: end;
  width: min(32vw, 430px);
  padding: 20px;
  border: 1px solid rgba(17, 17, 15, 0.045);
  border-radius: 8px;
  background: rgba(251, 250, 243, 0.38);
  box-shadow: 0 18px 46px rgba(26, 27, 23, 0.045);
  opacity: 0.82;
}

.hero-brand-mark img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.58) contrast(0.9) brightness(1.03);
  mix-blend-mode: multiply;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.availability span {
  width: 7px;
  height: 7px;
  background: var(--accent);
}

h1 {
  color: #777973;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: clamp(72px, 12vw, 176px);
  font-style: italic;
  font-weight: 500;
  line-height: 0.84;
  letter-spacing: 0;
}

h1 span {
  color: var(--accent);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-style: normal;
  font-weight: 850;
}

.hero-copy > p:last-child {
  max-width: 460px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: #292a27;
  font-size: 15px;
  line-height: 1.55;
}

.hero-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 26px 32px;
  background: rgba(251, 250, 243, 0.74);
}

.hero-footer span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.hero-footer strong {
  font-size: 14px;
}

.section-shell {
  margin-top: 0;
  padding: 24px 32px 32px;
}

.section-kicker {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.55fr);
  gap: 42px;
  align-items: end;
  margin-bottom: 34px;
}

.section-heading h2,
.monitoring-header h2 {
  color: #777973;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: clamp(46px, 7vw, 92px);
  font-style: italic;
  font-weight: 500;
  line-height: 0.95;
}

.section-heading h2 span,
.monitoring-header h2 span {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-style: normal;
  font-weight: 760;
}

.section-heading p,
.monitoring-header > div > p:last-child {
  color: #292a27;
  font-size: 15px;
  line-height: 1.55;
}

.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  width: fit-content;
  background: rgba(15, 29, 61, 0.06);
  border-radius: 14px;
}

.workspace-tabs button {
  height: 36px;
  padding: 0 18px;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}

.workspace-tabs button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}

.workspace-tabs button:not(.active):hover {
  border-bottom: 2px solid var(--accent);
}

.workspace-tabs button.active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 29, 61, 0.1);
}

.workspace-panels {
  min-width: 0;
}

.workbench-panel {
  display: none;
}

.workbench-panel.active {
  display: grid;
}

.chat-card,
.process-card,
.doe-card,
.monitoring-form,
.saved-searches {
  border: 1px solid rgba(15, 29, 61, 0.07);
  border-radius: var(--card-radius);
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(15, 29, 61, 0.05);
}

.chat-card {
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  min-height: 520px;
}

.workbench-panel:not(.active) {
  display: none;
}

.messages {
  overflow: auto;
  padding: 20px;
}

.message {
  max-width: 760px;
  margin: 0 0 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 250, 243, 0.88);
  white-space: pre-wrap;
}

.message p {
  line-height: 1.5;
}

.message a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.message.user {
  margin-left: auto;
  color: white;
  border-color: var(--accent);
  background: var(--accent);
}

.message.bot {
  background: var(--surface-strong);
}

.message.structured {
  max-width: 980px;
  padding: 0;
  border: 0;
  background: transparent;
}

.contract-results {
  display: grid;
  gap: 12px;
}

.result-summary,
.contract-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 250, 243, 0.9);
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
}

.result-summary > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.result-summary > div:last-child {
  border-right: 0;
}

.contract-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 250, 243, 0.78);
}

.contract-filters .field {
  display: grid;
  gap: 6px;
}

.contract-filters input {
  height: 40px;
  padding: 0 14px;
  font-size: 13px;
}

.contract-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.contract-filter-actions button,
.contract-pagination button {
  min-height: 36px;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
}

.contract-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.result-summary span,
.contract-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-summary strong,
.contract-meta strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.contract-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.contract-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.contract-card h4 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.contract-card-head > strong {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 17px;
}

.contract-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr);
  gap: 12px;
}

.contract-meta > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.contract-meta .wide {
  grid-column: 1 / -1;
}

.contract-meta .wide strong {
  font-weight: 520;
  line-height: 1.45;
}

.contract-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contract-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 250, 0.76);
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.contract-action:hover {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

.contract-action[aria-disabled="true"] {
  color: var(--muted);
  pointer-events: none;
}

.result-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.process-card {
  gap: 16px;
  min-height: 520px;
  padding: 18px;
}

.doe-card {
  gap: 22px;
  min-height: 560px;
  padding: 24px;
}

.doe-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.doe-panel-head p {
  margin: 0 0 8px;
  color: #3d72c9;
  font-size: 13px;
  font-weight: 780;
}

.doe-panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

.doe-primary-button {
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid #b49327;
  color: white;
  background: #c9a943;
  box-shadow: 0 10px 18px rgba(113, 87, 15, 0.14);
  font-size: 14px;
  font-weight: 820;
}

.doe-primary-button:hover {
  background: #1d4077;
  border-color: #1d4077;
}

.doe-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.doe-metric {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 250, 0.84);
  box-shadow: 0 12px 28px rgba(26, 27, 23, 0.06);
}

.doe-metric.primary {
  border-color: #ac8d24;
  background: #cfb04d;
}

.doe-metric span {
  color: #1d4077;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.doe-metric.primary span,
.doe-metric.primary small {
  color: #173150;
}

.doe-metric strong {
  color: var(--ink);
  font-size: 38px;
  line-height: 1;
}

.doe-metric small {
  color: #2d5bb0;
  font-size: 14px;
  font-weight: 680;
}

.doe-setup {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(15, 29, 61, 0.07);
  border-radius: 12px;
  background: var(--surface-strong);
}

.doe-term-form,
.doe-range {
  display: grid;
  gap: 12px;
  align-items: end;
}

.doe-term-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.doe-range {
  grid-template-columns: minmax(160px, 0.24fr) minmax(160px, 0.24fr) auto;
}

.doe-terms-list {
  display: grid;
  gap: 8px;
}

.doe-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.doe-term {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 250, 0.72);
}

.doe-term-select {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.doe-term-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.doe-term strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.doe-results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.doe-results-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
}

.doe-results-head span {
  color: var(--muted);
  font-size: 13px;
}

.doe-results {
  display: grid;
  gap: 12px;
}

.doe-by-term {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.doe-result-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 250, 0.82);
}

.doe-result-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.doe-result-head h4 {
  margin: 0;
  font-size: 18px;
}

.doe-result-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.doe-process-highlight {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(255, 50, 31, 0.18);
  border-radius: 8px;
  background: rgba(255, 50, 31, 0.08);
}

.doe-process-highlight span,
.doe-publication > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doe-process-highlight a,
.doe-process-highlight strong {
  min-width: 0;
  color: var(--accent);
  font-size: 20px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.doe-process-highlight a {
  text-underline-offset: 4px;
}

.doe-process-highlight.muted {
  border-color: var(--line);
  background: rgba(251, 250, 243, 0.62);
}

.doe-process-highlight.muted strong {
  color: var(--muted);
  font-size: 14px;
}

.doe-publication {
  display: grid;
  gap: 8px;
}

.doe-publication p,
.doe-result-card p {
  color: var(--ink);
  line-height: 1.45;
}

.doe-publication mark {
  padding: 1px 3px;
  border-radius: 4px;
  background: #ffe08a;
  color: #17140c;
  font-weight: 800;
}

.doe-publication-full {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 250, 243, 0.62);
}

.doe-publication-full summary {
  min-height: 36px;
  padding: 9px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.doe-publication-full p {
  padding: 0 12px 12px;
  color: #292a27;
  font-size: 14px;
}

.process-search {
  display: grid;
  gap: 14px;
}

.process-search-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.process-search-head h3,
.saved-searches-title h3,
.field span {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.process-search-head a {
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  text-underline-offset: 3px;
}

.process-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.process-mode label {
  cursor: pointer;
}

.process-mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.process-mode span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 250, 0.72);
  font-size: 13px;
  font-weight: 760;
}

.process-mode input:checked + span {
  color: white;
  border-color: var(--accent);
  background: var(--accent);
}

.process-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.22fr);
  gap: 12px;
  align-items: end;
}

.process-results {
  display: grid;
  gap: 12px;
}

.save-term-button {
  justify-self: start;
}

.process-terms {
  display: grid;
  gap: 10px;
  padding-top: 6px;
}

.process-terms h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.process-terms-list {
  display: grid;
  gap: 8px;
}

.process-term {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 250, 243, 0.76);
}

.process-term strong,
.process-term span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.process-term span {
  color: var(--muted);
  font-size: 12px;
}

.process-results-summary,
.process-result-card {
  border: 1px solid rgba(15, 29, 61, 0.07);
  border-radius: var(--card-radius);
  background: #ffffff;
  box-shadow: 0 1px 6px rgba(15, 29, 61, 0.05);
}

.process-results-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

.process-results-summary > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.process-results-summary > div:last-child {
  border-right: 0;
}

.process-result-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.process-result-card h4 {
  margin: 0;
  font-size: 18px;
}

.process-result-card h4 a {
  color: var(--ink);
  text-underline-offset: 3px;
}

.process-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.process-result-grid > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.process-result-grid .wide {
  grid-column: 1 / -1;
}

.process-results-summary span,
.process-result-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.process-results-summary strong,
.process-result-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.process-documents-tree {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 250, 0.72);
}

.process-documents-tree summary {
  min-height: 42px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.process-document-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.process-document-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 4px;
}

.process-document-selectall {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.process-document-selectall input,
.process-document-select input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.process-document-download {
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent, #c9a227);
  color: #1a1a1a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.process-document-download:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.process-document-select {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-left: 4px;
  cursor: pointer;
}

.process-document-more {
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.process-document-more:hover {
  border-style: solid;
  background: var(--surface);
}

.process-document-list a {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) 120px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.process-document-list a:last-child {
  border-bottom: 0;
}

.process-document-list a:hover {
  background: var(--surface-strong);
}

.process-document-list a.featured-document {
  background: rgba(255, 224, 138, 0.34);
  box-shadow: inset 4px 0 0 #ffe08a;
}

.process-document-list a.featured-document strong {
  color: #17140c;
}

.process-document-list strong,
.process-document-list small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.process-document-list span,
.process-document-list small {
  color: var(--muted);
  font-size: 12px;
}

.process-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.process-pagination button {
  height: 34px;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 250, 0.72);
  font-size: 12px;
  font-weight: 760;
}

.process-pagination button:hover {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

.process-pagination button:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 250, 0.42);
  cursor: default;
}

.process-pagination span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.monitoring-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.monitoring-header .availability {
  margin-bottom: 14px;
}

.monitoring-header > div {
  max-width: 820px;
}

.monitoring-header > div > p:last-child {
  max-width: 460px;
  margin-top: 22px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 250, 0.72);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.status-pill.active {
  color: white;
  border-color: var(--accent);
  background: var(--accent);
}

.monitoring-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1fr);
  gap: 18px;
}

.monitoring-form {
  display: grid;
  gap: 14px;
  align-self: start;
  padding: 18px;
  box-shadow: 0 16px 34px rgba(26, 27, 23, 0.07);
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.monitoring-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(120px, 0.9fr);
  gap: 12px;
}

.radar-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 250, 243, 0.78);
}

.radar-options legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

.radar-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.radar-options input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.toggle-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 250, 243, 0.78);
  cursor: pointer;
}

.toggle-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-visual {
  width: 50px;
  height: 28px;
  padding: 3px;
  border-radius: 999px;
  background: #c9c8be;
  transition: background 160ms ease;
}

.toggle-visual::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 5px rgba(17, 17, 15, 0.22);
  transition: transform 160ms ease;
}

.toggle-card input:checked + .toggle-visual {
  background: var(--accent);
}

.toggle-card input:checked + .toggle-visual::before {
  transform: translateX(22px);
}

.toggle-card strong,
.toggle-card small {
  display: block;
}

.toggle-card strong {
  margin-bottom: 2px;
}

.toggle-card small,
.form-feedback,
.saved-search p {
  color: var(--muted);
  font-size: 12px;
}

.number-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 250, 243, 0.78);
}

.number-field input {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.number-field span {
  padding-right: 14px;
  color: var(--muted);
  font-size: 13px;
}

#monitoring-interval {
  min-height: 50px;
  border-radius: 999px;
  background: rgba(251, 250, 243, 0.78);
}

.monitoring-save {
  width: 100%;
  font-weight: 760;
}

.form-feedback {
  min-height: 18px;
}

.form-feedback.error {
  color: var(--danger);
}

.saved-searches {
  min-width: 0;
  padding: 18px;
}

.saved-searches-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ghost-button {
  height: 34px;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 250, 0.66);
  font-size: 12px;
}

.ghost-button:hover {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

.saved-searches-list {
  display: grid;
  gap: 10px;
}

.saved-search {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 250, 243, 0.78);
}

.saved-search-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.saved-search-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.delete-search-button {
  height: 24px;
  padding: 0 9px;
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.22);
  background: #fee4e2;
  font-size: 12px;
  font-weight: 760;
}

.delete-search-button:hover,
.delete-search-button[data-confirm="true"] {
  color: white;
  border-color: var(--danger);
  background: var(--danger);
}

.delete-search-button:disabled {
  opacity: 0.7;
  cursor: progress;
}

.saved-search h4 {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.saved-search p {
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.saved-search-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.radar-log-tree {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.radar-log-tree summary,
.radar-run-node summary,
.radar-source-node summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 820;
}

.radar-log-tree > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 32px;
}

.radar-log-tree > summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

/* Plano 009-D: contagens e datas dos logs em números tabulares */
.radar-log-tree > summary span,
.radar-log-list {
  font-variant-numeric: tabular-nums;
}

.radar-log-empty,
.radar-run-muted {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.radar-log-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.radar-run-node {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.radar-run-node.error {
  border-color: rgba(180, 35, 24, 0.22);
}

.radar-run-node > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.radar-run-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid rgba(208, 173, 69, 0.42);
}

.radar-run-error {
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

.radar-source-list {
  display: grid;
  gap: 8px;
}

.radar-source-node {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(246, 247, 251, 0.86);
}

.radar-source-node summary {
  font-size: 12px;
}

.radar-sample-row {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: white;
}

.radar-sample-row strong {
  font-size: 12px;
}

.radar-sample-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 680;
}

.meta-chip.ok {
  color: white;
  background: var(--accent);
}

.meta-chip.error {
  color: var(--danger);
  background: #fee4e2;
}

/* Plano 009-D: rotina ativa no Radar em verde sóbrio */
.meta-chip.ativa {
  color: white;
  background: var(--sev-leve);
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 250, 0.56);
  font-size: 14px;
  line-height: 1.45;
}

.viewer-body {
  background: var(--surface);
}

.viewer-body::before {
  display: none;
}

.viewer-page {
  width: min(1500px, calc(100vw - 40px));
  margin: 22px auto 60px;
}

.viewer-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 22px;
}

.viewer-header h1 {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(32px, 5vw, 68px);
  font-style: normal;
  font-weight: 840;
  line-height: 1;
}

.viewer-back,
.viewer-summary a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 250, 0.78);
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.viewer-back:hover,
.viewer-summary a:hover {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

.viewer-summary a[aria-disabled="true"] {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 250, 0.42);
  cursor: default;
  pointer-events: none;
}

.viewer-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto) auto;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}

.viewer-summary > div,
.viewer-table-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 250, 0.8);
}

.viewer-summary > div {
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 14px 16px;
}

.viewer-summary span,
.viewer-note {
  color: var(--muted);
  font-size: 12px;
}

.viewer-summary strong {
  min-width: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
  text-transform: capitalize;
}

.viewer-summary a {
  min-height: 72px;
  border-radius: 8px;
}

.viewer-table-shell {
  min-height: 360px;
  padding: 14px;
}

.viewer-note {
  margin-bottom: 12px;
}

.viewer-documents-section {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.viewer-documents-section h2 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.viewer-document-tree,
.viewer-process-tree {
  background: rgba(255, 255, 250, 0.72);
}

.viewer-process-tree {
  margin: 0 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.viewer-process-tree summary {
  min-height: 40px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

.viewer-process-tree summary a {
  color: var(--ink);
  text-underline-offset: 3px;
}

.viewer-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 230px);
}

.viewer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.viewer-table th,
.viewer-table td {
  max-width: 360px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.viewer-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-strong);
  color: #292a27;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.viewer-table td {
  background: rgba(251, 250, 243, 0.66);
  overflow-wrap: anywhere;
}

@media (max-width: 1060px) {

  .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .topnav,
  .hero-copy,
  .hero-brand-mark {
    grid-column: 1;
  }

  .hero-brand-mark {
    justify-self: start;
    align-self: start;
    width: min(520px, 100%);
    margin-top: 24px;
  }

  .section-heading,
  .monitoring-layout,
  .radar-options,
  .process-fields,
  .doe-metrics,
  .doe-range,
  .process-results-summary,
  .process-result-grid,
  .process-document-list a,
  .viewer-summary {
    grid-template-columns: 1fr;
  }

  .process-results-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .process-results-summary > div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 720px) {

  .app-main.page {
    width: auto;
    margin: 0;
    padding: 0 12px 28px;
  }

  .app-topbar {
    align-items: flex-start;
    flex-direction: column;
    margin: 0 -12px 16px;
    padding: 14px 12px;
  }

  .app-search {
    width: 100%;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .page,
  .viewer-page {
    width: min(100vw - 24px, 520px);
    margin: 12px auto 48px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    min-height: 680px;
    padding: 18px;
  }

  .topnav {
    justify-content: flex-end;
    gap: 0;
  }

  .hero-brand-mark {
    grid-column: 1 / -1;
    width: min(100%, 390px);
    padding: 12px;
    margin-top: 18px;
  }

  .topnav button {
    display: none;
  }

  .topnav::after {
    content: "";
    display: block;
    width: 28px;
    height: 18px;
    border-top: 3px solid var(--ink);
    border-bottom: 3px solid var(--ink);
    box-shadow: inset 0 7px 0 var(--surface), inset 0 10px 0 var(--ink);
  }

  h1 {
    font-size: clamp(56px, 18vw, 92px);
  }

  .hero-footer,
  .composer,
  .monitoring-grid,
  .result-summary,
  .contract-filters,
  .process-fields,
  .doe-metrics,
  .doe-term-form,
  .doe-range,
  .process-results-summary,
  .process-result-grid,
  .process-document-list a,
  .contract-meta {
    grid-template-columns: 1fr;
  }

  .result-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .result-summary > div:last-child {
    border-bottom: 0;
  }

  .process-search-head {
    display: grid;
  }

  .doe-panel-head,
  .doe-results-head,
  .doe-result-head {
    display: grid;
  }

  .contract-card-head {
    display: grid;
  }

  .hero-footer,
  .section-shell {
    padding: 18px;
  }

  .composer button {
    width: 100%;
  }

  .monitoring-header,
  .saved-search-head,
  .viewer-header {
    display: grid;
  }
}

/* Sidebar logout button */
.sidebar-logout-button {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #6b7c9e;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.13s, color 0.13s;
}

.sidebar-logout-button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #d8e0f4;
}

.sidebar-logout-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Admin icon */
.admin-icon {
  border: 2px solid currentColor;
  border-radius: 4px;
}

.admin-icon::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  margin: -6px auto 0;
}

/* Sidebar link button (for <a> styled as sidebar-button) */
a.sidebar-button {
  text-decoration: none;
}

/* Admin panel */
.admin-panels {
  display: grid;
  gap: 32px;
}

.admin-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-panel-head h2 {
  font-size: 18px;
  font-weight: 700;
}

.admin-user-list {
  display: grid;
  gap: 12px;
}

.admin-user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(15, 29, 61, 0.07);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 29, 61, 0.04);
}

.admin-user-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.admin-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.admin-user-info strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-email {
  font-size: 12px;
  color: var(--muted);
}

.admin-user-meta {
  font-size: 12px;
  color: var(--muted);
}

.admin-user-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.admin-user-actions button {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

/* Plano 009-B: padrão fichário no admin */
.admin-panel-head .dossie-eyebrow {
  margin-bottom: 2px;
}

.admin-panel-head > div:first-child {
  flex: 1;
  min-width: 0;
}

.admin-count {
  font-variant-numeric: tabular-nums;
}

.admin-count[hidden] {
  display: none;
}

.admin-user-info .meta-chip {
  align-self: flex-start;
  margin-top: 4px;
}

.admin-user-card {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-user-card:hover {
  border-color: rgba(15, 29, 61, 0.16);
  box-shadow: 0 3px 10px rgba(15, 29, 61, 0.07);
}

.admin-user-actions .approve-button {
  border: 0;
  border-radius: var(--btn-radius);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.admin-user-actions .approve-button:hover {
  background: var(--accent-dark);
}

.admin-user-actions .approve-button:disabled {
  opacity: 0.7;
  cursor: default;
}

/* ── Sniper icon (crosshair in circle) ───────────────────────────────────── */
.sniper-icon {
  border: 2px solid currentColor;
  border-radius: 999px;
  position: relative;
}

.sniper-icon::before {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5px;
  height: auto;
  background: currentColor;
  border-radius: 0;
}

.sniper-icon::after {
  position: absolute;
  left: 1px;
  right: 1px;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  height: 1.5px;
  background: currentColor;
  border-radius: 0;
}

/* ── Sniper section ──────────────────────────────────────────────────────── */
.sniper-section {
  display: grid;
  gap: 28px;
}

.sniper-header h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 6px 0 8px;
}

.sniper-header h2 span {
  color: var(--accent);
}

.sniper-header p {
  color: var(--muted);
  font-size: 15px;
  max-width: 720px;
  line-height: 1.5;
}

.sniper-add-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.sniper-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.sniper-form .field.full {
  flex: 1 1 100%;
  min-width: 240px;
  display: grid;
  gap: 10px;
}

.sniper-entity-field {
  flex: 1;
  min-width: 200px;
  display: grid;
  gap: 10px;
}

.sniper-entity-field span {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.sniper-autocomplete {
  position: relative;
}

.sniper-autocomplete input {
  width: 100%;
}

.sniper-autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 29, 61, 0.12);
  max-height: 240px;
  overflow-y: auto;
}

.sniper-autocomplete-list li {
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
}

.sniper-autocomplete-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sniper-autocomplete-list li:hover {
  background: var(--surface-strong);
}

.sniper-suggest-tag {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sniper-suggest-municipio {
  background: rgba(13, 31, 68, 0.1);
  color: var(--navy);
}

.sniper-suggest-entidade {
  background: rgba(208, 173, 69, 0.15);
  color: var(--accent-dark);
}

/* ── Botão Analisar com IA nos documentos ──────────────────────────────────── */
.process-document-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.process-document-item > a {
  flex: 1;
  min-width: 0;
}

.doc-ai-btn {
  flex-shrink: 0;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 7px;
  background: var(--navy);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.doc-ai-btn:hover {
  background: var(--accent);
  color: var(--navy-strong);
}

.process-ai-btn {
  position: absolute;
  top: 2px;
  right: 0;
  height: 26px;
  padding: 0 12px;
  border: 1.5px solid var(--accent);
  border-radius: 7px;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
  z-index: 1;
}

.process-ai-btn:hover {
  background: var(--accent);
  color: var(--navy-strong);
}

.process-ai-actions {
  position: absolute;
  top: 2px;
  right: 0;
  display: flex;
  gap: 8px;
  z-index: 1;
}

.process-ai-actions .process-ai-btn {
  position: static;
}

.process-escudo-btn {
  border-color: var(--navy, #0f1d3d);
  color: var(--navy, #0f1d3d);
}

.process-escudo-btn:hover {
  background: var(--navy, #0f1d3d);
  color: #fff;
}

/* Matriz de Riscos (tabela na resposta da IA) */
.ai-table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
  font-size: 13px;
}

.ai-table th,
.ai-table td {
  border: 1px solid var(--line, #d9dce3);
  padding: 6px 9px;
  text-align: left;
  vertical-align: top;
}

.ai-table th {
  background: var(--surface-strong, #f0f1f5);
  font-weight: 700;
}

/* ── Modal IA ──────────────────────────────────────────────────────────────── */
.ai-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 29, 61, 0.6);
  backdrop-filter: blur(3px);
}

.ai-modal[hidden] {
  display: none;
}

.ai-modal-box {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(780px, 95vw);
  height: min(680px, 90vh);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 29, 61, 0.22);
  overflow: hidden;
}

.ai-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.ai-modal-badge {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ai-modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.ai-modal-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-modal-close:hover {
  background: var(--line);
  color: var(--ink);
}

.ai-modal-messages {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-modal-hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
  margin: auto;
  max-width: 400px;
}

.ai-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-bubble-user {
  align-self: flex-end;
  background: var(--navy);
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-bubble-assistant {
  align-self: flex-start;
  background: var(--surface-strong);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.ai-bubble-loading {
  color: var(--muted);
  font-style: italic;
}

.ai-bubble-assistant p {
  margin: 0 0 0.6em;
  line-height: 1.65;
}

.ai-bubble-assistant p:last-child {
  margin-bottom: 0;
}

.ai-bubble-assistant strong {
  font-weight: 700;
  color: var(--ink);
}

.ai-bubble-assistant em {
  font-style: italic;
}

.ai-export-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.ai-export-toolbar button {
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.12);
  color: inherit;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.ai-export-toolbar button:hover {
  background: rgba(0,0,0,0.12);
}

.ai-modal-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
}

.ai-modal-input {
  width: 100%;
  min-height: 64px;
  max-height: 140px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  height: auto;
}

.ai-modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(208, 173, 69, 0.15);
  outline: none;
}

.ai-modal-send {
  height: 46px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--navy-strong);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.ai-modal-send:hover {
  background: var(--accent-dark);
}

.ai-modal-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sniper-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.sniper-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.sniper-panel-head h3 {
  font-size: 17px;
  font-weight: 700;
}

.sniper-list {
  display: grid;
  gap: 14px;
}

/* ── Sniper card ─────────────────────────────────────────────────────────── */
.sniper-card {
  border: 1px solid rgba(15, 29, 61, 0.07);
  border-radius: var(--card-radius);
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(15, 29, 61, 0.05);
  overflow: hidden;
}

.sniper-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.sniper-card-head h4 {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sniper-name-toggle {
  cursor: pointer;
  user-select: none;
}

.sniper-name-toggle::before {
  content: '▾  ';
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.sniper-name-toggle.sniper-name-collapsed::before {
  content: '▸  ';
}

.sniper-card-entity {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.sniper-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.sniper-card-actions button {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 8px;
}

.sniper-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
}

.sniper-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sniper-stat span {
  color: var(--muted);
  font-size: 13px;
}

/* ── Sniper process tree ─────────────────────────────────────────────────── */
.sniper-process-tree {
  border-top: 1px solid var(--line);
}

.sniper-process-tree > summary {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sniper-process-tree > summary::before {
  content: "▶";
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.15s;
  flex-shrink: 0;
}

.sniper-process-tree[open] > summary::before {
  transform: rotate(90deg);
}

.sniper-process-list {
  display: grid;
  gap: 0;
  padding: 0 16px 12px;
}

/* ── Sniper process row ──────────────────────────────────────────────────── */
.sniper-process-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 4px 0;
  background: var(--surface);
  overflow: hidden;
}

.sniper-process-row > summary {
  display: grid;
  grid-template-columns: 140px 1fr 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.sniper-process-row > summary::-webkit-details-marker { display: none; }

.sniper-process-row > summary strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  font-family: monospace;
}

.sniper-process-row > summary span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sniper-process-date {
  font-size: 11px !important;
  color: var(--muted) !important;
  white-space: nowrap !important;
}

.sniper-process-row:hover > summary {
  background: var(--surface-strong);
}

.sniper-process-detail {
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

/* ── Configurações ─────────────────────────────────────────────────────────── */
.config-page {
  display: grid;
  gap: 20px;
  max-width: 720px;
  padding: 0 32px 40px;
}

.config-card {
  background: #ffffff;
  border: 1px solid rgba(15, 29, 61, 0.07);
  border-radius: var(--card-radius);
  box-shadow: 0 2px 12px rgba(15, 29, 61, 0.05);
  padding: 28px;
}

.config-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 20px;
}

.config-email-label {
  font-size: 12px;
  color: #5b7fa6;
  margin-bottom: 18px;
}

.config-email-label strong {
  color: var(--ink);
}

.config-photo-area {
  display: flex;
  align-items: center;
  gap: 24px;
}

.config-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4.5px var(--accent);
}

.config-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.config-photo-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-photo-btn {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 250, 0.66);
  color: var(--ink);
  border-radius: var(--btn-radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  width: fit-content;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.config-photo-btn:hover {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

.config-photo-hint {
  font-size: 12px;
  color: var(--muted);
}

.config-form {
  display: grid;
  gap: 16px;
}

.config-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.config-form .field {
  display: grid;
  gap: 6px;
}

.config-form .field span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.config-form input {
  height: 44px;
  font-size: 14px;
}

.config-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

/* Plano 009-C: feedback de salvamento no mesmo padrão da linha de status do login */
.form-feedback.ok,
.form-feedback.error,
.form-feedback.andamento {
  padding: 8px 12px;
  border-left: 3px solid;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  font-weight: 600;
}

.form-feedback.ok {
  color: var(--sev-leve);
  border-left-color: var(--sev-leve);
  background: rgba(28, 125, 77, 0.08);
}

.form-feedback.error {
  color: var(--danger);
  border-left-color: var(--danger);
  background: rgba(180, 35, 24, 0.07);
}

.form-feedback.andamento {
  color: var(--ink);
  border-left-color: var(--accent);
  background: rgba(201, 168, 76, 0.12);
}

/* ── DOE Document Tree ─────────────────────────────────────────────────────── */
.doe-doc-tree {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.doe-doc-tree-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.ghost-button.active {
  color: white;
  background: var(--navy);
  border-color: var(--navy);
}

/* ── Agenda icon ──────────────────────────────────────────────────────────── */
.agenda-icon {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
  position: relative;
  margin-top: 2px;
}

.agenda-icon::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 3px;
  width: 2px;
  height: 4px;
  background: currentColor;
  box-shadow: 8px 0 0 currentColor;
}

.agenda-icon::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  height: 1.5px;
  background: currentColor;
}

/* ── Agenda de comunicados ────────────────────────────────────────────────── */
.agenda-page {
  display: grid;
  gap: 20px;
}

.agenda-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.agenda-controls-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.agenda-controls-nav strong {
  min-width: 160px;
  text-align: center;
  text-transform: capitalize;
  color: var(--ink);
}

.agenda-controls-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.agenda-controls-filters select {
  height: 38px;
  border-radius: var(--input-radius);
  border: 1px solid var(--line-strong);
  padding: 0 12px;
  font-size: 13px;
  background: var(--surface);
  color: var(--ink);
}

.agenda-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.agenda-cell {
  min-height: 84px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 8px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: default;
  position: relative;
}

.agenda-cell-head {
  min-height: auto;
  border: none;
  background: none;
  padding: 4px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.agenda-cell-vazia {
  min-height: 84px;
  border: none;
  background: none;
}

.agenda-cell-dia {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.agenda-cell-dia:hover {
  border-color: var(--accent);
}

.agenda-cell-hoje {
  border-color: var(--navy);
}

.agenda-cell-selecionada {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.35);
}

.agenda-cell-numero {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.agenda-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}

.agenda-badge--novo {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--accent);
}

.agenda-dia-detalhe {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.agenda-dia-detalhe h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

.agenda-dia-lista {
  display: grid;
  gap: 12px;
}

.agenda-comunicado-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface);
  display: grid;
  gap: 6px;
}

.agenda-comunicado-card--novo {
  border-color: var(--accent);
}

.agenda-comunicado-origem {
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.agenda-comunicado-titulo {
  font-size: 14px;
  color: var(--ink);
}

.agenda-comunicado-resumo {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.agenda-comunicado-links {
  display: flex;
  gap: 12px;
}

.agenda-comunicado-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}

.agenda-comunicado-link:hover {
  text-decoration: underline;
}

.agenda-comunicado-marcar {
  justify-self: start;
}

/* ── Matriz de Sanções icon ───────────────────────────────────────────────── */
.matriz-icon {
  width: 16px;
  height: 16px;
  position: relative;
  margin-top: 2px;
}

.matriz-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background: currentColor;
  box-shadow:
    9px 0 0 currentColor,
    0 9px 0 currentColor,
    9px 9px 0 currentColor;
}

/* ── Matriz de Sanções (página) ───────────────────────────────────────────── */
.matriz-page {
  display: grid;
  gap: 20px;
}

.matriz-legenda {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13px;
  color: var(--muted);
}

.matriz-legenda-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.matriz-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.matriz-dot--grave {
  background: #b42318;
}

.matriz-dot--moderado {
  background: #b8932d;
}

.matriz-dot--leve {
  background: #1c7d4d;
}

.matriz-fonte-titulo {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 8px 0 4px;
}

.matriz-grid {
  display: grid;
  gap: 24px;
}

.matriz-fonte-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.matriz-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--card-radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
}

.matriz-card--grave {
  border-left-color: #b42318;
}

.matriz-card--moderado {
  border-left-color: #b8932d;
}

.matriz-card--leve {
  border-left-color: #1c7d4d;
}

.matriz-card-codigo {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.matriz-card-descricao {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
}

.matriz-card-base {
  font-size: 12px;
  color: var(--muted);
}

.matriz-aviso {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 4px;
}

.icon {
  width: 20px; height: 20px; flex: 0 0 20px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}
.num { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Painel "O Diário de hoje" (dashboard) ---- */

@keyframes painel-rise {
  from { opacity: 0; transform: translateY(8px); }
}

@keyframes painel-rule-draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.painel-masthead {
  position: relative;
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-top: 3px double var(--ink);
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  animation: painel-rise 0.4s ease-out both;
}

.painel-masthead-eyebrow {
  margin: 0 0 var(--space-2);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.painel-masthead-rule {
  height: 1px;
  margin-bottom: var(--space-3);
  background: var(--line-strong);
  transform: scaleX(0);
  transform-origin: left;
  animation: painel-rule-draw 0.5s ease-out 0.1s forwards;
}

.painel-masthead-edicao {
  margin: 0 0 var(--space-1);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--ink);
}

.painel-masthead-status {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  font-size: 14px;
}

.painel-masthead-acao {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.painel-masthead-acao strong {
  font-size: 28px;
  color: var(--ink);
}

.painel-masthead-acao span {
  margin-right: auto;
  color: var(--muted);
}

.painel-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: var(--btn-radius);
  background: var(--accent);
  color: white;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.painel-cta:hover {
  background: var(--accent-dark);
}

.painel-cta--secundario {
  background: transparent;
  border: 1.5px solid var(--navy);
  color: var(--navy);
}

.painel-cta--secundario:hover {
  background: var(--navy);
  color: white;
}

.painel-colunas {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--space-4);
  margin-top: var(--space-4);
  animation: painel-rise 0.4s ease-out 0.12s both;
}

.painel-card {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.painel-card h3 {
  margin: 0 0 var(--space-3);
  color: var(--ink);
  font-size: 16px;
}

.painel-atencao-lista,
.painel-numeros-lista {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.painel-atencao-item {
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.painel-atencao-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.painel-atencao-cabecalho {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: 4px;
}

.painel-atencao-data {
  color: var(--muted);
  font-size: 13px;
}

.painel-atencao-origem {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.painel-atencao-alvo {
  color: var(--ink);
  font-size: 15px;
}

.painel-atencao-processo {
  color: var(--muted);
  font-size: 13px;
}

.painel-atencao-resumo {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.painel-atencao-acoes {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.painel-atencao-acoes a {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.painel-atencao-acoes button {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

.painel-numeros-lista a {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  color: inherit;
  text-decoration: none;
}

.painel-numeros-lista a:hover strong {
  color: var(--accent-dark);
}

.painel-numeros-lista strong {
  font-size: 22px;
  color: var(--ink);
}

.painel-numeros-lista span {
  color: var(--muted);
  font-size: 14px;
}

.painel-onboarding {
  margin-top: var(--space-4);
}

.painel-onboarding h3 {
  margin: 0 0 var(--space-2);
  color: var(--ink);
}

.painel-onboarding-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.painel-atalhos {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  animation: painel-rise 0.4s ease-out 0.24s both;
}

.painel-atalhos a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.painel-atalhos a:hover {
  color: var(--ink);
}

.estado-vazio {
  padding: var(--space-4);
  border: 1px dashed var(--line-strong);
  border-radius: var(--card-radius);
  background: var(--surface-strong);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .painel-colunas {
    grid-template-columns: 1fr;
  }
}

/* ---- Shell responsivo (rail de ícones + gaveta mobile) ---- */

#sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--btn-radius);
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(15, 29, 61, 0.45);
}

.sidebar-backdrop[hidden] {
  display: none;
}

@media (max-width: 899px) and (min-width: 768px) {
  .app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .sidebar-brand .brand-img,
  .sidebar-brand small,
  .sidebar-seal,
  .sidebar-profile-info,
  .sidebar-profile-chevron {
    display: none;
  }

  .sidebar-brand {
    justify-items: center;
    padding: 20px 8px 16px;
  }

  .sidebar-brand .brand-glifo-img {
    display: block;
  }

  .sidebar-nav .sidebar-button,
  .sidebar-logout-button {
    justify-content: center;
    gap: 0;
    padding: 0;
    font-size: 0;
  }
}

@media (max-width: 767px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-main {
    width: 100%;
  }

  .app-sidebar {
    position: fixed;
    inset: 0 30% 0 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .app-sidebar.sidebar-aberta {
    transform: translateX(0);
  }

  #sidebar-toggle {
    display: inline-flex;
  }
}

/* ---- "Fichário" — recorte (Radar), dossiê (Sniper), ficha (documentos) ---- */

.recorte-card {
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.recorte-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 3px 10px rgba(15, 29, 61, 0.07);
}

.recorte-rule {
  height: 1px;
  margin: var(--space-2) 0 var(--space-3);
  background: var(--line-strong);
  transform: scaleX(0);
  transform-origin: left;
  animation: painel-rule-draw 0.4s ease-out both;
}

.recorte-chip-primary {
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  font-weight: 700;
  color: var(--ink);
}

.dossie-eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dossie-stat strong.meta-chip {
  font-variant-numeric: tabular-nums;
}

.ficha-card {
  border-left: 4px solid var(--line);
  padding-left: 12px;
  transition: border-color 0.15s ease;
}

.ficha-merito {
  border-left-color: var(--accent);
}

.ficha-tramite {
  border-left-color: var(--line-strong);
}

.ficha-merito strong {
  color: var(--navy-strong);
}

/* Expansível de processo em comunicados (painel e agenda) — "guia de autos".
   Todas as regras são ESCOPADAS ao componente: os mesmos blocos internos
   (process-result-grid, fichas, botões de IA) seguem intactos no Sniper. */
.processo-expansivel {
  margin: var(--space-3) 0 var(--space-2);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.processo-expansivel-gatilho {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.processo-expansivel-gatilho::-webkit-details-marker {
  display: none;
}

.processo-expansivel-gatilho:hover {
  background: var(--surface-strong);
}

.processo-expansivel-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.processo-expansivel-numero {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.2;
  color: var(--navy-strong);
  font-variant-numeric: tabular-nums;
}

.processo-expansivel-chevron {
  margin-left: auto;
  color: var(--accent-dark);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.processo-expansivel[open] .processo-expansivel-chevron {
  transform: rotate(90deg);
}

.processo-expansivel > .sniper-process-detail {
  padding: 6px 14px 14px;
  border-top: 1px solid var(--line);
}

/* Correções de contexto estreito (o detalhe nasceu no card largo do Sniper) */
.processo-expansivel .process-ai-actions {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}

.processo-expansivel .process-result-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.processo-expansivel .process-result-grid .wide {
  grid-column: 1 / -1;
}

.processo-expansivel .process-result-grid .wide strong {
  font-weight: 500;
  font-size: 14px;
  line-height: 1.55;
}

.processo-expansivel .process-document-list a {
  grid-template-columns: 1fr;
  gap: 2px;
}

/* ============================================================
   Indicador de carregamento "trilha de auditoria" (plano 009)
   Derivado do glifo oficial: nós quadrados ligados por um traço,
   acendendo em sequência. Usa currentColor: dourado por padrão,
   herda branco dentro de botões dourados.
   ============================================================ */
.trilha-loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}

.trilha-loader i {
  position: relative;
  width: 9px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-radius: 2.5px;
  animation: trilha-acender 0.9s ease-in-out infinite;
}

.trilha-loader i + i::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -9.5px;
  width: 8px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.45;
  transform: translateY(-50%);
}

.trilha-loader i:nth-child(2) {
  animation-delay: 0.15s;
}

.trilha-loader i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes trilha-acender {
  0%,
  55%,
  100% {
    background-color: transparent;
  }

  15%,
  35% {
    background-color: currentColor;
  }
}

/* Estado de carregamento padrão: trilha + rótulo */
.estado-carregando {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .trilha-loader i {
    animation: none;
  }

  .trilha-loader i:nth-child(2) {
    background-color: currentColor;
  }

  /* Plano 009-E: desliga todo movimento quando o sistema pede */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

