/* ══════════════════════════════════════════════════════════
   GESTÃO IFMPCU — Sistema de Gestão de Igreja
   Identidade: dourado de vela + vinho litúrgico, sobre grafite acolhedor
══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #14121a;
  --surface: #1e1b26;
  --surface2: #2a2534;
  --border: #3d3648;
  --border2: #524a63;

  --text: #f6f3fb;
  --text-muted: #b6adc8;
  --text-dim: #8b8099;
  --text-on-accent: #241704;

  /* Marca — dourado de vela, independente dos estados */
  --accent: #d4a24c;
  --accent-hover: #c28f38;
  --accent-glow-08: rgba(212,162,76,.12);
  --accent-glow-15: rgba(212,162,76,.20);
  --accent-glow-25: rgba(212,162,76,.32);
  --accent-glow-40: rgba(212,162,76,.48);

  /* Cor secundária — vinho litúrgico, usada em gradientes e detalhes de marca */
  --accent2: #8c4a6b;
  --accent2-glow-10: rgba(140,74,107,.14);
  --accent2-glow-20: rgba(140,74,107,.24);

  /* Estados — significado fixo, não deve ser sobrescrito pela cor de marca */
  --blue: #4c8bf7; --blue-bg: rgba(76,139,247,.16); --blue-text: #a4cbfd; --blue-border: rgba(76,139,247,.34);
  --amber: #f5a524; --amber-bg: rgba(245,165,36,.17); --amber-text: #fed687; --amber-border: rgba(245,165,36,.36);
  --red: #f0555a; --red-bg: rgba(240,85,90,.16); --red-text: #ffb0b3; --red-border: rgba(240,85,90,.34);
  --green: #34cc70; --green-bg: rgba(52,204,112,.16); --green-text: #86eeae; --green-border: rgba(52,204,112,.34);
  --gray-bg: rgba(255,255,255,.07); --gray-dot: #7a8aa8;

  --radius: 14px;
  --radius-sm: 9px;
  --font-display: 'Space Grotesk', sans-serif;
  --font: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
  --shadow-card: 0 1px 2px rgba(0,0,0,.28), 0 10px 26px -12px rgba(0,0,0,.55);
  --shadow-elevated: 0 24px 64px rgba(0,0,0,.45);

  --header-bg: rgba(20,18,26,.85);
  --bg-wash: radial-gradient(1100px circle at 12% -8%, var(--accent-glow-08), transparent 55%),
             radial-gradient(900px circle at 100% 0%, var(--accent2-glow-10), transparent 50%);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f7f3ec;
  --surface: #ffffff;
  --surface2: #f0e9dc;
  --border: #e0d5c0;
  --border2: #cbb996;

  --text: #241c12;
  --text-muted: #6b5d48;
  --text-dim: #8c7d64;
  --text-on-accent: #ffffff;

  --accent: #a9752a;
  --accent-hover: #8f611f;
  --accent-glow-08: rgba(169,117,42,.10);
  --accent-glow-15: rgba(169,117,42,.18);
  --accent-glow-25: rgba(169,117,42,.28);
  --accent-glow-40: rgba(169,117,42,.42);

  --accent2: #6b2f4d;
  --accent2-glow-10: rgba(107,47,77,.10);
  --accent2-glow-20: rgba(107,47,77,.19);

  --blue-bg: rgba(59,130,246,.13); --blue-text: #1745c7; --blue-border: rgba(59,130,246,.34);
  --amber-bg: rgba(245,158,11,.16); --amber-text: #8a3d0c; --amber-border: rgba(245,158,11,.4);
  --red-bg: rgba(239,68,68,.13); --red-text: #ad1a1a; --red-border: rgba(239,68,68,.34);
  --green-bg: rgba(22,163,74,.13); --green-text: #127034; --green-border: rgba(22,163,74,.34);
  --gray-bg: rgba(15,15,30,.06); --gray-dot: #5c6b8a;

  --shadow-xs: 0 1px 2px rgba(16,24,40,.08);
  --shadow-card: 0 1px 3px rgba(16,24,40,.06), 0 10px 24px -10px rgba(16,24,40,.16);
  --shadow-elevated: 0 24px 64px rgba(16,24,40,.22);

  --header-bg: rgba(247,243,236,.85);
  --bg-wash: radial-gradient(1100px circle at 12% -8%, var(--accent-glow-08), transparent 55%),
             radial-gradient(900px circle at 100% 0%, var(--accent2-glow-10), transparent 50%);
  color-scheme: light;
}



* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; max-width: 100vw; }
body {
  font-family: var(--font); background: var(--bg-wash), var(--bg); background-attachment: fixed; color: var(--text);
  min-height: 100vh; -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
  overflow-x: hidden; overflow-x: clip; max-width: 100vw;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--accent-glow-40); }


input, select, textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 13px; color: var(--text);
  font-family: var(--font); font-size: .9rem; outline: none; transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--text-dim); }
textarea { resize: vertical; min-height: 70px; }
select { cursor: pointer; }
input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }
input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--accent); cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .78rem; font-weight: 600; color: var(--text-muted); }

/* Usado em todos os formulários do admin e do portal (cadastro de membro,
   financeiro, contribuições, usuários, configurações, meus-dados...) */
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { display: block; font-size: .78rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.field-hint { font-size: .72rem; color: var(--text-dim); line-height: 1.4; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.checkbox-row { display: flex; align-items: center; justify-content: flex-start; gap: 9px; }
.checkbox-row label { font-size: .85rem; color: var(--text); cursor: pointer; }

.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: var(--radius-sm); font-family: var(--font);
  font-size: .85rem; font-weight: 600; letter-spacing: .01em; padding: 10px 18px; cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s; white-space: nowrap;
}
.btn-primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 100%, white 6%), var(--accent)); color: var(--text-on-accent); box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 4px 16px var(--accent-glow-25); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 4px 20px var(--accent-glow-40); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--red-bg); color: var(--red-text); border: 1px solid var(--red-border); }
.btn-danger:hover { background: rgba(239,68,68,.2); }
.btn-icon {
  display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.btn-icon:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }
.btn-full { width: 100%; }

.spinner { width: 16px; height: 16px; border: 2px solid var(--spinner-track, rgba(255,255,255,.3)); border-top-color: var(--spinner-active, #fff); border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.badge-green { background: var(--green-bg); color: var(--green-text); } .badge-green::before { background: var(--green); }
.badge-blue { background: var(--blue-bg); color: var(--blue-text); } .badge-blue::before { background: var(--blue); }
.badge-amber { background: var(--amber-bg); color: var(--amber-text); } .badge-amber::before { background: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red-text); } .badge-red::before { background: var(--red); }
.badge-gray { background: var(--gray-bg); color: var(--text-muted); } .badge-gray::before { background: var(--gray-dot); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-card); }
.section-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.alert-error { background: var(--red-bg); border: 1px solid var(--red-border); color: var(--red-text); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .85rem; }
.alert-success { background: var(--green-bg); border: 1px solid var(--green-border); color: var(--green-text); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .85rem; }
.alert-info { background: var(--blue-bg); border: 1px solid var(--blue-border); color: var(--blue-text); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .85rem; }

.state-msg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 56px 20px; color: var(--text-muted); font-size: .88rem; text-align: center; }
.state-icon { font-size: 2rem; opacity: .5; }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th { text-align: left; padding: 12px 14px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); background: var(--surface2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th:first-child { border-top-left-radius: var(--radius-sm); }
.table th:last-child { border-top-right-radius: var(--radius-sm); }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface2); }
.table tbody tr:last-child td { border-bottom: none; }
.td-actions { display: flex; gap: 6px; justify-content: flex-end; }
.mono { font-family: var(--mono); }
.td-numero { font-family: var(--mono); font-weight: 600; color: var(--accent); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius); width: 100%; max-width: 540px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(0,0,0,.5); }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 980px; }

/* Modal tela cheia - layout dois painéis (desktop) */
.modal-fullscreen { max-width: 100%; max-height: 100%; width: 100%; height: 100%; border-radius: 0; border: none; }
.modal-overlay.overlay-fullscreen { padding: 0; }
.modal-fullscreen .modal-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; flex: 1; min-height: 0; }
.modal-fullscreen .form-col { padding: 24px 28px; overflow-y: auto; }
.modal-fullscreen .form-col:first-child { border-right: 1px solid var(--border); }
.modal-fullscreen .col-title { font-family: var(--font-display); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.modal-fullscreen .modal-header { border-radius: 0; }
.modal-fullscreen .modal-footer { border-radius: 0; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); flex-shrink: 0; }
.btn-close { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.btn-close:hover { background: var(--surface2); color: var(--text); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tab-btn { padding: 10px 16px; background: none; border: none; color: var(--text-muted); font-family: var(--font); font-size: .85rem; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: color .12s, border-color .12s; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.btn-theme-toggle { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; flex-shrink: 0; }
.btn-theme-toggle:hover { color: var(--text); }
.btn-theme-toggle .icon-sun { display: none; }
[data-theme="light"] .btn-theme-toggle .icon-moon { display: none; }
[data-theme="light"] .btn-theme-toggle .icon-sun { display: block; }

/* Com o menu suspenso aberto, "Alternar tema" e "Sair" já aparecem no
   rodapé do próprio menu — some com os ícones repetidos na topbar para
   não duplicar a mesma ação em dois lugares na tela. */
body.menu-aberto .topbar-actions .btn-theme-toggle,
body.menu-aberto .topbar-actions #btn-sair-mobile {
  display: none;
}

/* Com o menu aberto, trava o scroll do conteúdo por trás (o overlay
   por si só não impede o scroll/touch da página de fundo). */
html.menu-aberto, body.menu-aberto {
  overflow: hidden;
  height: 100%;
  touch-action: none;
}

/* Trilha de status — signature element: progresso da OS como trilha de circuito */
.trilha-status { display: flex; align-items: flex-start; overflow-x: auto; padding: 8px 2px 4px; gap: 0; }
.trilha-no { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; min-width: 86px; position: relative; }
.trilha-ponto { width: 14px; height: 14px; border-radius: 50%; background: var(--surface2); border: 2px solid var(--border2); z-index: 2; transition: all .2s; }
.trilha-no.feito .trilha-ponto { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow-15); }
.trilha-no.atual .trilha-ponto { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow-25); animation: pulse-no 2s ease-in-out infinite; }
.trilha-no.erro .trilha-ponto { background: var(--red); border-color: var(--red); box-shadow: 0 0 0 3px var(--red-border); }
@keyframes pulse-no { 0%, 100% { box-shadow: 0 0 0 4px var(--accent-glow-25); } 50% { box-shadow: 0 0 0 7px var(--accent-glow-08); } }
.trilha-linha { position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--border2); z-index: 1; }
.trilha-no:first-child .trilha-linha { display: none; }
.trilha-no.feito .trilha-linha, .trilha-no.atual .trilha-linha { background: var(--accent); }
.trilha-label { font-size: .66rem; color: var(--text-dim); text-align: center; margin-top: 8px; line-height: 1.3; max-width: 86px; }
.trilha-no.feito .trilha-label, .trilha-no.atual .trilha-label { color: var(--text); font-weight: 600; }

.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.timeline-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); margin-top: 3px; flex-shrink: 0; z-index: 1; }
.timeline-content { flex: 1; }
.timeline-acao { font-size: .85rem; font-weight: 600; }
.timeline-meta { font-size: .72rem; color: var(--text-dim); margin-top: 2px; }
.timeline-detalhe { font-size: .8rem; color: var(--text-muted); margin-top: 5px; background: var(--surface2); padding: 8px 11px; border-radius: 8px; }

.orcamento-item-row { display: grid; grid-template-columns: 1fr 110px 110px 120px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.orcamento-total { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; margin-top: 8px; border-top: 1px solid var(--border); font-size: 1.1rem; font-weight: 700; font-family: var(--font-display); }

@media (max-width: 720px) {
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  /* Linha de item de orçamento: descrição ocupa a linha toda, os
     campos numéricos ficam em pares organizados abaixo dela em vez
     de espremer as 5 colunas originais. */
  .orcamento-item-row { grid-template-columns: 1fr 1fr; row-gap: 8px; }
  .orcamento-item-row > input:first-child { grid-column: 1 / -1; }
  /* Em mobile, fullscreen vira modal normal */
  .modal-fullscreen { max-width: 100%; max-height: 92vh; height: auto; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-overlay.overlay-fullscreen { padding: 0; align-items: flex-end; }
  .modal-fullscreen .modal-body { grid-template-columns: 1fr; overflow-y: auto; max-height: calc(92vh - 130px); }
  .modal-fullscreen .form-col { padding: 16px 18px; overflow-y: visible; height: auto; }
  .modal-fullscreen .form-col:first-child { border-right: none; border-bottom: 1px solid var(--border); }
}

@media (max-width: 400px) {
  /* Telas muito estreitas: até o par qtd/valor unitário empilha */
  .orcamento-item-row { grid-template-columns: 1fr; }
  .orcamento-item-row .mono { text-align: left !important; }
  .orcamento-item-row .btn-icon { justify-self: start; }
}

/* ══════════════════════════════════════════════════════════
   MELHORIAS VISUAIS — refinamentos profissionais
══════════════════════════════════════════════════════════ */

/* ─── Scrollbar customizada (dark mode) ─────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ─── Cards com hover sutil ──────────────────────────────── */
.card { transition: border-color .18s, box-shadow .18s; }
.card:hover { border-color: var(--border2); }
.card-clickable { cursor: pointer; }
.card-clickable:hover { box-shadow: 0 4px 20px rgba(0,0,0,.2); transform: translateY(-1px); }

/* ─── Stat cards do dashboard ────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-accent, var(--accent));
  opacity: 0.7;
}
.stat-card:hover { border-color: var(--border2); box-shadow: 0 4px 20px rgba(0,0,0,.15); }
.stat-card .stat-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.stat-card .stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-card .stat-sub { font-size: .75rem; color: var(--text-dim); }
.stat-card.stat-green { --stat-accent: var(--green); }
.stat-card.stat-blue  { --stat-accent: var(--blue); }
.stat-card.stat-amber { --stat-accent: var(--amber); }
.stat-card.stat-red   { --stat-accent: var(--red); }
.stat-card.stat-gray  { --stat-accent: var(--gray-dot); }
.stat-card .stat-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--stat-accent, var(--accent)); opacity: .15; position: absolute; top: 16px; right: 16px; }
.stat-card .stat-icon-emoji { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }

/* ─── Tabelas com seleção visual e zebra suave ───────────── */
.table tbody tr:nth-child(even) { background: rgba(255,255,255,.013); }
[data-theme="light"] .table tbody tr:nth-child(even) { background: rgba(0,0,0,.018); }
.table tbody tr:hover { background: var(--accent-glow-08); }

/* ─── Botões com ícone — tamanho extra ───────────────────── */
.btn-icon-lg {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text-muted);
  cursor: pointer; transition: all .15s;
}
.btn-icon-lg:hover { color: var(--accent); border-color: var(--accent-glow-40); background: var(--accent-glow-08); }

/* ─── Inputs com ícone à esquerda ────────────────────────── */
.input-icon-wrap { position: relative; }
.input-icon-wrap .icon-left {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); pointer-events: none;
  display: flex; align-items: center;
}
.input-icon-wrap input { padding-left: 38px; }

/* ─── Toast de notificação (feedback visual) ─────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: .85rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  pointer-events: all;
  animation: toast-in .25s cubic-bezier(.22,.68,0,1.2) both;
  max-width: 340px;
}
.toast.toast-ok  { border-left: 3px solid var(--green); }
.toast.toast-err { border-left: 3px solid var(--red); }
.toast.toast-info { border-left: 3px solid var(--blue); }
.toast.out { animation: toast-out .2s ease both; }
@keyframes toast-in  { from { opacity:0; transform: translateY(16px) scale(.95); } to { opacity:1; transform:none; } }
@keyframes toast-out { to   { opacity:0; transform: translateY(8px) scale(.96); } }

/* ─── Empty state com ilustração ────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 64px 24px; gap: 14px; text-align: center;
}
.empty-state-icon {
  width: 56px; height: 56px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: var(--text-dim);
}
.empty-state h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--text); }
.empty-state p  { font-size: .83rem; color: var(--text-muted); max-width: 280px; line-height: 1.55; }

/* ─── Seção título com linha ─────────────────────────────── */
.section-title {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-size: .95rem; font-weight: 600;
  color: var(--text); margin-bottom: 16px;
}
.section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ─── Alerta de primeiro login ───────────────────────────── */
.primeiro-login-banner {
  display: flex; align-items: center; gap: 14px;
  background: var(--amber-bg); border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm); padding: 14px 18px;
  margin-bottom: 20px;
}
.primeiro-login-banner .icon { color: var(--amber); flex-shrink: 0; }
.primeiro-login-banner p { font-size: .85rem; color: var(--amber-text); flex: 1; line-height: 1.4; }
.primeiro-login-banner strong { font-weight: 700; }
.primeiro-login-banner .btn-trocar { background: var(--amber); color: #1c0900; border: none; border-radius: 7px; padding: 7px 14px; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap; }

/* ─── Paginação ──────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 4px;
  justify-content: center; padding: 16px 0 8px;
}
.page-btn {
  min-width: 34px; height: 34px; padding: 0 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: .83rem; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.page-btn:hover { color: var(--text); border-color: var(--border2); }
.page-btn.active { background: var(--accent-glow-15); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── Sidebar / header do admin ─────────────────────────── */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: var(--radius-sm);
  font-size: .85rem; color: var(--text-muted);
  cursor: pointer; transition: all .12s;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: var(--accent-glow-08);
  border-color: var(--accent-glow-25);
  color: var(--accent); font-weight: 600;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--red); color: #fff;
  font-size: .65rem; font-weight: 700;
  padding: 2px 6px; border-radius: 99px; min-width: 18px; text-align: center;
}

/* ─── Skeleton loader ────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w100 { width: 100%; }

/* ─── Dropdown menu ──────────────────────────────────────── */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 300;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  min-width: 180px;
  display: none;
}
.dropdown-menu.open { display: block; animation: fade-down .15s ease; }
@keyframes fade-down { from { opacity:0; transform: translateY(-6px); } to { opacity:1; } }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 7px;
  font-size: .84rem; color: var(--text-muted);
  cursor: pointer; transition: all .1s;
}
.dropdown-item:hover { background: var(--surface2); color: var(--text); }
.dropdown-item.danger:hover { background: var(--red-bg); color: var(--red-text); }
.dropdown-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ─── Focus ring acessível ───────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Print: esconde elementos de navegação ──────────────── */
@media print {
  .no-print, .btn-primary, .btn-secondary, .modal-overlay, header, nav { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ─── Responsivo mobile aprimorado ──────────────────────── */
@media (max-width: 480px) {
  .modal { border-radius: var(--radius) var(--radius) 0 0; margin-top: auto; max-height: 92vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .toast-container { bottom: 16px; right: 12px; left: 12px; }
  .toast { max-width: 100%; }
  .stat-card .stat-value { font-size: 1.6rem; }
}

/* ─── Tabelas que viram cards empilhados no mobile ───────────
   Ative com class="table table-cards" e adicione data-label="..."
   em cada <td> (o texto vira o rótulo mostrado ao lado do valor). */
@media (max-width: 700px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tbody tr {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 4px 14px; margin-bottom: 10px;
  }
  .table-cards tbody tr:last-child { margin-bottom: 0; }
  .table-cards td {
    border-bottom: 1px dashed var(--border); padding: 9px 0;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: right;
  }
  .table-cards tr td:last-child { border-bottom: none; }
  .table-cards td[data-label]::before {
    content: attr(data-label);
    font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-dim); flex-shrink: 0; text-align: left;
  }
  .table-cards td.td-numero { font-size: .95rem; }
  .table-cards td.td-actions { justify-content: flex-end; padding: 10px 0; gap: 6px; }
}
