:root {
  --sidebar-width: 225px;
  --sidebar-bg: #1a1a1a;
  --sidebar-border: #2a2a2a;
  --gold: #C9A227;
  --gold-light: #E8C44A;
  --gold-dark: #A07D10;
  --topbar-height: 56px;
  --body-bg: #0f0f0f;
  --card-bg: #1c1c1c;
  --card-border: #2a2a2a;
  --text-muted-custom: #888;
  /* Cores de título/número de dashboards (adaptam ao tema — ver tema claro) */
  --dash-num: #e0e0e0;
  --dash-section: #aaaaaa;
  --dash-cardhead: #cccccc;
}

body {
  background-color: #111318;
  font-family: 'Segoe UI', sans-serif;
  color: #e0e0e0;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid #2a2a2a;
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.25s ease;
  z-index: 100;
}

.sidebar-brand {
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.sidebar-brand:hover { color: var(--gold-light); }

.sidebar-logo-text {
  line-height: 1.1;
}
.sidebar-logo-text .brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
}
.sidebar-logo-text .brand-sub {
  font-size: 0.6rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-logo-img {
  width: 100%;
  max-width: 180px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.login-logo {
  width: 200px;
  height: auto;
  filter: drop-shadow(0 0 16px rgba(201,162,39,0.4));
}

.rv-badge {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  color: #0d0d0d;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(201,162,39,0.4);
}

.sidebar-section {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #444;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem 0.15rem;
}

.sidebar .nav-link {
  color: #aaa;
  border-radius: 8px;
  font-size: 0.875rem;
  padding: 0.45rem 0.75rem;
  transition: all 0.15s;
}
.sidebar .nav-link:hover {
  background: rgba(201,162,39,0.1);
  color: var(--gold-light);
}
.sidebar .nav-link.active {
  background: rgba(201,162,39,0.15);
  color: var(--gold);
  font-weight: 600;
  border-left: 3px solid var(--gold);
}
.sidebar .nav-link i { opacity: 0.8; }
.sidebar .nav-link.active i, .sidebar .nav-link:hover i { opacity: 1; }

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-height);
  background: #141414;
  border-bottom: 1px solid #1e1e1e;
  position: sticky;
  top: 0;
  z-index: 99;
}
.topbar .breadcrumb-item a { color: var(--gold); text-decoration: none; }
.topbar .breadcrumb-item.active { color: #888; }
.topbar .breadcrumb-item + .breadcrumb-item::before { color: #444; }

/* ── CONTENT ── */
#page-content { min-height: 100vh; overflow-x: hidden; }

/* ── CARDS ── */
.card {
  background: #1a1a1a;
  border-color: #252525 !important;
  color: #ddd;
}
.card-header {
  background: #1a1a1a !important;
  border-bottom-color: #252525 !important;
  color: #ddd;
}

/* ── STAT CARDS ── */
.stat-card { border-radius: 12px; transition: transform 0.15s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-icon {
  width: 56px; height: 56px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* ── TABLES ── */
.table {
  color: #ccc;
  border-color: #252525;
}
.table-dark { background: #111 !important; }
.table-dark th { background: #111 !important; color: #aaa; border-color: #222; }
.table-hover > tbody > tr:hover > * { background-color: rgba(201,162,39,0.05); color: #eee; }
.table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
}
.table td { font-size: 0.875rem; border-color: #222; }
.table-light { background: #161616 !important; color: #aaa; }
.table-light th { background: #161616 !important; }

/* ── ALERTS / MESSAGES ── */
.alert { border: none; border-radius: 8px; font-size: 0.875rem; }
.alert-success { background: rgba(39,174,96,0.15); color: #2ecc71; }
.alert-danger  { background: rgba(231,76,60,0.15);  color: #e74c3c; }
.alert-warning { background: rgba(243,156,18,0.15); color: #f39c12; }
.alert-info    { background: rgba(52,152,219,0.15); color: #3498db; }

/* ── BUTTONS ── */
.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border: none;
  color: #0d0d0d;
  font-weight: 600;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #0d0d0d;
}
.btn-outline-primary {
  border-color: var(--gold);
  color: var(--gold);
}
.btn-outline-primary:hover {
  background: var(--gold);
  color: #0d0d0d;
}
.btn-outline-secondary {
  border-color: #333;
  color: #aaa;
}
.btn-outline-secondary:hover {
  background: #333;
  color: #fff;
  border-color: #333;
}

/* ── FORMS ── */
.form-control, .form-select {
  background: #141414;
  border-color: #2a2a2a;
  color: #ddd;
}
.form-control:focus, .form-select:focus {
  background: #141414;
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(201,162,39,0.2);
}
.form-control::placeholder { color: #555; }
.input-group-text {
  background: #1a1a1a;
  border-color: #2a2a2a;
  color: #666;
}

/* ── BADGES ── */
.badge { font-weight: 500; }
.bg-primary { background: var(--gold) !important; color: #0d0d0d !important; }

/* ── LIST GROUP ── */
.list-group-item {
  background: transparent;
  border-color: #252525;
  color: #ccc;
}

/* ── BREADCRUMB ── */
.breadcrumb { margin: 0; }

/* ── LOGIN ── */
.login-bg {
  background: radial-gradient(ellipse at center, #1a1500 0%, #0d0d0d 70%);
  position: relative;
  overflow: hidden;
}
.login-bg::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(201,162,39,0.08) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.login-card {
  width: 100%;
  max-width: 430px;
  border-radius: 16px;
  background: #161616 !important;
  border: 1px solid #2a2a2a !important;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 40px rgba(201,162,39,0.05) !important;
}
.login-icon {
  width: 76px; height: 76px;
  background: linear-gradient(135deg, #0d0d0d, #1a1400);
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  box-shadow: 0 0 20px rgba(201,162,39,0.3);
}
.login-title { color: #fff; font-weight: 700; letter-spacing: 0.05em; }
.login-subtitle { color: var(--gold) !important; }

/* ── USER INFO NA SIDEBAR ── */
.sidebar-user { color: #aaa; }
.sidebar-user .user-name { color: #ddd; font-weight: 600; font-size: 0.85rem; }
.sidebar-user .user-level { color: var(--gold); font-size: 0.72rem; }

/* ── DIVIDERS ── */
hr { border-color: #1e1e1e; opacity: 1; }

/* ── SCROLLBAR ── */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }

/* ── SIDEBAR COLLAPSED ── */
#wrapper.sidebar-collapsed .sidebar { width: 0; padding: 0 !important; overflow: hidden; }

/* ── PINO + SIDEBAR RAIL (modo só-ícones, desktop) ── */
.sidebar-pin {
  display: none;
  width: 28px; height: 28px;
  align-items: center; justify-content: center;
  margin: 0 0 0.5rem 0.5rem;
  background: rgba(201,162,39,0.12);
  border: 1px solid rgba(201,162,39,0.3);
  border-radius: 6px;
  color: var(--gold);
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-pin:hover { background: rgba(201,162,39,0.25); }
.sidebar-pin .pin-off { display: none; }
#wrapper.sidebar-rail .sidebar-pin .pin-on { display: none; }
#wrapper.sidebar-rail .sidebar-pin .pin-off { display: inline; }

@media (min-width: 992px) {
  :root { --sidebar-rail: 68px; }
  .sidebar-pin { display: flex; }

  /* Recolhido = só ícones (estável; NÃO expande no hover — só pelo pino) */
  #wrapper.sidebar-rail .sidebar {
    position: fixed; left: 0; top: 0;
    height: 100vh;
    z-index: 200;
    width: var(--sidebar-rail);
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
    overflow-x: hidden;
  }
  #wrapper.sidebar-rail #page-content { margin-left: var(--sidebar-rail); }

  #wrapper.sidebar-rail .sidebar .collapse { display: block !important; }
  #wrapper.sidebar-rail .sidebar .nav-link {
    font-size: 0; text-align: center; padding: 0.5rem 0;
    border-left-color: transparent; border-radius: 8px;
  }
  #wrapper.sidebar-rail .sidebar .nav-link i { font-size: 1.15rem; margin: 0 !important; opacity: 0.9; }
  #wrapper.sidebar-rail .sidebar .nav-link.active { background: rgba(201,162,39,0.18); }
  #wrapper.sidebar-rail .sidebar-section-btn { justify-content: center; padding-left: 0; padding-right: 0; }
  #wrapper.sidebar-rail .sec-label,
  #wrapper.sidebar-rail .sec-icon,
  #wrapper.sidebar-rail .brand-sub,
  #wrapper.sidebar-rail .uinfo,
  #wrapper.sidebar-rail .act-label { display: none; }
  #wrapper.sidebar-rail .sidebar-logo-img { max-width: 42px; }
  #wrapper.sidebar-rail .sidebar-user { justify-content: center; }
  #wrapper.sidebar-rail .sidebar-pin { margin-left: auto; margin-right: auto; }
}

/* ── OVERLAY MOBILE ── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  transition: opacity 0.25s;
}
#sidebar-overlay.active { display: block; }

/* ── HAMBURGER BUTTON ── */
#sidebarToggle { color: var(--gold) !important; }

@media (max-width: 991.98px) {
  /* Sidebar vira drawer flutuante */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    z-index: 200;
    transition: width 0.25s ease;
  }
  #wrapper.sidebar-open .sidebar {
    width: var(--sidebar-width) !important;
    padding: 1rem !important;
    overflow-y: auto;
  }
  /* Conteúdo ocupa largura toda */
  #page-content { width: 100%; }

  /* Padding menor no conteúdo */
  .container-fluid.p-4 { padding: 0.75rem !important; }

  /* Botões de ação quebram linha */
  .d-flex.gap-2.flex-wrap { gap: 0.3rem !important; }

  /* Ocultar texto dos botões de ação mantendo ícone */
  .btn-action-text { display: none; }

  /* Filtros empilhados */
  .filter-form { flex-direction: column !important; }
  .filter-form > * { width: 100% !important; max-width: 100% !important; }

  /* Cards de totais empilham 2x2 */
  .stat-card-col { flex: 0 0 50% !important; max-width: 50% !important; }

  /* Topbar menor */
  .topbar { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
}

@media (max-width: 575.98px) {
  /* Cards em coluna única em telas muito pequenas */
  .stat-card-col { flex: 0 0 100% !important; max-width: 100% !important; }

  /* Título da página menor */
  h4.fw-bold { font-size: 1.1rem !important; }

  /* Tabelas com fonte menor */
  .table td, .table th { font-size: 0.78rem !important; }
}

/* ── TABLE DANGER/WARNING OVERRIDE ── */
.table-danger { background-color: rgba(231,76,60,0.1) !important; }
.table-warning { background-color: rgba(243,156,18,0.1) !important; }

/* ── STAT CARD BACKGROUNDS ── */
.stat-primary .stat-icon { background: rgba(201,162,39,0.12); color: var(--gold); }
.stat-danger  .stat-icon { background: rgba(231,76,60,0.12);  color: #e74c3c; }
.stat-warning .stat-icon { background: rgba(243,156,18,0.12); color: #f39c12; }
.stat-success .stat-icon { background: rgba(46,204,113,0.12); color: #2ecc71; }

/* ── DARK THEME: TEXT OVERRIDES ── */
/* text-muted do Bootstrap é #6c757d — invisível no fundo escuro */
.text-muted { color: #8a8a8a !important; }
small.text-muted, p.text-muted { color: #7a7a7a !important; }

/* Labels dos stat-cards — mais legíveis no dark */
.stat-label {
  color: #aaa;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.stat-sublabel { color: #666; font-size: 0.75rem; }

/* Card headers devem ter texto visível */
.card-header h6, .card-header .h6 { color: #ccc; }

/* Chart.js canvas — fundo transparente */
canvas { background: transparent !important; }

/* ── BADGE NAO_LANCADO ── */
.badge-nao-lancado { background: #8B0000; color: #fff; }

/* ── STATUS BADGES (linhas + boletos) ── */
.badge-ativa     { background:#27ae60!important; color:#fff!important; }
.badge-suspensa  { background:#e67e22!important; color:#fff!important; }
.badge-cancelada { background:#e74c3c!important; color:#fff!important; }
.badge-estoque   { background:#C9A227!important; color:#0d0d0d!important; }
.badge-bloqueada { background:#8e44ad!important; color:#fff!important; }
.badge-inativa   { background:#555!important;    color:#ccc!important; }
.badge-verificar { background:#f39c12!important; color:#0d0d0d!important; }
.badge-verificado { background:#17a2b8!important; color:#fff!important; }
.badge-encerrado { background:#2c3e50!important; color:#bbb!important; }

/* ── SIDEBAR COLLAPSIBLE SECTIONS ── */
.sidebar-section-btn {
  background: none;
  border: none;
  padding: 0.5rem 0.75rem 0.15rem;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #444;
}
.sidebar-section-btn:hover { color: #666; }
.sidebar-section-btn .sec-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sidebar-section-btn .sec-icon {
  font-size: 0.6rem;
  transition: transform 0.2s;
}
.sidebar-section-btn.collapsed .sec-icon { transform: rotate(-90deg); }

/* ── TEMA: BOTÃO TOGGLE ─────────────────────────────────────────────────────── */
.btn-tema-toggle {
  background: none;
  border: 1px solid rgba(201,162,39,0.3);
  color: var(--gold);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.btn-tema-toggle:hover {
  background: rgba(201,162,39,0.12);
  border-color: var(--gold);
}

/* ── TEMA CLARO ──────────────────────────────────────────────────────────────── */
[data-bs-theme="light"] {
  --sidebar-bg: #ffffff;
  --sidebar-border: #e0e0e0;
  --card-bg: #ffffff;
  --card-border: #dee2e6;
  --text-muted-custom: #666;
  --dash-num: #1b2430;
  --dash-section: #41506a;
  --dash-cardhead: #34404f;
}

[data-bs-theme="light"] body {
  background-color: #f0f2f5;
  color: #1a1a1a;
}

[data-bs-theme="light"] .sidebar {
  background: #ffffff;
  border-right-color: #e0e0e0;
  color: #1a1a1a;
}

[data-bs-theme="light"] .sidebar .nav-link {
  color: #555;
}
[data-bs-theme="light"] .sidebar .nav-link:hover {
  background: rgba(201,162,39,0.1);
  color: var(--gold-dark);
}
[data-bs-theme="light"] .sidebar .nav-link.active {
  background: rgba(201,162,39,0.15);
  color: var(--gold-dark);
  border-left-color: var(--gold-dark);
}

[data-bs-theme="light"] .sidebar-section-btn { color: #999; }
[data-bs-theme="light"] .sidebar-section-btn:hover { color: #666; }

[data-bs-theme="light"] .sidebar-user { color: #555; }
[data-bs-theme="light"] .sidebar-user .user-name { color: #222; }

[data-bs-theme="light"] hr { border-color: #e0e0e0; }

[data-bs-theme="light"] .topbar {
  background: #ffffff;
  border-bottom-color: #e0e0e0;
}

[data-bs-theme="light"] .card {
  background: #ffffff;
  border-color: #dee2e6 !important;
  color: #1a1a1a;
}
[data-bs-theme="light"] .card-header {
  background: #f8f9fa !important;
  border-bottom-color: #dee2e6 !important;
  color: #1a1a1a;
}

[data-bs-theme="light"] .table { color: #333; border-color: #dee2e6; }
[data-bs-theme="light"] .table th { color: #555; }
[data-bs-theme="light"] .table td { border-color: #dee2e6; }
[data-bs-theme="light"] .table-dark { background: #495057 !important; }
[data-bs-theme="light"] .table-dark th { background: #495057 !important; color: #fff; border-color: #6c757d; }
[data-bs-theme="light"] .table-hover > tbody > tr:hover > * { background-color: rgba(201,162,39,0.06); color: #111; }
[data-bs-theme="light"] .table-light { background: #f8f9fa !important; color: #333; }
[data-bs-theme="light"] .table-light th { background: #f8f9fa !important; }

[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select {
  background: #ffffff;
  border-color: #ced4da;
  color: #1a1a1a;
}
[data-bs-theme="light"] .form-control:focus,
[data-bs-theme="light"] .form-select:focus {
  background: #ffffff;
  border-color: var(--gold);
  color: #1a1a1a;
  box-shadow: 0 0 0 0.2rem rgba(201,162,39,0.2);
}
[data-bs-theme="light"] .form-control::placeholder { color: #aaa; }
[data-bs-theme="light"] .input-group-text {
  background: #f8f9fa;
  border-color: #ced4da;
  color: #888;
}

[data-bs-theme="light"] .alert-success { background: rgba(39,174,96,0.1);   color: #1a7240; }
[data-bs-theme="light"] .alert-danger  { background: rgba(231,76,60,0.1);   color: #c0392b; }
[data-bs-theme="light"] .alert-warning { background: rgba(243,156,18,0.1);  color: #9a6c00; }
[data-bs-theme="light"] .alert-info    { background: rgba(52,152,219,0.1);  color: #1a6fa3; }

[data-bs-theme="light"] .text-muted { color: #777 !important; }
[data-bs-theme="light"] small.text-muted, [data-bs-theme="light"] p.text-muted { color: #888 !important; }

[data-bs-theme="light"] .list-group-item {
  background: #ffffff;
  border-color: #dee2e6;
  color: #1a1a1a;
}

[data-bs-theme="light"] .btn-outline-secondary {
  border-color: #ced4da;
  color: #555;
}
[data-bs-theme="light"] .btn-outline-secondary:hover {
  background: #e9ecef;
  color: #333;
  border-color: #adb5bd;
}

[data-bs-theme="light"] .btn-tema-toggle {
  border-color: rgba(201,162,39,0.4);
  color: var(--gold-dark);
}

[data-bs-theme="light"] #wrapper { background: #f0f2f5; }

[data-bs-theme="light"] .bg-dark-subtle { background: #f8f9fa !important; }
[data-bs-theme="light"] .border { border-color: #dee2e6 !important; }

[data-bs-theme="light"] .stat-label { color: #666; }
[data-bs-theme="light"] .stat-sublabel { color: #999; }
[data-bs-theme="light"] .card-header h6, [data-bs-theme="light"] .card-header .h6 { color: #333; }

[data-bs-theme="light"] .sidebar::-webkit-scrollbar-thumb { background: #ccc; }

/* ════════════════════════════════════════════════════════════════════════════
   POLIMENTO VISUAL — GLOBAL (todo o sistema)
   Abas, tabelas, busca, botões e micro-interações modernas. Base: dark + dourado.
   Promovido do piloto do Cadastro (2026-05-31) para todas as telas.
   ════════════════════════════════════════════════════════════════════════════ */
:root { --hub-radius: 14px; }

/* Abas — sublinhado dourado animado */
.nav-tabs { border-bottom: 1px solid #222; gap: .15rem; }
.nav-tabs .nav-link {
  position: relative; border: 0; background: transparent; color: #9a9a9a;
  font-weight: 600; padding: .6rem .95rem; border-radius: 10px 10px 0 0;
  transition: color .18s ease, background .18s ease;
}
.nav-tabs .nav-link:hover { color: #e8e8e8; background: rgba(255,255,255,.03); }
.nav-tabs .nav-link::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transform: scaleX(0); transform-origin: center; transition: transform .22s ease; border-radius: 2px;
}
.nav-tabs .nav-link.active { color: var(--gold); background: rgba(201,162,39,.06); }
.nav-tabs .nav-link.active::after { transform: scaleX(1); }
.nav-tabs .nav-link .badge {
  background: rgba(255,255,255,.08) !important; color: #cfcfcf; font-weight: 600; transition: all .18s ease;
}
.nav-tabs .nav-link.active .badge { background: rgba(201,162,39,.18) !important; color: var(--gold-light); }

/* Painel de abas */
.tab-content { border-radius: 0 var(--hub-radius) var(--hub-radius) var(--hub-radius); }
[data-bs-theme="dark"] .tab-content-dark { background: linear-gradient(180deg, #141414, #101010); }

/* Entrada suave do conteúdo da aba */
.tab-pane.show.active { animation: hubFade .28s ease both; }
@keyframes hubFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Busca arredondada (campos de busca em geral) */
input[name="busca"], input[type="search"].form-control {
  border-radius: 999px; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input[name="busca"]:focus, input[type="search"].form-control:focus {
  border-color: var(--gold); box-shadow: 0 0 0 .2rem rgba(201,162,39,.18);
}

/* Tabelas — cabeçalho em maiúsculas + hover com filete dourado */
.table thead th { text-transform: uppercase; letter-spacing: .4px; }
.table-hover > tbody > tr { transition: background .15s ease, box-shadow .15s ease; }
.table-hover > tbody > tr:hover > * { box-shadow: inset 3px 0 0 var(--gold); }

/* Botões — micro-interação */
.btn { transition: transform .12s ease, filter .15s ease, background .15s ease, color .15s ease, border-color .15s ease; }
.btn:active { transform: translateY(1px) scale(.98); }

/* HTMX — linha saindo (fade) */
tr.htmx-swapping { opacity: 0; transform: translateX(10px); transition: opacity .2s ease, transform .2s ease; }

/* Skeleton shimmer reutilizável (para futuros loaders) */
.skeleton {
  background: linear-gradient(90deg, #1a1a1a 25%, #222 37%, #1a1a1a 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* Respeita "movimento reduzido" */
@media (prefers-reduced-motion: reduce) {
  .nav-tabs .nav-link::after, .tab-pane.show.active,
  .table-hover > tbody > tr, .btn, .skeleton, tr.htmx-swapping {
    animation: none !important; transition: none !important;
  }
  html { scroll-behavior: auto !important; }
}

/* ── Afinamento de tema (global) ───────────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* Scrollbars mais discretas (WebKit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; background-clip: padding-box; }

/* Foco visível dourado (acessibilidade) */
:focus-visible { outline: 2px solid rgba(201,162,39,.6); outline-offset: 2px; }

/* Botão primário — leve brilho no hover */
[data-bs-theme="dark"] .btn-primary:hover { filter: brightness(1.06); }

/* Cards — transição suave (sem mover layout) */
.card { transition: border-color .2s ease, box-shadow .2s ease; }

/* Badges — leve respiro */
.badge { letter-spacing: .2px; }

/* ── FullCalendar (agenda) — tema dark + dourado ───────────────────────────────
   IMPORTANTE: o FullCalendar declara as variáveis --fc-* no próprio .fc, então o
   override TEM que ser no .fc (não no pai #agendaCalendar), senão o default dele
   vence e o calendário sai com o tema claro. */
[data-bs-theme="dark"] #agendaCalendar .fc {
  --fc-border-color: #2a2a2a;
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: #161616;
  --fc-neutral-text-color: #bbb;
  --fc-list-event-hover-bg-color: #1c1c1c;
  --fc-today-bg-color: rgba(201,162,39,.10);
  --fc-button-text-color: #ccc;
  --fc-button-bg-color: #1a1a1a;
  --fc-button-border-color: #2a2a2a;
  --fc-button-hover-bg-color: #232323;
  --fc-button-hover-border-color: #333;
  --fc-button-active-bg-color: #c9a227;
  --fc-button-active-border-color: #c9a227;
  color: #ddd;
}
[data-bs-theme="dark"] #agendaCalendar .fc a { color: inherit !important; text-decoration: none !important; }
[data-bs-theme="dark"] #agendaCalendar .fc .fc-toolbar-title { color: #eee; font-size: 1.15rem; }
[data-bs-theme="dark"] #agendaCalendar .fc .fc-col-header-cell-cushion,
[data-bs-theme="dark"] #agendaCalendar .fc .fc-daygrid-day-number { color: #bbb !important; }
[data-bs-theme="dark"] #agendaCalendar .fc .fc-button-active { color: #0d0d0d !important; }
[data-bs-theme="dark"] #agendaCalendar .fc .fc-button { text-transform: capitalize; }
#agendaCalendar .fc-daygrid-event { font-size: .78rem; padding: 1px 4px; }

/* Força o cabeçalho dos dias da semana escuro (não depende das variáveis do FC),
   e nomes de dia completos capitalizados (Domingo, Segunda, …). */
[data-bs-theme="dark"] #agendaCalendar .fc .fc-col-header-cell,
[data-bs-theme="dark"] #agendaCalendar .fc .fc-scrollgrid-section-header > * ,
[data-bs-theme="dark"] #agendaCalendar .fc thead th { background: #161616 !important; }
[data-bs-theme="dark"] #agendaCalendar .fc .fc-scrollgrid { background: transparent !important; }
#agendaCalendar .fc .fc-col-header-cell-cushion { text-transform: capitalize; padding: 6px 4px; font-weight: 600; }
