/* =====================================================================
   PORTAL DO CONSELHO PLENO — OAB PARÁ
   Camada 2: Reset, base, layout e componentes
   ===================================================================== */

/* ---------------------------------------------------------------------
   RESET
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'tnum' 1;  /* números tabulares: placares alinham */
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

p { margin: 0 0 var(--space-3); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

img, svg { max-width: 100%; height: auto; vertical-align: middle; }

/* Barra de rolagem discreta em todo o portal (a da sidebar tem regra própria). */
html { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: content-box; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-6) 0;
}

/* ---------------------------------------------------------------------
   ACESSIBILIDADE
   Foco visível e consistente em todo elemento interativo (requisito 48).
   --------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--oab-blue-600);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-5);
  background: var(--oab-blue-800);
  color: var(--white);
  font-weight: var(--weight-semibold);
  border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus {
  left: 0;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------
   LAYOUT DA APLICAÇÃO
   --------------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* Faixa da sidebar pintada no BODY (cobre a página inteira, inclusive qualquer
   sobra abaixo do .app), evitando o vão branco no rodapé quando o conteúdo é
   mais alto que a barra fixa. Só nas telas autenticadas (que têm a sidebar). */
body[data-authenticated] {
  background: linear-gradient(90deg,
    var(--oab-blue-800) 0, var(--oab-blue-800) var(--sidebar-width),
    var(--bg-app) var(--sidebar-width));
}

/* ---------- Sidebar ---------- */
.sidebar {
  grid-row: 1 / -1;
  background: linear-gradient(180deg, var(--oab-blue-900) 0%, var(--oab-blue-800) 100%);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  overscroll-behavior: contain;
  z-index: var(--z-drawer);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: inherit;
}
.sidebar__brand:hover { text-decoration: none; color: inherit; }

/* Marca institucional — arquivo oficial da OAB Pará.
   Sobre fundo escuro usa-se a versão monocromática branca; sobre fundo
   claro, a versão colorida. A altura é o que define o tamanho: a largura
   acompanha para preservar a proporção do arquivo original. */
.brand-mark {
  flex-shrink: 0;
  display: block;
  height: 44px;
  width: auto;
}

.brand-text { min-width: 0; }
.brand-text__title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--white);
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.brand-text__sub {
  font-size: var(--text-2xs);
  color: rgba(255, 255, 255, 0.62);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  margin-top: 2px;
}

/* Só a navegação rola — marca, aviso ao vivo e rodapé ficam fixos.
   Scrollbar fina e discreta, no tom da barra escura. */
.sidebar__nav {
  padding: var(--space-3);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* Sem barra de rolagem visível. Em telas normais o menu cabe inteiro;
     em janelas muito baixas ainda rola pela roda/toque, sem barra. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar__nav::-webkit-scrollbar { width: 0; height: 0; display: none; }

.nav-group + .nav-group { margin-top: var(--space-4); }

.nav-group__label {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: rgba(255, 255, 255, 0.42);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  margin-bottom: 1px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
  position: relative;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--white);
  text-decoration: none;
}
.nav-link--active {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  font-weight: var(--weight-semibold);
}
.nav-link--active::before {
  content: '';
  position: absolute;
  left: calc(var(--space-3) * -1 + 2px);
  top: 20%; bottom: 20%;
  width: 3px;
  background: var(--oab-red-500);
  border-radius: 0 2px 2px 0;
}

.nav-link__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  opacity: 0.9;
}
.nav-link__icon svg { width: 18px; height: 18px; display: block; }
.nav-link--active .nav-link__icon { opacity: 1; }

.nav-link__badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  background: var(--oab-red-500);
  color: var(--white);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  text-align: center;
  border-radius: var(--radius-pill);
}

.sidebar__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: var(--text-2xs);
  color: rgba(255, 255, 255, 0.48);
  line-height: var(--leading-snug);
}

/* ---------- Aviso de sessão ao vivo na sidebar ---------- */
.live-banner {
  margin: 0 var(--space-3) var(--space-3);
  padding: var(--space-3);
  background: rgba(215, 25, 32, 0.16);
  border: 1px solid rgba(215, 25, 32, 0.45);
  border-radius: var(--radius-md);
  text-decoration: none;
  display: block;
}
.live-banner:hover { background: rgba(215, 25, 32, 0.24); text-decoration: none; }

.live-banner__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: #ff9ba0;
}
.live-banner__text {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.86);
  line-height: var(--leading-snug);
}

.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--oab-red-500);
  box-shadow: 0 0 0 0 rgba(215, 25, 32, 0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(215, 25, 32, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(215, 25, 32, 0); }
  100% { box-shadow: 0 0 0 0 rgba(215, 25, 32, 0); }
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-6);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar__toggle {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-lg);
  line-height: 1;
}

/* ---------- Busca global ---------- */
.search {
  position: relative;
  flex: 1;
  max-width: 460px;
}
.search__input {
  width: 100%;
  height: 38px;
  padding: 0 var(--space-4) 0 36px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  font-size: var(--text-sm);
  transition: border-color var(--duration-fast), background var(--duration-fast),
              box-shadow var(--duration-fast);
}
.search__input:focus {
  outline: none;
  background: var(--bg-surface);
  border-color: var(--oab-blue-600);
  box-shadow: var(--shadow-focus);
}
.search__icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: var(--text-sm);
}

.search__results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: var(--z-dropdown);
}
.search__results:empty { display: none; }

.search__item {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-primary);
}
.search__item:last-child { border-bottom: 0; }
.search__item:hover, .search__item:focus { background: var(--bg-selected); text-decoration: none; }
.search__item-type {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-muted);
}
.search__item-title { font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.search__item-sub { font-size: var(--text-xs); color: var(--text-secondary); }

/* ---------- Ações do topo ---------- */
.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Ícones SVG da barra superior — mesmo traço da navegação. */
.icon-button svg, .topbar__toggle svg { width: 20px; height: 20px; display: block; }
.search__icon svg { width: 18px; height: 18px; display: block; }

.icon-button {
  position: relative;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--text-lg);
  text-decoration: none;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.icon-button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.icon-button__badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  background: var(--oab-red-500);
  color: var(--white);
  font-size: 10px;
  font-weight: var(--weight-bold);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-surface);
}
/* display:grid acima vence o [hidden] — reforça para o badge sumir em zero. */
.icon-button__badge[hidden] { display: none; }

.user-chip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  text-decoration: none;
  color: inherit;
}
.user-chip:hover { background: var(--bg-hover); text-decoration: none; color: inherit; }

.avatar {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  background: var(--oab-blue-800);
  color: var(--white);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.02em;
}
.avatar--lg { width: 56px; height: 56px; font-size: var(--text-lg); }

.user-chip__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip__role {
  font-size: var(--text-2xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

/* ---------- Conteúdo ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }

.content {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.page-header__eyebrow {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}
.page-header__title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
}
.page-header__subtitle {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.page-header__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb__sep { opacity: 0.5; }

/* ---------------------------------------------------------------------
   CARDS
   --------------------------------------------------------------------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card__header {
  display: flex;
  flex-wrap: wrap;              /* título e ações empilham em telas estreitas */
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.card__title { min-width: 0; }  /* permite truncar sem empurrar o cabeçalho */
.card__title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.card__body { padding: var(--space-5); }
.card__body--flush { padding: 0; }
.card__footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-sunken);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: var(--text-sm);
}

/* ---------- Card de métrica ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.stat {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
}
a.stat:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.stat::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--oab-blue-800);
  opacity: 0.8;
}
.stat--success::after { background: var(--success-500); }
.stat--warning::after { background: var(--warning-500); }
.stat--danger::after  { background: var(--danger-500); }
.stat--neutral::after { background: var(--neutral-400); }

.stat__label {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-muted);
}
.stat__value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  line-height: 1.1;
  margin-top: var(--space-1);
  letter-spacing: var(--tracking-tight);
}
.stat__hint {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------------
   BOTÕES
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 38px;
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--primary {
  background: var(--oab-blue-800);
  color: var(--white);
  border-color: var(--oab-blue-800);
}
.btn--primary:hover { background: var(--oab-blue-700); border-color: var(--oab-blue-700); color: var(--white); }
.btn--primary:active { background: var(--oab-blue-900); }

.btn--secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn--secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary); }

.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn--danger {
  background: var(--danger-500);
  color: var(--white);
  border-color: var(--danger-500);
}
.btn--danger:hover { background: var(--danger-600); border-color: var(--danger-600); color: var(--white); }

.btn--danger-outline {
  background: var(--bg-surface);
  color: var(--danger-600);
  border-color: var(--danger-500);
}
.btn--danger-outline:hover { background: var(--danger-50); color: var(--danger-700); }

.btn--success {
  background: var(--success-600);
  color: var(--white);
  border-color: var(--success-600);
}
.btn--success:hover { background: var(--success-700); border-color: var(--success-700); color: var(--white); }

.btn--sm { height: 30px; padding: 0 var(--space-3); font-size: var(--text-xs); }
.btn--lg { height: 46px; padding: 0 var(--space-6); font-size: var(--text-md); }
.btn--block { width: 100%; }

/* Botões grandes do Modo Sessão (requisito 36) */
.btn--command {
  height: 64px;
  padding: 0 var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  flex-direction: column;
  gap: 2px;
}
.btn--command small {
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  font-weight: var(--weight-regular);
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.85;
}

.btn-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---------------------------------------------------------------------
   BADGES E ESTADOS
   Requisito 57: nunca depender só de cor — sempre símbolo + texto.
   --------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge__dot { font-size: 9px; line-height: 1; }

.badge--neutral      { background: var(--neutral-100); color: var(--neutral-700); border-color: var(--neutral-200); }
.badge--neutral-dark { background: var(--neutral-200); color: var(--neutral-800); border-color: var(--neutral-300); }
.badge--info         { background: var(--info-100);    color: var(--info-700);    border-color: #c5daf0; }
.badge--success      { background: var(--success-100); color: var(--success-700); border-color: #b9e3cf; }
.badge--warning      { background: var(--warning-100); color: var(--warning-700); border-color: #f2dcae; }
.badge--danger       { background: var(--danger-100);  color: var(--danger-700);  border-color: #f3c3c5; }

.badge--lg { font-size: var(--text-xs); padding: 4px var(--space-3); }

/* Marcador de sigilo */
.confidentiality {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}
.confidentiality--publico       { background: var(--success-50);  color: var(--success-700); }
.confidentiality--institucional { background: var(--neutral-100); color: var(--neutral-700); }
.confidentiality--restrito      { background: var(--warning-100); color: var(--warning-700); }
.confidentiality--sigiloso      { background: var(--danger-100);  color: var(--danger-700); }

/* ---------------------------------------------------------------------
   QUÓRUM
   --------------------------------------------------------------------- */
.quorum {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid;
}
.quorum--ok {
  background: var(--success-50);
  border-color: #b9e3cf;
}
.quorum--fail {
  background: var(--warning-50);
  border-color: #f2dcae;
}

.quorum__figure {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
}
.quorum--ok   .quorum__figure { color: var(--success-700); }
.quorum--fail .quorum__figure { color: var(--warning-700); }

.quorum__figure small {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  opacity: 0.6;
}

.quorum__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* O indicador "vivo" herda a cor do estado do quórum: um ponto vermelho
   dentro de uma caixa verde de "quórum atingido" passa sinal contraditório. */
.quorum--ok .pulse-dot {
  background: var(--success-500);
  animation-name: pulse-ok;
}
@keyframes pulse-ok {
  0%   { box-shadow: 0 0 0 0 rgba(29, 150, 96, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(29, 150, 96, 0); }
  100% { box-shadow: 0 0 0 0 rgba(29, 150, 96, 0); }
}
.quorum--fail .pulse-dot {
  background: var(--warning-500);
  animation-name: pulse-warn;
}
@keyframes pulse-warn {
  0%   { box-shadow: 0 0 0 0 rgba(201, 138, 17, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(201, 138, 17, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 138, 17, 0); }
}
.quorum__detail { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }

.quorum__bar {
  flex: 1;
  min-width: 100px;
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.quorum__bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width var(--duration-base) var(--ease-out);
}
.quorum--ok   .quorum__bar-fill { background: var(--success-500); }
.quorum--fail .quorum__bar-fill { background: var(--warning-500); }

/* ---------------------------------------------------------------------
   TABELAS
   --------------------------------------------------------------------- */
/* Tabelas densas (chamada nominal, auditoria) rolam dentro do próprio card,
   nunca empurram a página. max-width:100% é o que impede o "blowout" quando
   o container é item de flex/grid. */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  max-width: 100%;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-hover);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-hover); }

.table--compact tbody td,
.table--compact thead th { padding: var(--space-2) var(--space-3); }

.table__num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: nowrap;
}
.table__primary {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.table__secondary {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.table__actions { text-align: right; white-space: nowrap; }
.table__center { text-align: center; }

/* ---------------------------------------------------------------------
   PAUTA (lista de itens)
   --------------------------------------------------------------------- */
.agenda-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-fast);
}
.agenda-item:last-child { border-bottom: 0; }
.agenda-item:hover { background: var(--bg-hover); }

.agenda-item--current {
  background: var(--oab-blue-50);
  box-shadow: inset 3px 0 0 var(--oab-blue-800);
}
.agenda-item--voting {
  background: var(--danger-50);
  box-shadow: inset 3px 0 0 var(--danger-500);
}
.agenda-item--judged { opacity: 0.72; }
.agenda-item--withdrawn { opacity: 0.55; }

.agenda-item__position {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--neutral-400);
  text-align: center;
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
}
.agenda-item--current .agenda-item__position { color: var(--oab-blue-800); }

.agenda-item__number {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.agenda-item__title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  margin: 2px 0 var(--space-1);
  line-height: var(--leading-snug);
}
.agenda-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.agenda-item__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

/* ---------------------------------------------------------------------
   FORMULÁRIOS
   --------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4) var(--space-5);
}
.form-grid--2 { grid-template-columns: repeat(2, 1fr); }
.field--full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: var(--space-2); }

.field__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.field__label .required { color: var(--danger-500); margin-left: 2px; }

.field__hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: var(--leading-snug);
}
.field__error {
  font-size: var(--text-xs);
  color: var(--danger-600);
  font-weight: var(--weight-medium);
  display: flex;
  align-items: center;
  gap: 4px;
}

.input, .select, .textarea {
  width: 100%;
  min-height: 38px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--oab-blue-600);
  box-shadow: var(--shadow-focus);
}
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--bg-sunken);
  color: var(--text-muted);
  cursor: not-allowed;
}
.input[aria-invalid='true'], .select[aria-invalid='true'], .textarea[aria-invalid='true'] {
  border-color: var(--danger-500);
}

.textarea { min-height: 100px; resize: vertical; line-height: var(--leading-normal); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%235b5f68' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.checkbox, .radio {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  cursor: pointer;
  line-height: var(--leading-snug);
}
.checkbox input, .radio input {
  margin: 3px 0 0;
  width: 16px; height: 16px;
  accent-color: var(--oab-blue-800);
  cursor: pointer;
  flex-shrink: 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
}
.filter-bar .field { min-width: 150px; flex: 1; }
.filter-bar .field--sm { max-width: 150px; }

/* ---------------------------------------------------------------------
   ALERTAS
   --------------------------------------------------------------------- */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-4);
}
.alert__icon { flex-shrink: 0; font-size: var(--text-lg); line-height: 1.2; }
.alert__title { font-weight: var(--weight-semibold); margin-bottom: 2px; }

.alert--success { background: var(--success-50); border-color: #b9e3cf; color: var(--success-700); }
.alert--error   { background: var(--danger-50);  border-color: #f3c3c5; color: var(--danger-700); }
.alert--warning { background: var(--warning-50); border-color: #f2dcae; color: var(--warning-700); }
.alert--info    { background: var(--info-50);    border-color: #c5daf0; color: var(--info-700); }

/* ---------------------------------------------------------------------
   ABAS
   --------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  margin-bottom: var(--space-5);
  -webkit-overflow-scrolling: touch;
}
.tab {
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--duration-fast), border-color var(--duration-fast);
}
.tab:hover { color: var(--text-primary); text-decoration: none; }
.tab[aria-selected='true'] {
  color: var(--oab-blue-800);
  border-bottom-color: var(--oab-blue-800);
  font-weight: var(--weight-semibold);
}
.tab__count {
  margin-left: 6px;
  padding: 1px 6px;
  background: var(--bg-hover);
  border-radius: var(--radius-pill);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
}

.tab-panel[hidden] { display: none; }

/* ---------------------------------------------------------------------
   TIMELINE (histórico do processo — requisito 62)
   --------------------------------------------------------------------- */
.timeline { position: relative; padding-left: var(--space-6); }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border-subtle);
}

.timeline__item { position: relative; padding-bottom: var(--space-5); }
.timeline__item:last-child { padding-bottom: 0; }

.timeline__dot {
  position: absolute;
  left: calc(var(--space-6) * -1 + 1px);
  top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-strong);
}
.timeline__item--done .timeline__dot    { background: var(--success-500); border-color: var(--success-500); }
.timeline__item--current .timeline__dot { background: var(--oab-blue-800); border-color: var(--oab-blue-800); box-shadow: 0 0 0 3px var(--oab-blue-100); }

.timeline__title { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.timeline__meta  { font-size: var(--text-xs); color: var(--text-muted); }
.timeline__body  { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 2px; }

/* ---------------------------------------------------------------------
   ESTADO VAZIO
   --------------------------------------------------------------------- */
.empty {
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--text-secondary);
}
.empty__icon { font-size: var(--text-4xl); opacity: 0.35; margin-bottom: var(--space-3); }
.empty__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.empty__text { font-size: var(--text-sm); max-width: 460px; margin: 0 auto var(--space-4); }

/* ---------------------------------------------------------------------
   UTILITÁRIOS
   --------------------------------------------------------------------- */
.stack   { display: flex; flex-direction: column; gap: var(--space-4); }
.stack--sm { gap: var(--space-2); }
.stack--lg { gap: var(--space-6); }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--tight { gap: var(--space-2); }

/* align-items:start — cards lado a lado com conteúdos de alturas diferentes
   não devem esticar e deixar vazio no rodapé do menor. */
/* min(px, 100%): a coluna encolhe para a largura total quando a tela é mais
   estreita que o mínimo, evitando estouro horizontal em qualquer tamanho. */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: var(--space-5); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: var(--space-4); }
.grid-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-5); align-items: start; }

/* Trilha 1fr tem min-width:auto por padrão: um conteúdo largo — tabela,
   número de processo em monoespaçada — estica a coluna e empurra a página
   para fora da tela no celular. O min-width:0 devolve o controle ao grid,
   e quem precisa rolar (.table-wrap) rola dentro do próprio card. */
.grid-2 > *, .grid-3 > * { min-width: 0; }

.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-danger    { color: var(--danger-600); }
.text-success   { color: var(--success-600); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-semibold { font-weight: var(--weight-semibold); }
.font-mono { font-family: var(--font-mono); }
.uppercase { text-transform: uppercase; letter-spacing: var(--tracking-caps); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.divider { height: 1px; background: var(--border-subtle); margin: var(--space-4) 0; }

.definition {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}
.definition dt {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-muted);
  padding-top: 2px;
}
.definition dd { margin: 0; }

/* Barra de progresso genérica */
.progress {
  height: 8px;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  background: var(--oab-blue-700);
  border-radius: var(--radius-pill);
  transition: width var(--duration-base) var(--ease-out);
}

/* Gráfico de barras simples, sem biblioteca externa */
.chart {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  height: 160px;
  padding-top: var(--space-4);
}
.chart__col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); height: 100%; }
.chart__bar {
  width: 100%;
  max-width: 42px;
  background: linear-gradient(180deg, var(--oab-blue-600), var(--oab-blue-800));
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-top: auto;
  min-height: 3px;
  position: relative;
}
.chart__value {
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
}
.chart__label { font-size: var(--text-2xs); color: var(--text-muted); }

/* Paginação */
.pagination { display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin-top: var(--space-6); }
.pagination__link {
  min-width: 34px; height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
}
.pagination__link:hover { background: var(--bg-hover); text-decoration: none; }
.pagination__link--active {
  background: var(--oab-blue-800);
  border-color: var(--oab-blue-800);
  color: var(--white);
  font-weight: var(--weight-semibold);
}

/* ---------------------------------------------------------------------
   RESPONSIVO (requisito 47)
   Testado em 360, 390, 430, 768, 1024, 1366, 1440 e 1920.
   --------------------------------------------------------------------- */

/* Notebooks pequenos: reduz a sidebar */
@media (max-width: 1280px) {
  :root { --sidebar-width: 224px; }
  .grid-sidebar { grid-template-columns: minmax(0, 1fr) 300px; }
}

/* Tablet paisagem: coluna lateral vira empilhada */
@media (max-width: 1080px) {
  .grid-sidebar { grid-template-columns: minmax(0, 1fr); }
}

/* Tablet retrato e celular: sidebar vira drawer */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  /* Sem coluna fixa no celular (a sidebar vira gaveta), então nada de faixa. */
  body[data-authenticated] { background: var(--bg-app); }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--duration-base) var(--ease-out);
    box-shadow: var(--shadow-lg);
  }
  .sidebar[data-open='true'] { transform: translateX(0); }

  .topbar__toggle { display: grid; place-items: center; }

  .scrim {
    position: fixed;
    inset: 0;
    background: rgba(23, 23, 26, 0.45);
    z-index: calc(var(--z-drawer) - 1);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-base) var(--ease-out);
  }
  .scrim[data-open='true'] { opacity: 1; pointer-events: auto; }

  .content { padding: var(--space-4); }
  .form-grid--2 { grid-template-columns: 1fr; }
}

/* Celular */
@media (max-width: 640px) {
  :root { --topbar-height: 56px; }

  .topbar { padding: 0 var(--space-3); gap: var(--space-2); }
  .search { max-width: none; }
  .user-chip__name, .user-chip__role { display: none; }
  .user-chip { padding: 2px; border: 0; }

  .content { padding: var(--space-3); }

  .page-header { flex-direction: column; align-items: stretch; }
  .page-header__actions .btn { flex: 1; }
  .page-header__title { font-size: var(--text-xl); }

  .card__header, .card__body { padding: var(--space-4); }
  .card__body--flush { padding: 0; }

  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); }
  .stat { padding: var(--space-3) var(--space-4); }
  .stat__value { font-size: var(--text-2xl); }

  .quorum { flex-wrap: wrap; padding: var(--space-4); gap: var(--space-3); }
  .quorum__bar { flex-basis: 100%; }

  .agenda-item {
    grid-template-columns: 40px 1fr;
    gap: var(--space-3);
    padding: var(--space-4);
  }
  .agenda-item__side {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .filter-bar { padding: var(--space-3); }
  .filter-bar .field { min-width: 100%; }
  .filter-bar .field--sm { max-width: none; }

  .btn--command { height: 56px; font-size: var(--text-md); }

  .definition { grid-template-columns: 1fr; gap: var(--space-1); }
  .definition dd { margin-bottom: var(--space-3); }

  /* Tabelas densas viram cartões empilhados */
  .table--stack thead { display: none; }
  .table--stack tbody tr {
    display: block;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
  }
  .table--stack tbody td {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 3px 0;
    border: 0;
    text-align: right;
  }
  .table--stack tbody td::before {
    content: attr(data-label);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    color: var(--text-muted);
    text-align: left;
    flex-shrink: 0;
  }
  .table--stack .table__actions { justify-content: flex-end; padding-top: var(--space-2); }

  /* Correção responsiva: em modo empilhado o valor (nº de processo, assunto,
     selos) precisa quebrar linha. Sem isto, o white-space:nowrap de .table__num
     e afins força a tabela a ficar mais larga que a tela e o conteúdo é cortado
     pela borda direita do .table-wrap. */
  .table--stack tbody td { min-width: 0; align-items: baseline; }
  .table--stack tbody td,
  .table--stack tbody td .table__num,
  .table--stack tbody td .table__primary,
  .table--stack tbody td .table__secondary,
  .table--stack tbody td .table__actions,
  .table--stack tbody td .badge,
  .table--stack tbody td .tag,
  .table--stack tbody td .chip {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  /* .truncate corta com reticências numa linha (bom na tabela larga do desktop),
     mas empilhado ele fixa uma largura grande e estoura a tela. Empilhado, deixa
     o texto fluir em várias linhas. O !important vence o max-width inline do HTML. */
  .table--stack tbody td .truncate {
    max-width: none !important;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* Telas muito estreitas (360px) */
@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr; }
  .btn { padding: 0 var(--space-3); }
}

/* Telas grandes: aproveita o espaço sem esticar linhas de texto */
@media (min-width: 1600px) {
  .content { padding: var(--space-8) var(--space-6); }
}

/* ---------------------------------------------------------------------
   IMPRESSÃO — pautas e atas são impressas com frequência
   --------------------------------------------------------------------- */
@media print {
  .sidebar, .topbar, .page-header__actions, .filter-bar,
  .btn, .scrim, .no-print { display: none !important; }

  .app { grid-template-columns: 1fr; }
  .content { max-width: none; padding: 0; }
  .card { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
  body { background: #fff; font-size: 11pt; }
  a { color: #000; text-decoration: none; }
  .table thead th { background: #eee !important; -webkit-print-color-adjust: exact; }
}

/* =====================================================================
   Utilitário de ícones, foco acessível e microefeitos (modernização)
   ===================================================================== */

/* Ícone SVG inline: acompanha o tamanho e a cor do texto ao redor. */
.ico { width: 1.15em; height: 1.15em; vertical-align: -0.16em; flex-shrink: 0; }
.card__title .ico { color: var(--accent); }

/* Transições suaves onde o estado muda (cor, fundo, sombra, leve elevação). */
.btn, .card, .stat, .nav-link, .icon-button, .table tbody tr,
.feature, .profile-option, .badge, a { transition:
  background-color var(--duration-fast) var(--ease-out),
  border-color var(--duration-fast) var(--ease-out),
  color var(--duration-fast) var(--ease-out),
  box-shadow var(--duration-base) var(--ease-out),
  transform var(--duration-base) var(--ease-out); }

/* Cartões e botões "levantam" de leve ao passar o mouse. */
.card:hover { box-shadow: var(--shadow-md); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--primary:hover, .btn--command:hover { transform: translateY(-1px); }
.btn:active, .btn--primary:active { transform: translateY(0); }

/* Entrada suave do conteúdo ao carregar a página. */
@keyframes fade-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.content > * { animation: fade-rise var(--duration-base) var(--ease-out) both; }

/* Respeita quem pediu menos movimento no sistema operacional. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .stat:hover, .btn--primary:hover, .btn--command:hover { transform: none; }
}

/* Ícones SVG nos títulos de cartão e nos estados vazios */
.card__title { display: inline-flex; align-items: center; gap: var(--space-2); }
.card__title .ico { width: 1.05em; height: 1.05em; }
.empty__icon svg { width: 2.25rem; height: 2.25rem; opacity: 1; }
.empty__icon { opacity: 0.4; color: var(--text-muted); }

/* ---------------------------------------------------------------------
   Toasts (mensagens flash relocadas para o canto por JS)
   --------------------------------------------------------------------- */
.alert.toast {
  margin: 0;
  position: relative;
  padding-right: var(--space-8);
  box-shadow: var(--shadow-lg);
  background: var(--bg-surface);
}
.alert__close {
  position: absolute;
  top: 6px; right: 8px;
  width: 24px; height: 24px;
  border: 0; background: transparent;
  color: var(--text-muted);
  font-size: 20px; line-height: 1;
  cursor: pointer; border-radius: var(--radius-sm);
}
.alert__close:hover { color: var(--text-primary); background: var(--bg-hover); }
/* Fora do modo toast (inline, sem JS) o X não faz sentido. */
.alert:not(.toast) .alert__close { display: none; }

@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
.toast--in { animation: toast-in var(--duration-base) var(--ease-out); }
.toast--out { animation: toast-out 0.25s var(--ease-out) forwards; }

/* Botão de tema (sol/lua) — mostra o ícone do tema para o qual vai trocar. */
.theme-icon { display: inline-grid; place-items: center; }
.theme-icon--sun { display: none; }
:root[data-theme="dark"] .theme-icon--moon { display: none; }
:root[data-theme="dark"] .theme-icon--sun { display: inline-grid; }
.theme-icon svg { width: 20px; height: 20px; }

/* Crédito do desenvolvedor no rodapé da sidebar */
.sidebar__dev { margin-top: 6px; font-size: var(--text-2xs); color: rgba(255, 255, 255, 0.4); line-height: var(--leading-snug); }
.sidebar__dev a { color: rgba(255, 255, 255, 0.72); text-decoration: underline; }
.sidebar__dev a:hover { color: #fff; }
