/* ═══════════════════════════════════════════════════════════════
   XX JEJUNOS 2026 — Design System v3
   Referência: Linear · Stripe · Vercel · Notion · GitHub
   ═══════════════════════════════════════════════════════════════ */

/* ─── Custom Properties ──────────────────────────────────────── */
:root {

  /* ── Brand & Identity ─────────────────────────── */
  --brand:          #0f766e;
  --brand-dark:     #134e4a;
  --brand-hover:    #0d9488;
  --brand-focus:    #2563eb;
  --brand-subtle:   #ecfdf5;
  --brand-muted:    rgba(15, 118, 110, .10);

  /* Backward-compat aliases (para templates existentes) */
  --primary:        #0f766e;
  --primary-dark:   #134e4a;
  --primary-light:  #0d9488;
  --primary-muted:  rgba(15, 118, 110, .10);

  /* ── Event Identity ───────────────────────────── */
  --gold:           #d97706;
  --gold-bright:    #f59e0b;
  --gold-bg:        #fffbeb;
  --bronze:         #a16207;

  /* ── Category colors ──────────────────────────── */
  --cat-sub12: #166534;
  --cat-sub15: #1e3a8a;
  --cat-sub18: #9a3412;

  /* ── Semantic surface tokens — Light ──────────── */
  --bg-base:        #f8fafc;
  --bg-surface:     #ffffff;
  --bg-subtle:      #f1f5f9;
  --bg-muted:       #e2e8f0;

  --border:         #e2e8f0;
  --border-strong:  #cbd5e1;

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-disabled:  #cbd5e1;

  /* Backward-compat gray scale */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* ── Status palette ───────────────────────────── */
  --success:        #16a34a;
  --success-bg:     #f0fdf4;
  --success-border: #bbf7d0;

  --warning:        #d97706;
  --warning-bg:     #fffbeb;
  --warning-border: #fde68a;

  --danger:         #dc2626;
  --danger-bg:      #fef2f2;
  --danger-border:  #fecaca;

  --info:           #0284c7;
  --info-bg:        #f0f9ff;
  --info-border:    #bae6fd;

  /* ── Spacing & radius ─────────────────────────── */
  --radius-xs:   3px;
  --radius-sm:   5px;
  --radius:      8px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-full: 9999px;
  --border-radius: 8px; /* compat */

  /* ── Elevation ────────────────────────────────── */
  --shadow-xs:  0 1px 2px rgba(0, 0, 0, .04);
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow:     0 4px 6px -1px rgba(0, 0, 0, .07), 0 2px 4px -1px rgba(0, 0, 0, .04);
  --shadow-md:  0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -2px rgba(0, 0, 0, .04);
  --shadow-lg:  0 20px 25px -5px rgba(0, 0, 0, .08), 0 10px 10px -5px rgba(0, 0, 0, .03);
  --shadow-ring: 0 0 0 3px rgba(15, 118, 110, .18);

  /* ── Timing ───────────────────────────────────── */
  --t-fast:   100ms;
  --t:        160ms;
  --t-slow:   260ms;
  --ease:     cubic-bezier(.4, 0, .2, 1);
  --transition: all 0.18s ease-in-out; /* compat */

  /* ── Typography ───────────────────────────────── */
  --font: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* ── Dark Mode (backward compat) ──────────────── */
  --dark-bg:             #0a0f1e;
  --dark-surface:        #111827;
  --dark-elevated:       #1e2433;
  --dark-border:         #1e2a3a;
  --dark-text-primary:   #f1f5f9;
  --dark-text-secondary: #94a3b8;
  --dark-text-muted:     #64748b;
}

/* ─── Dark mode token overrides ─────────────────────────────── */
[data-bs-theme="dark"] {
  --bg-base:        #0a0f1e;
  --bg-surface:     #111827;
  --bg-subtle:      #1a2235;
  --bg-muted:       #293145;

  --border:         #1e2a3a;
  --border-strong:  #2d3d52;

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-disabled:  #374151;

  --brand:          #2dd4bf;
  --brand-dark:     #0f766e;
  --brand-hover:    #5eead4;
  --brand-focus:    #60a5fa;
  --brand-subtle:   rgba(20, 184, 166, .15);
  --brand-muted:    rgba(20, 184, 166, .18);
  --gold:           #f59e0b;

  --success-bg:     rgba(22, 163, 74, .1);
  --success-border: rgba(22, 163, 74, .25);
  --warning-bg:     rgba(217, 119, 6, .1);
  --warning-border: rgba(217, 119, 6, .25);
  --danger-bg:      rgba(220, 38, 38, .1);
  --danger-border:  rgba(220, 38, 38, .25);
  --info-bg:        rgba(2, 132, 199, .1);
  --info-border:    rgba(2, 132, 199, .25);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .3);
  --shadow:    0 4px 6px -1px rgba(0, 0, 0, .45), 0 2px 4px -1px rgba(0, 0, 0, .3);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, .5), 0 4px 6px -2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, .55), 0 10px 10px -5px rgba(0, 0, 0, .3);

  /* Gray scale dark */
  --gray-50:  #1a1f2e;
  --gray-100: #0a0f1e;
  --gray-200: #111827;
  --gray-300: #1e2433;
  --gray-400: #374151;
  --gray-500: #4b5563;
  --gray-600: #94a3b8;
  --gray-700: #cbd5e1;
  --gray-800: #e2e8f0;
  --gray-900: #f1f5f9;

  background-color: var(--bg-base);
  color: var(--text-primary);
}
[data-bs-theme="dark"] body {
  background-color: var(--bg-base) !important;
  color: var(--text-primary);
}

/* ─── Base ───────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-base);
  /* Rodapé fixo embaixo (sticky footer): sem isso, em páginas com pouco
     conteúdo o footer ficava logo depois do <main>, no meio da tela, em
     vez de grudado no fim da viewport. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main.container { flex: 1 0 auto; }

img, svg, video, canvas {
  max-width: 100%;
}

.container,
.container-fluid,
.row,
.card,
.card-body,
.dropdown-menu {
  min-width: 0;
}

h1 { font-size: 2rem;    font-weight: 800; line-height: 1.2; letter-spacing: -.03em; }
h2 { font-size: 1.5rem;  font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.35; letter-spacing: -.015em; }
h4 { font-size: 1.1rem;  font-weight: 600; line-height: 1.4; }
h5 { font-size: .95rem;  font-weight: 600; }
h6 { font-size: .875rem; font-weight: 600; }

a { color: var(--brand-focus); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand); }

:focus-visible {
  outline: 2px solid var(--brand-focus);
  outline-offset: 2px;
}

/* ─── Navbar ─────────────────────────────────────────────────── */
.navbar.bg-jejunos {
  background: #0759a8;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  padding: .4rem 0;
}
[data-bs-theme="dark"] .navbar.bg-jejunos {
  background: #083b74 !important;
  border-bottom: 1px solid rgba(255, 255, 255, .06) !important;
}
.bg-jejunos { /* compat */
  background: #0759a8;
}

.navbar-brand {
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.navbar .nav-link {
  font-size: .8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .78) !important;
  padding: .4rem .65rem;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.navbar .nav-link:hover    { background: rgba(255, 255, 255, .12); color: #fff !important; }
.navbar .nav-link.active   { background: rgba(255, 255, 255, .16); color: #fff !important; font-weight: 600; }

/* Navbar dropdown */
.navbar .dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 5px;
  min-width: 210px;
  animation: fadeSlideIn var(--t) var(--ease);
  background: var(--bg-surface);
}
[data-bs-theme="dark"] .navbar .dropdown-menu {
  background: var(--bg-surface);
  border-color: var(--border);
}
.navbar .dropdown-item {
  font-size: .8rem;
  font-weight: 500;
  padding: .4rem .65rem;
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  transition: background var(--t-fast);
}
.navbar .dropdown-item:hover { background: var(--bg-subtle); color: var(--text-primary); }
[data-bs-theme="dark"] .navbar .dropdown-item { color: var(--text-primary) !important; }
[data-bs-theme="dark"] .navbar .dropdown-item:hover { background: var(--bg-subtle) !important; }
.navbar .dropdown-header {
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  padding: .5rem .65rem .2rem;
}
.navbar .dropdown-divider { border-color: var(--border); margin: 4px 0; }
[data-bs-theme="dark"] .navbar .dropdown-header { color: var(--text-muted) !important; }
[data-bs-theme="dark"] .navbar .dropdown-divider { border-color: var(--border) !important; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Theme toggle */
.btn-theme-toggle {
  width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .15);
  color: rgba(255, 255, 255, .85);
  font-size: .875rem;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, .18);
  color: var(--gold-bright);
  transform: rotate(12deg);
}
[data-bs-theme="dark"] .btn-theme-toggle {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .1);
}

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t) var(--ease),
              border-color var(--t) var(--ease),
              transform var(--t) var(--ease);
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong) !important;
}
.hover-card { cursor: pointer; }
.hover-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md) !important;
  border-color: var(--border-strong) !important;
}
.modal .card:hover,
.modal-content:hover { transform: none !important; box-shadow: var(--shadow-xs) !important; }

.card-header {
  padding: .875rem 1.25rem;
  background: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border) !important;
}
.card-header h1, .card-header h2, .card-header h3,
.card-header h4, .card-header h5, .card-header h6 {
  margin: 0;
  font-weight: 700;
  color: var(--text-primary);
}
.card-body   { padding: 1.25rem; }
.card-footer {
  padding: .75rem 1.25rem;
  background: var(--bg-subtle) !important;
  border-top: 1px solid var(--border) !important;
}
.card-sm .card-body { padding: .625rem .875rem; }

/* ─── Stat cards (SIGA-style) ────────────────────────────────── */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.125rem 1.375rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-icon.primary { background: var(--brand-muted);          color: var(--brand); }
.stat-icon.brand   { background: var(--brand-muted);          color: var(--brand); }
.stat-icon.success { background: rgba(22, 163, 74, .1);        color: var(--success); }
.stat-icon.info    { background: rgba(2, 132, 199, .1);        color: var(--info); }
.stat-icon.warning { background: rgba(217, 119, 6, .1);        color: var(--warning); }
.stat-icon.purple  { background: rgba(109, 40, 217, .1);       color: #7c3aed; }
.stat-icon.danger  { background: rgba(220, 38, 38, .1);        color: var(--danger); }
.stat-icon.gold    { background: rgba(181, 134, 13, .1);       color: var(--gold); }

.stat-content { flex: 1; min-width: 0; }
.stat-content h3 {
  font-size: 1.75rem; font-weight: 800;
  color: var(--text-primary); margin: 0; line-height: 1;
  letter-spacing: -.035em;
}
.stat-content p {
  font-size: .67rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); margin: .3rem 0 0;
}

/* ─── Tables ─────────────────────────────────────────────────── */
.table {
  font-size: .8rem;
  margin-bottom: 0;
  --bs-table-bg: transparent;
  --bs-table-striped-bg: transparent;
}
.table th {
  background: var(--bg-subtle) !important;
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border) !important;
  border-top: none !important;
  white-space: nowrap;
}
.table td {
  padding: .7rem 1rem;
  font-size: .8125rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none !important; }
.table-hover tbody tr { transition: background var(--t-fast); }
.table-hover tbody tr:hover td { background: var(--bg-subtle) !important; }

/* Cabeçalho fixo ao rolar listas longas.
   top precisa ser 0: o contexto de rolagem do sticky é o próprio
   .table-responsive (overflow-x cria scroll container), então qualquer
   offset > 0 desloca o thead para baixo cobrindo a primeira linha. */
.table-responsive thead th { position: sticky; top: 0; }

/* Cabeçalho de coluna ordenável */
.th-sort-link {
  display: inline-flex; align-items: center; gap: .3rem;
  color: var(--text-muted); text-decoration: none;
}
.th-sort-link:hover { color: var(--text-primary); }
.th-sort-link.active { color: var(--brand); }
.th-sort-link .sort-icon { font-size: .6rem; opacity: .45; }
.th-sort-link.active .sort-icon { opacity: 1; }

/* Tabelas densas → view em cards em telas muito estreitas.
   Requer `data-label` em cada <td> (injetado automaticamente por main.js
   a partir do texto do <th> correspondente) e a classe .table-cards-sm na <table>. */
@media (max-width: 640px) {
  .table-cards-sm thead { display: none; }
  .table-cards-sm, .table-cards-sm tbody, .table-cards-sm tr, .table-cards-sm td { display: block; width: 100%; }
  .table-cards-sm tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin: .6rem;
    padding: .25rem .85rem;
    background: var(--bg-surface);
  }
  .table-cards-sm td {
    display: flex; justify-content: space-between; align-items: center;
    gap: .75rem; text-align: right;
    padding: .45rem 0 !important;
    border-bottom: 1px solid var(--border) !important;
  }
  .table-cards-sm tr td:last-child { border-bottom: none !important; }
  .table-cards-sm td::before {
    content: attr(data-label);
    font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    font-size: .65rem; color: var(--text-muted);
    text-align: left; flex-shrink: 0;
  }
  .table-cards-sm td[colspan] {
    display: block; text-align: center; padding: 1rem 0 !important;
  }
  .table-cards-sm td[colspan]::before { content: none; }
}

/* Table wrapper (adds border + radius around table) */
.table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.table-wrapper .table { margin: 0; }

[data-bs-theme="dark"] .table { color: var(--text-primary); }
[data-bs-theme="dark"] .table th {
  background: var(--bg-subtle) !important;
  color: var(--text-muted) !important;
  border-bottom-color: var(--border) !important;
}
[data-bs-theme="dark"] .table td { border-bottom-color: var(--border) !important; color: var(--text-primary); }
[data-bs-theme="dark"] .table-hover tbody tr:hover td { background: var(--bg-subtle) !important; }
[data-bs-theme="dark"] .table-light { --bs-table-bg: var(--bg-subtle) !important; }

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
  font-size: .68rem;
  font-weight: 600;
  padding: .25rem .6rem;
  border-radius: var(--radius-full);
  letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: .25rem;
}

/* Ghost/outline style badges */
.badge-ghost-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-ghost-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-ghost-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-border); }
.badge-ghost-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid var(--info-border); }
.badge-ghost-muted   { background: var(--bg-subtle);  color: var(--text-secondary); border: 1px solid var(--border); }

/* Category badges */
.badge-sub12 { background: rgba(22, 101, 52, .1);  color: var(--cat-sub12); border: 1px solid rgba(22, 101, 52, .2); }
.badge-sub15 { background: rgba(30, 58, 138, .1);  color: var(--cat-sub15); border: 1px solid rgba(30, 58, 138, .2); }
.badge-sub18 { background: rgba(154, 52, 18, .1);  color: var(--cat-sub18); border: 1px solid rgba(154, 52, 18, .2); }

[data-bs-theme="dark"] .badge-sub12 { background: rgba(22, 101, 52, .2);  color: #4ade80; }
[data-bs-theme="dark"] .badge-sub15 { background: rgba(30, 58, 138, .25); color: #93c5fd; }
[data-bs-theme="dark"] .badge-sub18 { background: rgba(154, 52, 18, .2);  color: #fb923c; }

/* Bootstrap badge dark-mode overrides */
[data-bs-theme="dark"] .badge.bg-warning {
  background: rgba(217, 119, 6, .2) !important; color: #fbbf24 !important;
  border: 1px solid rgba(217, 119, 6, .35) !important;
}
[data-bs-theme="dark"] .badge.bg-success {
  background: rgba(22, 163, 74, .2) !important; color: #4ade80 !important;
  border: 1px solid rgba(22, 163, 74, .35) !important;
}
[data-bs-theme="dark"] .badge.bg-info {
  background: rgba(2, 132, 199, .2) !important; color: #67e8f9 !important;
  border: 1px solid rgba(2, 132, 199, .35) !important;
}
[data-bs-theme="dark"] .badge.bg-danger {
  background: rgba(220, 38, 38, .2) !important; color: #f87171 !important;
  border: 1px solid rgba(220, 38, 38, .35) !important;
}
[data-bs-theme="dark"] .badge.bg-secondary {
  background: rgba(100, 116, 139, .25) !important; color: #cbd5e1 !important;
  border: 1px solid rgba(100, 116, 139, .4) !important;
}
[data-bs-theme="dark"] .badge.bg-primary {
  background: rgba(0, 71, 163, .35) !important; color: #93c5fd !important;
  border: 1px solid rgba(0, 71, 163, .5) !important;
}

/* ─── Medal helpers ──────────────────────────────────────────── */
.medal-ouro         { color: #b5860d; }
.medal-prata        { color: #64748b; }
.medal-bronze       { color: #92400e; }
.medal-ouro-icon    { color: var(--gold-bright); }
.medal-prata-icon   { color: #cbd5e1; }
.medal-bronze-icon  { color: #cd7f32; }
.text-bronze        { color: #92400e; }
.bg-bronze          { background-color: #92400e; }

[data-bs-theme="dark"] .medal-ouro  { color: var(--gold-bright); }
[data-bs-theme="dark"] .medal-prata { color: #94a3b8; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  font-family: var(--font);
  font-size: .8125rem;
  font-weight: 600;
  padding: .45rem .9rem;
  border-radius: var(--radius);
  letter-spacing: .01em;
  transition: background var(--t-fast), box-shadow var(--t-fast),
              transform var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  display: inline-flex; align-items: center; gap: .35rem;
}
.btn:active { transform: scale(.97); }

.btn-sm { font-size: .75rem;  padding: .35rem .7rem; }
.btn-xs { font-size: .7rem;   padding: .2rem .55rem; border-radius: var(--radius-sm); line-height: 1.5; }
.btn-lg { font-size: .875rem; padding: .6rem 1.35rem; }

/* Primary */
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 1px 3px rgba(15, 118, 110, .25);
}
.btn-primary:hover {
  background: var(--brand-dark); border-color: var(--brand-dark);
  box-shadow: 0 4px 10px rgba(15, 118, 110, .3);
  transform: translateY(-1px);
  color: #fff;
}

/* Jejunos gradient button */
.btn-jejunos {
  background: linear-gradient(135deg, var(--brand) 0%, #0d9488 100%);
  color: #fff; border: none;
  box-shadow: 0 1px 4px rgba(15, 118, 110, .3);
}
.btn-jejunos:hover {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 118, 110, .35);
  transform: translateY(-1px);
}

/* Outline variants */
.btn-outline-primary {
  color: var(--brand); border-color: var(--border-strong); background: transparent;
}
.btn-outline-primary:hover {
  background: var(--brand-subtle); border-color: var(--brand);
  color: var(--brand);
}
[data-bs-theme="dark"] .btn-outline-primary {
  color: #5eead4; border-color: rgba(45, 212, 191, .42);
}
[data-bs-theme="dark"] .btn-outline-primary:hover {
  background: rgba(20, 184, 166, .16); border-color: #2dd4bf; color: #ccfbf1;
}

.btn-outline-secondary {
  color: var(--text-secondary); border-color: var(--border);
  background: var(--bg-surface);
}
.btn-outline-secondary:hover {
  background: var(--bg-subtle); border-color: var(--border-strong);
  color: var(--text-primary);
}
[data-bs-theme="dark"] .btn-outline-secondary {
  color: var(--text-secondary); border-color: var(--border);
  background: transparent;
}
[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background: var(--bg-subtle); color: var(--text-primary);
}

.btn-light {
  background: var(--bg-subtle); border-color: var(--border);
  color: var(--text-primary);
}
.btn-light:hover { background: var(--bg-muted); }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-label {
  font-size: .69rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .065em;
}
.form-control,
.form-select {
  font-family: var(--font);
  font-size: .875rem;
  padding: .5rem .75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.form-control:hover,  .form-select:hover  { border-color: var(--text-muted); }
.form-control:focus,  .form-select:focus  {
  border-color: var(--brand-focus);
  box-shadow: var(--shadow-ring);
  outline: none;
  background: var(--bg-surface);
  color: var(--text-primary);
}
.form-control::placeholder { color: var(--text-disabled); font-size: .82rem; }
.form-text    { font-size: .72rem; color: var(--text-muted); margin-top: .25rem; }
.invalid-feedback { font-size: .72rem; }

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background: var(--bg-subtle) !important;
  border-color: var(--border-strong) !important;
  color: var(--text-primary) !important;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  border-color: var(--brand-focus) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .2);
  background: var(--bg-surface) !important;
}
[data-bs-theme="dark"] .input-group-text {
  background: var(--bg-subtle) !important;
  border-color: var(--border-strong) !important;
  color: var(--text-muted) !important;
}

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-md);
  font-size: .8125rem;
  padding: .75rem 1rem;
  border-width: 1px;
}
.alert-success { background: var(--success-bg); border-color: var(--success-border); color: #15803d; }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); color: #92400e; }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger-border);  color: #b91c1c; }
.alert-info    { background: var(--info-bg);    border-color: var(--info-border);    color: #0369a1; }

[data-bs-theme="dark"] .alert-success { background: var(--success-bg) !important; border-color: var(--success-border) !important; color: #4ade80 !important; }
[data-bs-theme="dark"] .alert-warning { background: var(--warning-bg) !important; border-color: var(--warning-border) !important; color: #fbbf24 !important; }
[data-bs-theme="dark"] .alert-danger  { background: var(--danger-bg)  !important; border-color: var(--danger-border)  !important; color: #f87171 !important; }
[data-bs-theme="dark"] .alert-info    { background: var(--info-bg)    !important; border-color: var(--info-border)    !important; color: #67e8f9 !important; }

/* Alerta de "token revelado uma única vez" (geração/regeneração de token de API) */
.alert-token-reveal {
  border-width: 2px;
  font-size: .875rem;
}
.alert-token-reveal .font-monospace {
  font-size: .8125rem;
  word-break: break-all;
}

/* ─── Page header ────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start;
  gap: .75rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.page-header h3, .page-header h4 { margin: 0; }
.page-title {
  font-size: 1.3rem; font-weight: 800;
  color: var(--text-primary); margin: 0;
  letter-spacing: -.025em;
}
.page-subtitle { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }

/* ─── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 2.25rem;
  color: var(--text-disabled);
  display: block;
  margin-bottom: 1rem;
}
.empty-state-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.5rem;
  color: var(--text-muted);
}
.empty-state h5 { font-size: .9375rem; color: var(--text-primary); margin-bottom: .5rem; }
.empty-state p  { font-size: .8125rem; max-width: 380px; margin-inline: auto; margin-bottom: 1.25rem; }

/* ─── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  font-size: .72rem; margin-bottom: .5rem;
  background: transparent; padding: 0;
}
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item a:hover { color: var(--text-primary); }
.breadcrumb-item.active { color: var(--text-secondary); font-weight: 600; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-disabled); }

/* ─── Pagination ─────────────────────────────────────────────── */
.page-link {
  border-radius: var(--radius-sm);
  font-size: .8rem; padding: .4rem .75rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.page-link:hover { background: var(--bg-subtle); border-color: var(--border-strong); color: var(--text-primary); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-item.disabled .page-link { background: var(--bg-subtle); color: var(--text-disabled); border-color: var(--border); }

[data-bs-theme="dark"] .page-link { background: var(--bg-subtle); border-color: var(--border); color: var(--text-secondary); }
[data-bs-theme="dark"] .page-link:hover { background: var(--bg-muted); color: var(--text-primary); }

/* ─── Dropdown ───────────────────────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 5px;
  background: var(--bg-surface);
  animation: fadeSlideIn var(--t) var(--ease);
}
[data-bs-theme="dark"] .dropdown-menu { background: var(--bg-surface) !important; border-color: var(--border) !important; }
.dropdown-item {
  font-size: .8125rem; font-weight: 500;
  padding: .4rem .65rem; border-radius: var(--radius-xs);
  color: var(--text-primary);
  transition: background var(--t-fast);
}
.dropdown-item:hover { background: var(--bg-subtle); color: var(--text-primary); }
[data-bs-theme="dark"] .dropdown-item { color: var(--text-primary) !important; }
[data-bs-theme="dark"] .dropdown-item:hover { background: var(--bg-subtle) !important; color: var(--text-primary) !important; }
.dropdown-header {
  font-size: .67rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); padding: .5rem .65rem .2rem;
}
.dropdown-divider { border-color: var(--border); margin: 4px 0; }
[data-bs-theme="dark"] .dropdown-header { color: var(--text-muted) !important; }
[data-bs-theme="dark"] .dropdown-divider { border-color: var(--border) !important; }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-content {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background: var(--bg-surface);
}
.modal-header {
  padding: 1.125rem 1.375rem .75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.modal-footer {
  padding: .75rem 1.375rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.modal-title { font-size: 1rem; font-weight: 700; }
[data-bs-theme="dark"] .modal-content { background: var(--bg-surface); border-color: var(--border); }
[data-bs-theme="dark"] .modal-header  { background: var(--bg-surface); border-color: var(--border); }
[data-bs-theme="dark"] .modal-footer  { background: var(--bg-subtle);  border-color: var(--border); }

/* ─── List group ─────────────────────────────────────────────── */
.list-group-item {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-primary);
  font-size: .8125rem;
}
.list-group-item-action:hover { background: var(--bg-subtle); color: var(--text-primary); }
[data-bs-theme="dark"] .list-group-item { background: var(--bg-surface) !important; border-color: var(--border) !important; color: var(--text-primary) !important; }
[data-bs-theme="dark"] .list-group-item-action:hover { background: var(--bg-subtle) !important; color: var(--text-primary) !important; }

/* ─── Login page ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #134e4a 0%, #0f766e 62%, #0f172a 100%);
  padding: 1.5rem;
}
.login-container { width: 100%; max-width: 400px; }
.login-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.login-header {
  background: var(--bg-subtle);
  padding: 1.875rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.login-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.login-logo i    { font-size: 2rem;   color: var(--gold-bright); filter: drop-shadow(0 2px 8px rgba(251, 191, 36, .4)); }
.login-logo span { font-size: 1.375rem; font-weight: 800; color: var(--brand); letter-spacing: -.03em; }
.login-header p  { font-size: .78rem; color: var(--text-muted); margin: 0; }
.login-body   { padding: 1.75rem; }
.login-footer {
  padding: 1rem 1.75rem;
  background: var(--bg-subtle);
  text-align: center;
  font-size: .72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.login-hint { text-align: center; font-size: .72rem; color: rgba(255, 255, 255, .55); margin-top: 1rem; }
.login-hint a { color: rgba(255, 255, 255, .8); }

[data-bs-theme="dark"] .login-page    { background: linear-gradient(135deg, #0d1a30 0%, #050c18 100%); }
[data-bs-theme="dark"] .login-card    { background: var(--bg-surface); border: 1px solid var(--border); }
[data-bs-theme="dark"] .login-header  { background: var(--bg-subtle); border-color: var(--border); }
[data-bs-theme="dark"] .login-logo span { color: #93c5fd; }
[data-bs-theme="dark"] .login-footer  { background: var(--bg-subtle); border-color: var(--border); }

/* ─── Timeline ───────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 9px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute; left: -22px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 3px var(--border);
}
.timeline-content { background: var(--bg-subtle); border-radius: var(--radius); padding: .875rem 1rem; }
.timeline-date    { font-size: .68rem; color: var(--text-muted); margin-bottom: 3px; font-weight: 500; }
.timeline-title   { font-weight: 600; margin-bottom: 4px; font-size: .82rem; color: var(--text-primary); }
.timeline-text    { font-size: .78rem; color: var(--text-secondary); margin: 0; }

/* ─── Spinner ────────────────────────────────────────────────── */
.spinner-inline {
  display: inline-block; width: 1rem; height: 1rem;
  border: 2px solid rgba(0, 0, 0, .1);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Skeleton loading ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-muted) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
}
@keyframes shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Divider ────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1rem 0; }

/* ─── Utility overrides ──────────────────────────────────────── */
[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-secondary { color: var(--text-muted) !important; }
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2, [data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4, [data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6 {
  color: var(--text-primary) !important;
}
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light  { background-color: var(--bg-surface) !important; }
[data-bs-theme="dark"] .text-dark { color: var(--text-primary) !important; }
[data-bs-theme="dark"] .border    { border-color: var(--border) !important; }
[data-bs-theme="dark"] .border-bottom { border-color: var(--border) !important; }

/* ─── Footer ─────────────────────────────────────────────────── */
footer.bg-dark {
  background: #08101e !important;
  border-top: 1px solid rgba(255, 255, 255, .06);
}
[data-bs-theme="dark"] footer.bg-dark {
  background: #040810 !important;
  border-top-color: rgba(255, 255, 255, .05);
}

/* ─── Print ──────────────────────────────────────────────────── */
@media print {
  nav, footer, .btn, .alert, .no-print { display: none !important; }
  .card { border: 1px solid #ccc !important; box-shadow: none !important; }
  body  { font-size: 12px; background: #fff !important; color: #000 !important; }
}

/* ─── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 576px) {
  .stat-card       { padding: .875rem 1rem; }
  .stat-icon       { width: 40px; height: 40px; font-size: 1rem; }
  .stat-content h3 { font-size: 1.4rem; }
  .page-title      { font-size: 1.1rem; }
  .table th, .table td { padding: .5rem .75rem; }
  .btn             { font-size: .75rem; }
}

/* ═══════════════════════════════════════════════════════════════
   Visual refresh — 2026
   Camada de polimento: superfícies mais leves, menos "admin antigo",
   tipografia mais calma e estados interativos mais nítidos.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --brand:          #0f766e;
  --brand-dark:     #134e4a;
  --brand-hover:    #0d9488;
  --brand-focus:    #2563eb;
  --brand-subtle:   #ecfdf5;
  --brand-muted:    rgba(15, 118, 110, .10);
  --primary:        var(--brand);
  --primary-dark:   var(--brand-dark);
  --primary-light:  var(--brand-hover);
  --primary-muted:  var(--brand-muted);

  --gold:           #d97706;
  --gold-bright:    #f59e0b;
  --bg-base:        #f5f8f7;
  --bg-surface:     #ffffff;
  --bg-subtle:      #f1f7f5;
  --bg-muted:       #e4eeeb;
  --border:         #d7e5e1;
  --border-strong:  #bdd1cc;
  --text-primary:   #111827;
  --text-secondary: #4b5563;
  --text-muted:     #7a8797;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 8px 22px rgba(15, 23, 42, .06);
  --shadow:    0 12px 30px rgba(15, 23, 42, .08);
  --shadow-md: 0 18px 42px rgba(15, 23, 42, .10);
  --shadow-lg: 0 28px 70px rgba(15, 23, 42, .14);
}

[data-bs-theme="dark"] {
  --brand:          #2dd4bf;
  --brand-dark:     #0f766e;
  --brand-hover:    #5eead4;
  --brand-focus:    #60a5fa;
  --brand-subtle:   rgba(20, 184, 166, .15);
  --brand-muted:    rgba(20, 184, 166, .18);
  --bg-base:        #091211;
  --bg-surface:     #101a1b;
  --bg-subtle:      #162322;
  --bg-muted:       #223332;
  --border:         #263f3d;
  --border-strong:  #365a56;
  --text-primary:   #f5f7fb;
  --text-secondary: #c0cad8;
  --text-muted:     #8d9aab;
}

body {
  background:
    radial-gradient(circle at 12% -10%, rgba(37, 99, 235, .08), transparent 34rem),
    radial-gradient(circle at 86% 0%, rgba(246, 196, 83, .10), transparent 26rem),
    var(--bg-base);
}

[data-bs-theme="dark"] body {
  background:
    radial-gradient(circle at 12% -10%, rgba(20, 184, 166, .10), transparent 34rem),
    radial-gradient(circle at 86% 0%, rgba(245, 158, 11, .07), transparent 26rem),
    var(--bg-base) !important;
}

h1, h2, h3 {
  letter-spacing: 0;
}

.navbar.bg-jejunos,
.bg-jejunos {
  background: #0759a8;
  box-shadow: 0 12px 32px rgba(7, 89, 168, .18);
}

[data-bs-theme="dark"] .navbar.bg-jejunos,
[data-bs-theme="dark"] .bg-jejunos {
  background: #083b74 !important;
}

.navbar .nav-link {
  border-radius: 999px;
  padding: .45rem .75rem;
}

.navbar .nav-link.active {
  background: rgba(255, 255, 255, .20);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10);
}

.card {
  border-color: rgba(203, 213, 225, .8) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xs);
}

.card:hover {
  box-shadow: var(--shadow-sm);
}

.card-header {
  background: linear-gradient(180deg, rgba(248, 250, 252, .92), rgba(255,255,255,.92)) !important;
  padding: 1rem 1.25rem;
}

[data-bs-theme="dark"] .card-header {
  background: linear-gradient(180deg, rgba(23, 32, 51, .92), rgba(17,24,39,.92)) !important;
}

/* Cabeçalho de card com gradiente de marca fixo (ex.: sorteio por
   modalidade, boas-vindas de amigo da escola). Precisa de `!important` e
   de uma especificidade maior que `.card-header` acima: sem isso, o fundo
   quase-branco do tema claro sobrescrevia o gradiente azul e o texto
   branco ficava ilegível (branco sobre quase-branco). */
.card-header.card-header-solid-brand,
[data-bs-theme="dark"] .card-header.card-header-solid-brand {
  background: linear-gradient(90deg, #0a3362, #1565c0) !important;
  color: #fff !important;
}
/* `.card-header h1..h6 { color: var(--text-primary) }` (acima) teria
   prioridade sobre a cor herdada do card-header-solid-brand por mirar o
   elemento diretamente — no tema claro isso deixava título tipo <h5> em
   texto quase preto sobre o gradiente azul escuro. */
.card-header.card-header-solid-brand h1,
.card-header.card-header-solid-brand h2,
.card-header.card-header-solid-brand h3,
.card-header.card-header-solid-brand h4,
.card-header.card-header-solid-brand h5,
.card-header.card-header-solid-brand h6 {
  color: #fff !important;
}

/* Achado de code review (mesma causa do `.card-header-solid-brand` acima):
   `templates/gestao/sorteio.html` usa as classes utilitárias do Bootstrap
   `bg-success`/`bg-warning` direto num `.card-header` — como `.card-header`
   (acima) e essas utilitárias têm a MESMA especificidade (uma classe) e as
   duas usam `!important`, quem carrega por último no <head> vence, e
   `style.css` carrega DEPOIS do Bootstrap. Resultado: o fundo verde/amarelo
   nunca aparecia, sobrando o `text-white` sobre o gradiente quase-branco do
   tema claro — "Sul"/"Central" etc. ficavam brancos sobre fundo branco.
   `.card-header.bg-success` tem 2 classes (mais específico que `.card-header`
   sozinho), então ganha independente da ordem no arquivo.

   Usa o shorthand `background` (não só `background-color`): `.card-header`
   acima define `background-image` via esse mesmo shorthand, e um
   `background-color` isolado não reseta esse `background-image` — o
   gradiente quase-branco (92% opaco) continuava por cima do verde,
   deixando o fundo esverdeado-pálido em vez do verde sólido do Bootstrap. */
.card-header.bg-success {
  background: var(--bs-success) !important;
}
.card-header.bg-warning {
  background: rgba(var(--bs-warning-rgb), var(--bs-bg-opacity, 1)) !important;
}

.stat-card,
.g-stat-mini {
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.98)),
    var(--bg-surface);
}

.stat-icon,
.g-stat-mini .ico {
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .38);
}

.table-wrapper,
.table-responsive {
  border-radius: var(--radius-lg);
}

.table th {
  background: #f7f9fc !important;
  color: #667085;
  letter-spacing: .04em;
}

.table td {
  padding-top: .78rem;
  padding-bottom: .78rem;
}

.btn {
  border-radius: 999px;
  box-shadow: none;
}

.btn-primary,
.btn-jejunos {
  background: linear-gradient(135deg, #0f766e, #2563eb);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(15, 118, 110, .22);
}

.btn-primary:hover,
.btn-jejunos:hover {
  background: linear-gradient(135deg, #134e4a, #0f766e);
  box-shadow: 0 14px 30px rgba(15, 118, 110, .28);
}

.form-control,
.form-select,
.input-group-text {
  border-radius: 12px;
  border-color: var(--border);
}

.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child),
.input-group > .input-group-text:not(:first-child),
.input-group > .btn:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child),
.input-group > .input-group-text:not(:last-child),
.input-group > .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.alert {
  border-radius: var(--radius-lg);
  border-width: 1px;
}

.badge {
  letter-spacing: 0;
}

/* ─── Public pages ──────────────────────────────────────────── */

/* Hero banner */
.public-hero {
  background: linear-gradient(135deg, #134e4a 0%, var(--brand) 52%, #2563eb 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 2.5rem 1.5rem;
  color: #fff;
  position: relative;
  text-align: center;
}
@media (min-width: 768px) { .public-hero { padding: 3.5rem 3rem; } }
.public-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 75% 40%, rgba(255,255,255,.06) 0%, transparent 65%);
  pointer-events: none;
}
.public-hero-stat {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-md);
  padding: .875rem .75rem; text-align: center;
  backdrop-filter: blur(4px);
  transition: background var(--t-fast);
}
.public-hero-stat:hover { background: rgba(255,255,255,.2); }
.public-hero-stat .num {
  font-size: 1.6rem; font-weight: 800;
  color: var(--gold-bright); line-height: 1; letter-spacing: -.03em;
}
.public-hero-stat .lbl { font-size: .68rem; color: rgba(255,255,255,.72); margin-top: .25rem; font-weight: 500; }

/* Quick nav cards */
.pub-nav-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; padding: 1.375rem 1rem; text-align: center;
  text-decoration: none; height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease), border-color var(--t) var(--ease);
}
.pub-nav-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md);
  border-color: var(--border-strong); color: var(--text-primary);
}
.pub-nav-card i     { font-size: 1.75rem; }
.pub-nav-card span  { font-size: .8125rem; font-weight: 700; }
.pub-nav-card small { font-size: .72rem; color: var(--text-muted); }
[data-bs-theme="dark"] .pub-nav-card { background: var(--bg-surface); border-color: var(--border); color: var(--text-primary); }
[data-bs-theme="dark"] .pub-nav-card:hover { border-color: var(--border-strong); color: var(--text-primary); }

/* Section header */
.pub-section-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem;
  padding-bottom: .75rem; border-bottom: 1px solid var(--border);
}
.pub-section-header h4,
.pub-section-header h5 { margin: 0; color: var(--text-primary); font-weight: 700; }

/* Informe cards */
.informe-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 5px solid;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.125rem; margin-bottom: .875rem;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.informe-card:hover { transform: translateX(3px); box-shadow: var(--shadow-md); }
.informe-card.tipo-NOTICIA   { border-left-color: var(--brand);   }
.informe-card.tipo-INFORME   { border-left-color: #0d9488;        }
.informe-card.tipo-AVISO     { border-left-color: var(--warning); }
.informe-card.tipo-RESULTADO { border-left-color: var(--gold);    }
[data-bs-theme="dark"] .informe-card { background: var(--bg-surface); border-color: var(--border); }
[data-bs-theme="dark"] .informe-card.tipo-NOTICIA   { border-left-color: #60a5fa; }
[data-bs-theme="dark"] .informe-card.tipo-INFORME   { border-left-color: #2dd4bf; }
[data-bs-theme="dark"] .informe-card.tipo-AVISO     { border-left-color: #fbbf24; }
[data-bs-theme="dark"] .informe-card.tipo-RESULTADO { border-left-color: var(--gold-bright); }

/* Type badges */
.tipo-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .67rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .18rem .6rem; border-radius: var(--radius-full);
  border: 1px solid transparent;
}
.tipo-badge.NOTICIA   { background: var(--brand-subtle); color: var(--brand);  border-color: rgba(15,118,110,.2); }
.tipo-badge.INFORME   { background: #f0fdfa; color: #0f766e; border-color: rgba(13,148,136,.2); }
.tipo-badge.AVISO     { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.tipo-badge.RESULTADO { background: var(--gold-bg); color: var(--gold); border-color: rgba(181,134,13,.2); }
[data-bs-theme="dark"] .tipo-badge.NOTICIA   { background: rgba(20,184,166,.15);  color: #5eead4; border-color: rgba(94,234,212,.22); }
[data-bs-theme="dark"] .tipo-badge.INFORME   { background: rgba(13,148,136,.15); color: #2dd4bf; border-color: rgba(45,212,191,.2); }
[data-bs-theme="dark"] .tipo-badge.AVISO     { background: rgba(217,119,6,.15);  color: #fbbf24; border-color: rgba(251,191,36,.2); }
[data-bs-theme="dark"] .tipo-badge.RESULTADO { background: rgba(181,134,13,.15); color: var(--gold-bright); border-color: rgba(251,191,36,.2); }

/* Informe body text */
.informe-texto { font-size: .9rem; line-height: 1.7; color: var(--text-secondary); white-space: pre-line; }
[data-bs-theme="dark"] .informe-texto { color: var(--text-secondary); }

/* Pin badge */
.pin-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .67rem; font-weight: 600;
  color: #7c3aed; background: rgba(109,40,217,.08);
  border: 1px solid rgba(109,40,217,.2);
  padding: .15rem .5rem; border-radius: var(--radius-full);
}
[data-bs-theme="dark"] .pin-badge { color: #c4b5fd; background: rgba(139,92,246,.15); border-color: rgba(196,181,253,.2); }

/* Filter pills */
.filtros-wrap { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.filtro-btn {
  font-size: .78rem; font-weight: 600;
  border-radius: var(--radius-full);
  padding: .3rem .875rem;
  border: 1.5px solid var(--border);
  cursor: pointer; transition: all var(--t-fast);
  text-decoration: none;
  color: var(--text-secondary); background: var(--bg-surface);
}
.filtro-btn:hover { background: var(--bg-subtle); border-color: var(--border-strong); color: var(--text-primary); }
.filtro-btn.todos.active    { background: var(--bg-subtle); border-color: var(--border-strong); color: var(--text-primary); }
.filtro-btn.NOTICIA.active  { background: var(--brand-subtle);  border-color: var(--brand); color: var(--brand); }
.filtro-btn.AVISO.active    { background: var(--warning-bg);    border-color: var(--warning);     color: var(--warning); }
.filtro-btn.RESULTADO.active{ background: var(--gold-bg);       border-color: var(--gold);        color: var(--gold); }
.filtro-btn.INFORME.active  { background: #f0fdfa;              border-color: #0f766e;            color: #0f766e; }
[data-bs-theme="dark"] .filtro-btn { background: var(--bg-surface); border-color: var(--border); color: var(--text-muted); }
[data-bs-theme="dark"] .filtro-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }
[data-bs-theme="dark"] .filtro-btn.todos.active    { background: var(--bg-subtle); color: var(--text-primary); }
[data-bs-theme="dark"] .filtro-btn.NOTICIA.active  { background: rgba(20,184,166,.15);  border-color: #2dd4bf;          color: #5eead4; }
[data-bs-theme="dark"] .filtro-btn.AVISO.active    { background: rgba(217,119,6,.15);  border-color: #fbbf24;          color: #fbbf24; }
[data-bs-theme="dark"] .filtro-btn.RESULTADO.active{ background: rgba(181,134,13,.15); border-color: var(--gold-bright); color: var(--gold-bright); }
[data-bs-theme="dark"] .filtro-btn.INFORME.active  { background: rgba(13,148,136,.15); border-color: #2dd4bf;          color: #2dd4bf; }

/* Info pill (stats inside page banners) */
.info-pill {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-md);
  padding: .875rem 1rem; text-align: center;
  backdrop-filter: blur(4px);
}
.info-pill .num {
  font-size: 1.75rem; font-weight: 800;
  line-height: 1; color: var(--gold-bright); letter-spacing: -.03em;
}
.info-pill .lbl { font-size: .72rem; color: rgba(255,255,255,.72); margin-top: .25rem; }

/* Sidebar widget */
.sidebar-widget { margin-bottom: 1.5rem; }
.sidebar-widget-title {
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted);
  margin-bottom: .875rem; display: flex; align-items: center; gap: .5rem;
}
.sidebar-widget-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Mini medals table */
.mini-quadro { border-radius: var(--radius-md); overflow: hidden; }
.mini-quadro thead th {
  background: var(--brand); color: var(--gold-bright);
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  padding: 8px 10px; white-space: nowrap; border: none;
}
.mini-quadro tbody tr:first-child { font-weight: 700; }
.mini-quadro tbody td  { font-size: .85rem; padding: 7px 10px; vertical-align: middle; }
[data-bs-theme="dark"] .mini-quadro thead th { background: var(--brand-dark); color: var(--gold-bright); }
[data-bs-theme="dark"] .mini-quadro tbody td { color: var(--text-primary); background: var(--bg-surface); }
[data-bs-theme="dark"] .mini-quadro tbody tr:hover td { background: var(--bg-subtle); }

/* Sidebar quick-access card header */
.card-header-brand {
  background: var(--brand); color: var(--gold-bright);
  font-size: .85rem; font-weight: 700; padding: .625rem .875rem;
}
[data-bs-theme="dark"] .card-header-brand { background: var(--brand-dark); }

/* Accordion — dark mode */
.accordion-button { font-size: .875rem; font-weight: 600; color: var(--text-primary); background: var(--bg-surface); }
.accordion-button:not(.collapsed) { color: var(--brand); background: var(--brand-subtle); box-shadow: none; }
.accordion-body  { background: var(--bg-surface); color: var(--text-secondary); }
.accordion-item  { background: var(--bg-surface); border-color: var(--border); }
[data-bs-theme="dark"] .accordion-button          { color: var(--text-primary) !important; background: var(--bg-surface) !important; }
[data-bs-theme="dark"] .accordion-button:not(.collapsed) { background: rgba(147,197,253,.08) !important; color: #93c5fd !important; box-shadow: none !important; }
[data-bs-theme="dark"] .accordion-button::after   { filter: invert(1); }
[data-bs-theme="dark"] .accordion-item            { background: var(--bg-surface) !important; border-color: var(--border) !important; }
[data-bs-theme="dark"] .accordion-body            { background: var(--bg-surface) !important; color: var(--text-secondary) !important; }

/* Table thead — brand variant (replaces table-dark in public tables).
   !important necessário: `.table th` genérico usa !important no background
   e, sem isso, o header ficava texto branco sobre fundo claro (ilegível). */
.thead-brand th {
  background: var(--brand) !important; color: #fff !important;
  font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap; border: none;
}
[data-bs-theme="dark"] .thead-brand th { background: var(--brand-dark) !important; color: #fff !important; }

/* ═══════════════════════════════════════════════════════════════
   UTILITY LAYER v2 — elimina inline styles dos templates
   ═══════════════════════════════════════════════════════════════ */

/* ─── Card stripe (border-left colorida) ────────────────────────── */
.card-stripe         { border-left: 3px solid var(--border) !important; }
.card-stripe-thick   { border-left-width: 4px !important; }
.card-stripe-primary { border-left-color: var(--brand) !important; }
.card-stripe-success { border-left-color: var(--success) !important; }
.card-stripe-warning { border-left-color: var(--warning) !important; }
.card-stripe-danger  { border-left-color: var(--danger) !important; }
.card-stripe-info    { border-left-color: var(--info) !important; }
.card-stripe-gold    { border-left-color: var(--gold) !important; }

/* ─── Text size scale ────────────────────────────────────────────── */
.text-2xs  { font-size: .67rem !important; }
.text-xs   { font-size: .75rem !important; }
.text-sm   { font-size: .875rem !important; }
.text-base { font-size: 1rem !important; }

/* ─── Icon color helpers ─────────────────────────────────────────── */
.icon-brand   { color: var(--brand)   !important; }
.icon-success { color: var(--success) !important; }
.icon-warning { color: var(--warning) !important; }
.icon-danger  { color: var(--danger)  !important; }
.icon-info    { color: var(--info)    !important; }
.icon-gold    { color: var(--gold)    !important; }
.icon-muted   { color: var(--text-muted) !important; }
.icon-purple  { color: #7c3aed !important; }
[data-bs-theme="dark"] .icon-brand   { color: #60a5fa !important; }
[data-bs-theme="dark"] .icon-success { color: #4ade80 !important; }
[data-bs-theme="dark"] .icon-warning { color: #fbbf24 !important; }
[data-bs-theme="dark"] .icon-danger  { color: #f87171 !important; }
[data-bs-theme="dark"] .icon-info    { color: #67e8f9 !important; }
[data-bs-theme="dark"] .icon-gold    { color: var(--gold-bright) !important; }

/* ─── Link com cor brand ─────────────────────────────────────────── */
.link-brand {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--t-fast);
}
.link-brand:hover { color: var(--brand-hover); }
[data-bs-theme="dark"] .link-brand { color: #60a5fa; }
[data-bs-theme="dark"] .link-brand:hover { color: #93c5fd; }

/* ─── Status badges (ativo/inativo) ──────────────────────────────── */
.badge-active {
  background: rgba(21, 128, 61, .12);
  color: #15803d;
  border: 1px solid rgba(21, 128, 61, .2);
}
.badge-inactive {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
[data-bs-theme="dark"] .badge-active {
  background: rgba(22, 163, 74, .18) !important;
  color: #4ade80 !important;
  border-color: rgba(22, 163, 74, .3) !important;
}
[data-bs-theme="dark"] .badge-inactive {
  background: rgba(100, 116, 139, .15) !important;
  color: #94a3b8 !important;
  border-color: rgba(100, 116, 139, .25) !important;
}
.badge-danger-soft {
  background: rgba(220, 38, 38, .12);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, .2);
}
[data-bs-theme="dark"] .badge-danger-soft {
  background: rgba(220, 38, 38, .18) !important;
  color: #f87171 !important;
}

/* ─── Stat icon size overrides ───────────────────────────────────── */
.stat-icon-sm { width: 38px !important; height: 38px !important; font-size: .9rem !important; }
.stat-icon-md { width: 40px !important; height: 40px !important; font-size: 1rem !important; }

/* ─── Section label (título de card header) ──────────────────────── */
.section-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ─── Card overline (fase, tipo — texto uppercase pequeno) ────────── */
.card-overline {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .055em;
  color: var(--text-muted);
}

/* ─── Progress bar slim ──────────────────────────────────────────── */
.progress-xs  { height: 4px; border-radius: var(--radius-full); overflow: hidden; }
.progress-sm  { height: 6px; border-radius: var(--radius-full); overflow: hidden; }
.progress, .progress-xs, .progress-sm { background: var(--bg-muted); }
[data-bs-theme="dark"] .progress,
[data-bs-theme="dark"] .progress-xs,
[data-bs-theme="dark"] .progress-sm { background: rgba(255,255,255,.1); }

/* ─── Event progress widget ──────────────────────────────────────── */
.event-progress-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .78rem;
}
.event-progress-item .ep-label {
  min-width: 130px;
  color: var(--text-secondary);
  font-weight: 500;
}
.event-progress-item .ep-bar { flex: 1; }
.event-progress-item .ep-count {
  min-width: 60px;
  text-align: right;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 600;
}

/* ─── Alert action card (inline com ícone + texto + link) ─────────── */
.alert-action {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  padding: .875rem 1rem;
}
.alert-action .aa-icon {
  flex-shrink: 0;
  margin-top: 1px;
}
.alert-action .aa-title {
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: .2rem;
  color: var(--text-primary);
  line-height: 1.3;
}
.alert-action .aa-desc {
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .625rem;
}

/* ─── Count-up animation target ──────────────────────────────────── */
.count-up { display: inline-block; }

/* ─── Topbar search trigger ──────────────────────────────────────── */
.g-search-trigger {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .78rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
  user-select: none;
}
.g-search-trigger:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
  background: var(--bg-surface);
}
.g-search-trigger .kbd {
  font-size: .65rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: .1rem .3rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
[data-bs-theme="dark"] .g-search-trigger {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
  color: rgba(255,255,255,.35);
}
[data-bs-theme="dark"] .g-search-trigger:hover {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.6);
}

/* ─── Tooltip hover card (table actions) ─────────────────────────── */
[data-bs-toggle="tooltip"] { cursor: pointer; }

/* ─── Table column width helpers ─────────────────────────────────── */
.col-actions { width: 100px; }
.col-status  { width: 90px; }
.col-badge   { width: 80px; }

/* ─── Fase action items (dashboard CCO checklist) ───────────────── */
.fase-action-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-surface);
  transition: background .15s, border-color .15s, transform .1s;
}
.fase-action-item:hover {
  background: var(--brand-subtle);
  border-color: var(--brand);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.fase-action-item.done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
[data-bs-theme="dark"] .fase-action-item          { background: #151f35; border-color: #253550; }
[data-bs-theme="dark"] .fase-action-item:hover     { background: #1a2a45; border-color: #3b6abd; }
[data-bs-theme="dark"] .fase-action-item.done      { background: #052e16; border-color: #166534; }

/* ─── Table row variants ─────────────────────────────────────────── */
.table-warning-soft { background: rgba(251,191,36,.08) !important; }
[data-bs-theme="dark"] .table-warning-soft { background: rgba(251,191,36,.07) !important; }
.table-danger-soft  { background: rgba(220,38,38,.07)  !important; }
[data-bs-theme="dark"] .table-danger-soft  { background: rgba(220,38,38,.10)  !important; }
.table-pos-1        { background: rgba(251,191,36,.13) !important; }
[data-bs-theme="dark"] .table-pos-1        { background: rgba(251,191,36,.11) !important; }
.table-pos-2        { background: rgba(59,130,246,.09) !important; }
[data-bs-theme="dark"] .table-pos-2        { background: rgba(96,165,250,.09) !important; }

/* ─── Card header variants ───────────────────────────────────────── */
/* !important necessário: `.card-header` genérico (linhas ~321 e ~1058) usa
   !important no background, e sem isso o texto branco deste variant ficava
   sobre um fundo quase branco, ilegível — mesmo problema já corrigido em
   `.thead-brand th`, faltava aplicar aqui também. */
.card-header-brand {
  background: linear-gradient(90deg, #134e4a, var(--primary, #0f766e)) !important;
  color: #fff !important;
}

/* Chip de região sobre o .card-header-brand — não usar `.bg-white`, que o
   modo claro deixa quase invisível: fundo translúcido próprio, sem depender
   do tema. */
.badge-header-regiao {
  background: rgba(255,255,255,.18) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.35);
}

/* ─── Soft badge variants ────────────────────────────────────────── */
.badge-blue-soft    { background: rgba(20,184,166,.12);  color: #0f766e; border: 1px solid rgba(20,184,166,.18); }
.badge-purple       { background: rgba(109,28,209,.12); color: #6d28d9; border: 1px solid rgba(109,28,209,.15); }
.badge-warning-soft { background: rgba(202,138,4,.12);  color: #92400e; border: 1px solid rgba(202,138,4,.20); }
[data-bs-theme="dark"] .badge-blue-soft {
  background: rgba(45,212,191,.18) !important; color: #5eead4 !important; border-color: rgba(45,212,191,.3) !important;
}
[data-bs-theme="dark"] .badge-purple {
  background: rgba(167,139,250,.18) !important; color: #c4b5fd !important; border-color: rgba(167,139,250,.3) !important;
}
[data-bs-theme="dark"] .badge-warning-soft {
  background: rgba(234,179,8,.18) !important; color: #fde047 !important; border-color: rgba(234,179,8,.3) !important;
}

/* ─── User avatar chip ───────────────────────────────────────────── */
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-muted);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 1rem; flex-shrink: 0;
}

/* ─── Fase banner ────────────────────────────────────────────────── */
.fase-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-md);
  padding: 1.125rem 1.375rem;
  margin-bottom: 1.25rem;
}
.fase-banner-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: .25rem 0 .125rem;
}
.fase-banner-meta {
  font-size: .78rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-top: .375rem;
}
[data-bs-theme="dark"] .fase-banner { background: #151f35; border-color: #253550; border-left-color: #60a5fa; }

/* ─── Fase strip (barra global de fase) ─────────────────────────── */
.fase-strip {
  font-size: .78rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.fase-strip-INSCRICOES, .fase-strip-inscricoes { background: #1e3a8a; color: rgba(255,255,255,.92); }
.fase-strip-SORTEIO,    .fase-strip-sorteio    { background: #4c1d95; color: rgba(255,255,255,.92); }
.fase-strip-CONGRESSO,  .fase-strip-congresso  { background: #164e63; color: rgba(255,255,255,.92); }
.fase-strip-COMPETICAO, .fase-strip-competicao { background: #14532d; color: rgba(255,255,255,.92); }
.fase-strip-RESULTADOS, .fase-strip-resultados { background: #7c2d12; color: rgba(255,255,255,.92); }
.fase-strip-ENCERRADO,  .fase-strip-encerrado  { background: #1e293b; color: rgba(255,255,255,.7);  }
.fase-strip-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255,255,255,.15);
  padding: .2em .6em;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.fase-strip-detail { opacity: .8; font-size: .75rem; }
.fase-strip-link {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .72rem;
  white-space: nowrap;
  opacity: .85;
  transition: opacity .15s;
}
.fase-strip-link:hover { opacity: 1; color: #fff; }

/* ─── Cronograma público ────────────────────────────────────────── */
.cronograma-step {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.cronograma-step:last-child { border-bottom: none; }
.cronograma-step-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.cronograma-step-icon.done   { background: #dcfce7; color: #15803d; }
.cronograma-step-icon.active { background: #ccfbf1; color: #0f766e; }
.cronograma-step-icon.future { background: var(--bg-subtle); color: var(--text-muted); }
.cronograma-step-body { flex: 1; }
.cronograma-step-title {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .2rem;
}
.cronograma-step-date { font-size: .78rem; color: var(--text-muted); }
.cronograma-step-desc { font-size: .83rem; color: var(--text-secondary); margin-top: .35rem; }

/* ─── Diagrama de Chaveamento (bracket) ─────────────────────── */
:root {
  /* Paleta dos avatares de escola — família teal/azul do design system,
     só para diferenciar escolas visualmente (não é a cor de destaque). */
  --bracket-hue-0: #0f766e;
  --bracket-hue-1: #0891b2;
  --bracket-hue-2: #14b8a6;
  --bracket-hue-3: #0d9488;
  --bracket-hue-4: #134e4a;
  --bracket-hue-5: #0284c7;
  --bracket-hue-6: #155e75;
  --bracket-hue-7: #2563eb;
}
[data-bs-theme="dark"] {
  --bracket-hue-0: #60a5fa;
  --bracket-hue-1: #22d3ee;
  --bracket-hue-2: #818cf8;
  --bracket-hue-3: #2dd4bf;
  --bracket-hue-4: #93c5fd;
  --bracket-hue-5: #38bdf8;
  --bracket-hue-6: #67e8f9;
  --bracket-hue-7: #7dd3fc;
}

/* Centraliza chaves pequenas (final, semi) em vez de grudar à esquerda;
   chaves grandes (oitavas+) continuam roláveis horizontalmente. */
.bracket-scroll { display: flex; justify-content: center; overflow-x: auto; padding-bottom: .5rem; }
.bracket {
  display: flex;
  gap: 44px;
  min-width: max-content;
  padding: 1rem .75rem;
  margin: 0 auto;
}
.bracket-round { display: flex; flex-direction: column; width: 214px; }
.bracket-round-title {
  text-align: center;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted);
  margin-bottom: .9rem;
}
.bracket-round-body {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: space-around;
  gap: 26px;
}
.bracket-pair {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: space-around;
  gap: 18px;
  position: relative;
}
/* Conectores: traço horizontal saindo do par de times… */
.bracket-pair-conn .bracket-teams::after {
  content: ''; position: absolute;
  left: 100%; top: 50%;
  width: 22px; height: 2px;
  background: var(--border-strong);
}
/* …trilho vertical unindo o par… */
.bracket-pair-conn::before {
  content: ''; position: absolute;
  right: -22px; top: 25%;
  height: 50%; width: 2px;
  background: var(--border-strong);
}
/* …e traço até a partida da fase seguinte. */
.bracket-pair-conn::after {
  content: ''; position: absolute;
  right: -44px; top: 50%;
  width: 22px; height: 2px;
  background: var(--border-strong);
}
/* Par com uma única partida: linha reta contínua */
.bracket-pair-solo::before { content: none; }

.bracket-match {
  display: flex; flex-direction: column; gap: .3rem;
}
.bracket-teams {
  display: flex; flex-direction: column;
  gap: 6px;
  position: relative;
}
.bracket-team {
  display: flex; align-items: center;
  gap: .45rem;
  padding: .4rem .55rem;
  font-size: .82rem; font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.bracket-team.is-winner {
  border-color: var(--brand);
  background: var(--brand-subtle);
  color: var(--text-primary);
}
.bracket-team.is-loser { opacity: .55; box-shadow: none; }
.bracket-team.is-pending { border-style: dashed; background: var(--bg-subtle); color: var(--text-muted); }
.bracket-avatar {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .62rem; font-weight: 700;
  color: #fff;
  background: var(--bracket-hue-0);
}
.bracket-avatar-0 { background: var(--bracket-hue-0); }
.bracket-avatar-1 { background: var(--bracket-hue-1); }
.bracket-avatar-2 { background: var(--bracket-hue-2); }
.bracket-avatar-3 { background: var(--bracket-hue-3); }
.bracket-avatar-4 { background: var(--bracket-hue-4); }
.bracket-avatar-5 { background: var(--bracket-hue-5); }
.bracket-avatar-6 { background: var(--bracket-hue-6); }
.bracket-avatar-7 { background: var(--bracket-hue-7); }
.bracket-avatar-empty { background: var(--bg-muted); color: var(--text-muted); }
.bracket-team-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bracket-score {
  min-width: 24px; text-align: center; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  padding: 0 .35rem;
  font-size: .78rem;
}
.is-winner .bracket-score { background: var(--brand); color: #fff; }
.bracket-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: .5rem;
  padding: 0 .3rem;
  font-size: .65rem; color: var(--text-muted);
  min-height: 20px;
}
.bracket-edit { color: var(--text-muted); }
.bracket-edit:hover { color: var(--brand); }
.bracket-team-edit { padding: .3rem .5rem .3rem .55rem; }
.bracket-select {
  flex: 1; min-width: 0;
  font-size: .76rem; font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: .2rem .3rem;
}
.bracket-select:disabled { opacity: .6; }

/* Feedback do remanejamento via AJAX (main.js, seção 7c) */
.bracket-match.bracket-flash-ok .bracket-team-edit {
  border-color: #16a34a; transition: border-color .15s ease;
}
.bracket-match.bracket-flash-error .bracket-team-edit {
  border-color: #dc2626; transition: border-color .15s ease;
}
.bracket-ajax-error {
  margin-top: .3rem;
  padding: .3rem .5rem;
  border-radius: var(--radius-xs);
  background: rgba(220, 38, 38, .1);
  color: #dc2626;
  font-size: .68rem;
  font-weight: 600;
}
[data-bs-theme="dark"] .bracket-ajax-error { background: rgba(248, 113, 113, .14); color: #f87171; }

/* ═══════════════════════════════════════════════════════════════
   Visual refresh — painéis de escola/árbitro e páginas internas
   ═══════════════════════════════════════════════════════════════ */

main.container {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

.page-header {
  padding: 1.1rem 1.25rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.96)),
    var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-xs);
}

[data-bs-theme="dark"] .page-header {
  background:
    linear-gradient(180deg, rgba(23,32,51,.88), rgba(17,24,39,.96)),
    var(--bg-surface);
}

.page-header h3,
.page-header h4 {
  letter-spacing: 0;
}

.row .card.border-0.shadow-sm.hover-card.text-center {
  min-height: 112px;
  justify-content: center;
  border: 1px solid var(--border) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.98)),
    var(--bg-surface) !important;
}

[data-bs-theme="dark"] .row .card.border-0.shadow-sm.hover-card.text-center {
  background:
    linear-gradient(180deg, rgba(23,32,51,.92), rgba(17,24,39,.98)),
    var(--bg-surface) !important;
}

.row .card.border-0.shadow-sm.hover-card.text-center > i {
  width: 46px;
  height: 46px;
  margin-inline: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--brand-subtle);
  font-size: 1.35rem !important;
}

.row .card.border-0.shadow-sm.hover-card.text-center .small {
  font-size: .78rem;
  color: var(--text-primary);
}

.stat-card {
  min-height: 108px;
  border-radius: 18px;
}

.stat-content h3 {
  letter-spacing: 0;
}

.progress {
  border-radius: 999px;
}

.progress-bar {
  border-radius: inherit;
}

nav[aria-label="breadcrumb"] {
  padding: .85rem 1rem;
  background: rgba(255,255,255,.64);
  border: 1px solid var(--border);
  border-radius: 16px;
}

[data-bs-theme="dark"] nav[aria-label="breadcrumb"] {
  background: rgba(17,24,39,.72);
}

.breadcrumb {
  margin-bottom: 0;
}

.modal-content,
.dropdown-menu {
  border-radius: 18px;
}

.accordion-item {
  border-radius: 16px !important;
  overflow: hidden;
  margin-bottom: .65rem;
}

.accordion-button {
  border-radius: 0 !important;
}

@media (max-width: 576px) {
  main.container {
    padding-top: 1rem;
  }
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.28rem; }
  h3 { font-size: 1.08rem; }
  .card-header,
  .card-body,
  .card-footer {
    padding-inline: 1rem;
  }
  .navbar .dropdown-menu {
    width: min(100%, calc(100vw - 1.5rem));
    min-width: 0;
  }
  .page-header {
    padding: 1rem;
    border-radius: 18px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Public polish — páginas públicas institucionais
   ═══════════════════════════════════════════════════════════════ */

body:not(.portal-home) main.container {
  max-width: 1180px;
}

.public-page-heading {
  display: flex;
  align-items: center;
  gap: .9rem;
  flex-wrap: wrap;
  padding: 1.15rem 1.25rem;
  background:
    radial-gradient(circle at 98% 0%, rgba(246, 196, 83, .12), transparent 18rem),
    linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,255,255,.98)),
    var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-xs);
}

[data-bs-theme="dark"] .public-page-heading {
  background:
    radial-gradient(circle at 98% 0%, rgba(246, 196, 83, .08), transparent 18rem),
    linear-gradient(180deg, rgba(23,32,51,.90), rgba(17,24,39,.98)),
    var(--bg-surface);
}

.public-page-heading h3 {
  letter-spacing: 0;
}

.public-page-heading-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 17px;
  color: var(--brand);
  background: var(--brand-subtle);
  border: 1px solid rgba(37, 99, 235, .12);
  font-size: 1.35rem;
}

.public-page-heading-icon.gold {
  color: var(--gold);
  background: var(--gold-bg);
  border-color: rgba(181, 134, 13, .16);
}

[data-bs-theme="dark"] .public-page-heading-icon.gold {
  color: var(--gold-bright);
  background: rgba(246, 196, 83, .10);
}

.public-section-heading {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--border);
}

.public-section-heading h4,
.public-section-heading h5 {
  letter-spacing: 0;
}

.public-filter-card {
  padding: .95rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-xs);
}

.public-table-card {
  overflow: hidden;
  border-radius: 20px !important;
}

.public-info-card {
  border-radius: 18px !important;
}

.public-mod-card {
  min-height: 86px;
  border-radius: 18px !important;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.public-mod-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.public-result-block {
  padding: 1rem;
  background: rgba(255,255,255,.50);
  border: 1px solid var(--border);
  border-radius: 22px;
}

[data-bs-theme="dark"] .public-result-block {
  background: rgba(17,24,39,.58);
}

.public-article {
  border-radius: 24px !important;
}

.public-article-media {
  max-height: 440px;
  overflow: hidden;
  background: #0f172a;
}

.public-article-img {
  width: 100%;
  height: 440px;
  object-fit: cover;
  display: block;
}

.public-article-title {
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  color: var(--text-primary);
  letter-spacing: 0;
  line-height: 1.15;
}

.public-kicker {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  text-transform: uppercase;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .07em;
}

.public-kicker-gold {
  color: var(--gold);
}

.public-podium-card {
  border-top: 3px solid var(--border) !important;
}

.public-podium-card.pos-1 { border-top-color: #c9972c !important; }
.public-podium-card.pos-2 { border-top-color: #9ca3af !important; }
.public-podium-card.pos-3 { border-top-color: #a07040 !important; }

.informe-html-body {
  max-width: 72ch;
}

.public-hero.public-page-hero {
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.public-page-hero-icon {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(255,255,255,.14);
  color: var(--gold-bright);
  font-size: 1.55rem;
  margin-bottom: .6rem;
}

.public-page-hero-subtitle {
  opacity: .82;
}

.portal-destaque {
  border-radius: 22px !important;
}

.portal-destaque-media {
  position: relative;
  height: 340px;
  overflow: hidden;
  background: #0f172a;
}

.portal-destaque-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s ease;
}

.portal-destaque:hover .portal-destaque-img {
  transform: scale(1.035);
}

.portal-destaque-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3, 7, 18, .84) 0%, rgba(3,7,18,.10) 68%, transparent 100%);
}

.portal-destaque-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.55rem 1.75rem;
}

.portal-destaque-title {
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  text-shadow: 0 1px 8px rgba(0,0,0,.45);
  letter-spacing: 0;
}

.portal-destaque-meta {
  color: rgba(255,255,255,.74);
  font-size: .8rem;
}

.portal-destaque-meta span {
  color: rgba(255,255,255,.92);
  font-weight: 700;
}

.portal-card-mini {
  border-left: 4px solid var(--brand) !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-radius: 18px !important;
  overflow: hidden;
}

.portal-card-mini[data-tipo="AVISO"] { border-left-color: var(--warning) !important; }
.portal-card-mini[data-tipo="RESULTADO"] { border-left-color: var(--gold) !important; }
.portal-card-mini[data-tipo="INFORME"] { border-left-color: #0d9488 !important; }

.portal-card-mini-row {
  display: flex;
  overflow: hidden;
  min-height: 134px;
}

.portal-card-mini-title {
  font-size: .95rem;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0;
}

.portal-card-mini-img {
  width: 168px;
  flex-shrink: 0;
  object-fit: cover;
}

.public-cco-card {
  background:
    radial-gradient(circle at 95% 0%, rgba(246, 196, 83, .22), transparent 12rem),
    linear-gradient(135deg, var(--brand-dark), var(--brand));
  border-radius: 20px;
  padding: 1.1rem;
}

.public-cco-card-text {
  opacity: .86;
}

@media (max-width: 640px) {
  .public-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .public-section-heading .ms-auto {
    margin-left: 0 !important;
  }
  .public-page-heading {
    padding: 1rem;
    border-radius: 18px;
  }
  .public-page-heading-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 1.1rem;
  }
  .portal-destaque-media,
  .public-article-img {
    height: 280px;
  }
  .portal-destaque-img {
    object-fit: contain !important;
    background: #0f172a;
  }
  .portal-card-mini-row {
    min-height: 120px;
  }
  .portal-card-mini-img {
    width: 118px;
  }
  .public-result-block {
    padding: .75rem;
    border-radius: 18px;
  }
}

@media (max-width: 430px) {
  .public-page-heading {
    flex-wrap: nowrap;
    align-items: flex-start;
  }
  .public-page-heading h3,
  .public-page-heading h4 {
    overflow-wrap: anywhere;
  }
  .portal-card-mini-row {
    display: block;
  }
  .portal-card-mini-img {
    width: 100%;
    height: 150px;
    display: block;
  }
  .public-article-img,
  .portal-destaque-media {
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   ÁREA DA ESCOLA E ÁREA DO DELEGADO — AUDIT_REPORT.md item 28
   ─────────────────────────────────────────────────────────────────────
   Essas duas áreas ainda usavam apenas os utilitários crus do Bootstrap
   (page-header + cards soltos), destoando do painel da CCO, que já tem um
   sistema visual próprio. Este bloco traz o mesmo vocabulário do painel
   (hero em gradiente da marca, trilha de fase, cartões de atalho com ícone
   colorido) para as áreas da escola e do delegado.
   ═══════════════════════════════════════════════════════════════════════ */

.area-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg, 16px);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  color: #fff;
  background: linear-gradient(120deg, #0a3362 0%, #1565c0 62%, #1e88e5 100%);
  box-shadow: 0 10px 28px -18px rgba(10, 51, 98, .85);
}
.area-hero::after {
  content: "";
  position: absolute;
  right: -60px; top: -80px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  pointer-events: none;
}
.area-hero-top {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  justify-content: space-between; gap: 1rem;
  position: relative; z-index: 1;
}
.area-hero h1 {
  font-size: 1.5rem; font-weight: 800; margin: 0 0 .25rem;
  letter-spacing: -.02em; line-height: 1.15;
}
.area-hero .area-hero-sub {
  font-size: .875rem; opacity: .88; margin: 0;
}
.area-hero .area-hero-chips {
  display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem;
}
.area-hero .area-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  padding: .22rem .7rem;
  font-size: .74rem; font-weight: 700;
  letter-spacing: .02em;
}
.area-hero .area-chip.is-alert {
  background: rgba(255, 193, 7, .92); border-color: transparent; color: #3a2c00;
}
.area-hero .area-chip.is-ok {
  background: rgba(34, 197, 94, .92); border-color: transparent; color: #04270f;
}
.area-hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; position: relative; z-index: 1; }
.area-hero-actions .btn { font-weight: 600; }

/* Trilha de fases do campeonato */
.area-fase-trilha {
  display: flex; align-items: center; gap: .35rem;
  flex-wrap: wrap; margin-top: 1rem;
  position: relative; z-index: 1;
}
.area-fase-step {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; opacity: .55;
  padding: .18rem .55rem; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .3);
}
.area-fase-step.is-done { opacity: .8; background: rgba(255, 255, 255, .12); }
.area-fase-step.is-active {
  opacity: 1; background: #fff; color: #0a3362;
  border-color: #fff; box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .55);
}
.area-fase-sep { opacity: .45; font-size: .7rem; }

/* Cartões de atalho */
.area-atalhos { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.area-atalho {
  display: flex; align-items: center; gap: .7rem;
  padding: .85rem .95rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md, 12px);
  background: var(--bg-surface, #fff);
  text-decoration: none; color: inherit;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.area-atalho:hover {
  transform: translateY(-2px);
  border-color: rgba(21, 101, 192, .45);
  box-shadow: 0 12px 22px -16px rgba(10, 51, 98, .7);
  color: inherit;
}
.area-atalho .ico {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; font-size: 1.1rem;
  background: rgba(21, 101, 192, .1); color: #1565c0;
}
.area-atalho .ico.warning { background: rgba(217, 119, 6, .12); color: #d97706; }
.area-atalho .ico.danger  { background: rgba(220, 38, 38, .12); color: #dc2626; }
.area-atalho .ico.success { background: rgba(22, 163, 74, .12); color: #16a34a; }
.area-atalho .ico.info    { background: rgba(2, 132, 199, .12); color: #0284c7; }
.area-atalho .txt { min-width: 0; }
.area-atalho .txt strong { display: block; font-size: .82rem; font-weight: 700; line-height: 1.2; }
.area-atalho .txt span { display: block; font-size: .7rem; color: var(--text-muted, #6b7280); margin-top: .1rem; }
.area-atalho .area-atalho-badge {
  position: absolute; top: .45rem; right: .5rem;
  font-size: .62rem; font-weight: 800;
  padding: .1rem .38rem; border-radius: 999px;
}

@media (max-width: 575.98px) {
  .area-hero { padding: 1.15rem 1.15rem; border-radius: 14px; }
  .area-hero h1 { font-size: 1.2rem; }
  .area-hero-actions { width: 100%; }
  .area-hero-actions .btn { flex: 1 1 auto; }
  .area-atalhos { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

[data-bs-theme="dark"] .area-atalho {
  background: var(--bg-surface);
  border-color: rgba(255, 255, 255, .09);
}
[data-bs-theme="dark"] .area-atalho .txt span { color: #94a3b8; }
