/* ── Design Tokens — Grupo Vilarouca ────────────────────── */
:root {
  --primary:      #E05E3B;
  --primary-dark: #c4512f;
  --secondary:    #074866;
  --secondary-dark: #053550;
  --bg:           #FFFFFF;
  --bg-alt:       #ECEFF2;
  --bg-dark:      #f3f4f6;
  --text:         #1a2332;
  --text-muted:   #6b7280;
  --border:       #e2e6ea;
  --success:      #059669;
  --error:        #dc2626;
  --warning:      #d97706;
  --focus-ring:   rgba(224, 94, 59, 0.35);
  --font:         'Montserrat', sans-serif;
  --radius-sm:    4px;
  --radius:       8px;
  --radius-lg:    12px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.06);
  --shadow:       0 2px 8px rgba(0,0,0,0.09);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.10);
  --transition:   0.3s ease;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--secondary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); cursor: pointer; border: none; outline: none; }
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Utilitários ─────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.hidden { display: none !important; }

/* ── Toast / Alert ───────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
}
.alert-error   { background: #fef2f2; color: var(--error);   border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════════════════════ */
.login-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 40px 24px;
  background: var(--bg-alt);
}

.login-logo-central { width: 240px; max-width: 70vw; height: auto; }

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
}

/* Rodapé azul exclusivo da tela de login */
.login-body .footer {
  background: var(--secondary);
  color: rgba(255, 255, 255, 0.85);
  border-top: none;
}
.login-body .footer strong { color: #fff; }

/* ── Transição login → tela inicial ─────────────────────── */
/* Saída: ao logar, a tela de login desfoca e desliza para cima */
.login-body .login-page,
.login-body .footer {
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.85s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.85s cubic-bezier(0.4, 0, 0.2, 1);
}
.login-body.is-leaving .login-page {
  opacity: 0;
  transform: translateY(-16px) scale(0.985);
  filter: blur(2px);
}
.login-body.is-leaving .footer { opacity: 0; }

/* Entrada: a tela inicial surge com fade + leve subida */
@keyframes app-enter {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.app { animation: app-enter 1.1s cubic-bezier(0.16, 1, 0.3, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .login-body .login-page,
  .login-body .footer { transition: none; }
  .app { animation: none; }
}
.login-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.login-card p.subtitle {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 32px;
}

/* Campo de senha com botão de visualizar */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}
.password-toggle:hover { color: var(--text); background: var(--bg-alt); }
.password-toggle svg { width: 20px; height: 20px; }

/* Link "Esqueci minha senha" */
.forgot-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
}
.forgot-link:hover { color: var(--primary-dark); }

/* Checkbox "Lembrar meu acesso" */
.remember-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
}
.remember-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Form fields */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.field input::placeholder { color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background var(--transition), opacity var(--transition), transform var(--transition);
  min-height: 44px;
  min-width: 44px;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover:not(:disabled) { background: var(--secondary-dark); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) { background: var(--bg-alt); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-alt); }

.btn-danger {
  background: var(--error);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
  min-height: 34px;
}

/* ═══════════════════════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════════════════════ */
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* Admin badge — estilo do painel do hero (handoff) */
.badge-admin {
  background: transparent;
  color: #FFE6D8;
  border: 1.5px solid rgba(255,255,255,0.45);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Tab navigation (primary — franquias) */
.tab-nav {
  background: var(--secondary);
  padding: 0 24px;
  display: flex;
  justify-content: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
}
.tab-nav::-webkit-scrollbar { display: none; }
/* Barra deslizante (escorrega horizontalmente entre abas) */
.tab-indicator {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px; width: 0;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
  transform: translateX(0);
  transition: transform 0.42s cubic-bezier(0.65, 0, 0.35, 1),
              width     0.42s cubic-bezier(0.65, 0, 0.35, 1);
  pointer-events: none;
}
.tab-btn {
  padding: 14px 20px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
}
.tab-btn:hover { color: rgba(255,255,255,0.9); }
.tab-btn:active { transform: scale(0.94); }
.tab-btn.active { color: #fff; } /* a barra é desenhada por .tab-indicator */

/* Sub-tab navigation (secondary — áreas) */
.subtab-nav {
  background: var(--bg-alt);
  padding: 0 24px;
  display: flex;
  justify-content: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
}
.subtab-nav::-webkit-scrollbar { display: none; }
/* Barra deslizante das sub-abas */
.subtab-indicator {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px; width: 0;
  background: var(--secondary);
  border-radius: 2px 2px 0 0;
  transform: translateX(0);
  transition: transform 0.42s cubic-bezier(0.65, 0, 0.35, 1),
              width     0.42s cubic-bezier(0.65, 0, 0.35, 1);
  pointer-events: none;
}
.subtab-btn {
  padding: 10px 16px;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
}
.subtab-btn:hover { color: var(--text); }
.subtab-btn:active { transform: scale(0.94); }
.subtab-btn.active { color: var(--secondary); } /* a barra é desenhada por .subtab-indicator */

/* Main content */
.main-content {
  flex: 1;
  padding: 32px 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  scroll-margin-top: 64px;
}

/* Section header */
.section-header {
  margin-bottom: 24px;
}
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Dashboard card */
.dash-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  animation: card-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.dash-card:hover {
  box-shadow: 0 18px 40px -12px rgba(0,0,0,0.28);
  transform: translateY(-8px) scale(1.035);
}
.dash-card:active {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-md);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--bg-alt);
}
.card-image-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-image-placeholder svg { opacity: 0.25; }

.card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Tag que identifica dashboards do time de TI (GVTECH) — laranja da marca,
   fundo translúcido leve com borda e texto na cor da marca (--primary). */
.card-tag-gvtech {
  align-self: flex-start;
  background: rgba(224, 94, 59, 0.12);
  color: var(--primary);
  border: 1px solid rgba(224, 94, 59, 0.55);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  line-height: 1;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.card-actions {
  padding: 0 20px 20px;
  display: flex;
  gap: 8px;
}
.btn-open {
  background: var(--primary);
  color: #fff;
  font-size: 0.8125rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 600;
  flex: 1;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-open:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(196,81,47,0.8); text-decoration: none; }
.btn-open:active { transform: scale(0.96); box-shadow: none; }
.btn-doc {
  background: var(--bg-alt);
  color: var(--secondary);
  font-size: 0.8125rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 600;
  border: 1.5px solid var(--border);
  flex: 1;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}
.btn-doc:hover { background: #dce3ea; transform: translateY(-1px); text-decoration: none; }
.btn-doc:active { transform: scale(0.96); }

/* Admin edit overlay on card */
.dash-card.admin-mode { position: relative; }
.card-admin-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(7,72,102,0.88);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: none;
  font-family: var(--font);
}
.dash-card.admin-mode:hover .card-admin-btn { display: flex; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 32px;
  color: var(--text-muted);
}
.empty-state h3 { font-size: 1.125rem; margin-bottom: 8px; color: var(--text); }
.empty-state p  { font-size: 0.9375rem; }

/* Skeleton loader */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 37%, #f0f0f0 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.skeleton-card { height: 260px; border-radius: var(--radius-lg); }

/* ═══════════════════════════════════════════════════════════
   ADMIN PANEL
═══════════════════════════════════════════════════════════ */
.admin-layout { min-height: 100vh; display: flex; flex-direction: column; }

.admin-header {
  background: var(--secondary);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 900;
}
.admin-header-title { font-size: 1.125rem; font-weight: 700; }

/* Botão "Voltar ao início" — com fundo/borda para destaque no header escuro */
.btn-back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  font-family: var(--font); font-size: 0.8125rem; font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.45);
  border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.btn-back:hover { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.7); }
.btn-back:active { transform: scale(0.97); }
.btn-back__arrow { font-size: 1rem; line-height: 1; }

.admin-nav {
  background: var(--secondary);
  padding: 0 24px;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  /* Fixa as abas logo abaixo do header (64px) ao rolar a página. */
  position: sticky;
  top: 64px;
  z-index: 890;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-tab-btn {
  padding: 12px 20px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition);
}
.admin-tab-btn:hover { color: rgba(255,255,255,0.85); }
.admin-tab-btn.active { color: #fff; }
/* Bordinha laranja deslizante (igual à tela inicial) */
.admin-tab-indicator {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px; width: 0;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
  transform: translateX(0);
  transition: transform 0.42s cubic-bezier(0.65, 0, 0.35, 1),
              width     0.42s cubic-bezier(0.65, 0, 0.35, 1);
  pointer-events: none;
}

.admin-content { flex: 1; padding: 32px 24px; max-width: 1200px; width: 100%; margin: 0 auto; }

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.admin-section-header h2 { font-size: 1.25rem; font-weight: 700; }

/* Table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th {
  background: var(--bg-alt);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-alt); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-active   { background: #d1fae5; color: #065f46; }
.status-inactive { background: #fee2e2; color: #991b1b; }

.role-badge { background: rgba(7,72,102,0.1); color: var(--secondary); padding: 2px 8px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; }
.role-admin-badge { background: rgba(224,94,59,0.12); color: var(--primary-dark); }

/* ── Grupos: dropdown de usuários ───────────────────────── */
.group-name-cell { display: inline-flex; align-items: center; gap: 8px; }
.group-expand-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  border: none; border-radius: 6px; cursor: pointer;
  background: rgba(7,72,102,0.08); color: var(--secondary);
  transition: background .15s ease, transform .2s ease;
}
.group-expand-btn:hover { background: rgba(7,72,102,0.16); }
.group-expand-btn.open { transform: rotate(180deg); background: rgba(224,94,59,0.14); color: var(--primary-dark); }
.group-user-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 99px; background: rgba(7,72,102,0.1);
  color: var(--secondary); font-size: 0.72rem; font-weight: 700;
}
.group-users-row > .group-users-cell { padding: 0; background: var(--bg-soft, rgba(7,72,102,0.03)); }
.group-users-panel { padding: 12px 16px 14px 44px; }
.group-users-head { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.group-users-empty { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }
.group-users-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.group-user-item {
  display: grid; grid-template-columns: 1fr 1.4fr auto; align-items: center; gap: 12px;
  padding: 7px 12px; border-radius: 8px;
}
.group-user-item:nth-child(odd) { background: rgba(7,72,102,0.04); }
.group-user-name { font-weight: 600; font-size: 0.88rem; }
.group-user-email { color: var(--text-muted); font-size: 0.83rem; word-break: break-all; }
@media (max-width: 640px) {
  .group-user-item { grid-template-columns: 1fr auto; }
  .group-user-email { grid-column: 1 / -1; }
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  animation: modal-in 0.2s ease;
}
@keyframes modal-in { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  padding: 20px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1.125rem; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px; border-radius: var(--radius-sm);
  font-size: 1.25rem; line-height: 1;
}
.modal-close:hover { background: var(--bg-alt); color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 0 24px 20px; display: flex; gap: 8px; justify-content: flex-end; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  /* Hero empilha: texto em cima, composição embaixo */
  .hero__inner { flex-direction: column; align-items: flex-start; gap: 36px; padding: 52px 36px; }
  .hero__text { min-width: 0; width: 100%; }
  .hero__title { font-size: 44px; }
  .hero__subtitle { max-width: none; }
  .hero__viz { width: 100%; max-width: 360px; height: 320px; }
}

@media (max-width: 640px) {
  /* Tabs — troca center por flex-start: evita que o overflow clip do lado esquerdo */
  .tab-nav, .subtab-nav { padding: 0 12px; justify-content: flex-start; }

  /* Alvos de toque mínimo 44px (WCAG 2.5.5) */
  .subtab-btn  { min-height: 44px; padding: 10px 14px; }
  .btn-open, .btn-doc, .btn-sm { min-height: 44px; }
  .profile-avatar { width: 44px; height: 44px; }
  .profile-dropdown-item { padding: 13px 16px; }

  /* Hero — esconde a composição decorativa em telas pequenas */
  .hero__viz { display: none; }
  .hero__actions { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* Conteúdo principal */
  .main-content { padding: 20px 16px; }
  .section-title { font-size: 1.125rem; }
  .section-header { margin-bottom: 16px; }

  /* Cards */
  .cards-grid { grid-template-columns: 1fr; gap: 14px; }
  .card-body   { padding: 16px; }
  .card-actions { padding: 0 16px 16px; }
  .card-image, .card-image-placeholder { height: 140px; }

  /* Admin */
  .admin-content { padding: 20px 14px; }
  .admin-header  { padding: 0 14px; gap: 8px; }
  .admin-header-title { font-size: 0.9375rem; }
  .admin-nav { padding: 0 12px; }

  /* Modal ocupa mais largura em telas pequenas */
  .modal-overlay { padding: 12px; }
  .modal-body, .modal-header { padding-left: 18px; padding-right: 18px; }
  .modal-footer { padding: 0 18px 18px; }
}

/* ── Telas muito pequenas (≤ 480px — iPhones menores) ───── */
@media (max-width: 480px) {
  /* Hero */
  .hero__inner { padding: 40px 24px; }
  .hero__title { font-size: 34px; }
  .hero__subtitle { font-size: 16px; }
  .hero__lockup .hero__logo, .hero__lockup .divider { height: 24px; }
  .hero__lockup { gap: 14px; margin-bottom: 24px; }
  .hero__cta { padding: 14px 22px; font-size: 15px; }
  .main-content { scroll-margin-top: 60px; }

  /* Login */
  .login-card { padding: 28px 20px; }
  .login-card h1 { font-size: 1.5rem; }
  .login-logo-central { width: 200px; }

  /* Admin — esconde o título em telas muito pequenas para o botão caber */
  .admin-header-title { display: none; }

  /* Tabela admin — garante scroll horizontal */
  .table-wrap { border-radius: var(--radius-sm); }
  td, th { padding: 10px 12px; font-size: 0.8125rem; }
}

/* ═══════════════════════════════════════════════════════════
   HERO V1 — design handoff (fundo laranja em gradiente, full-bleed)
═══════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(1100px 560px at 8% -20%, #EE7B45 0%, rgba(238,123,69,0) 55%),
    linear-gradient(135deg, #C8472A 0%, #D85A2D 52%, #AE3B21 100%);
}
.hero__dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1.5px, transparent 1.6px);
  background-size: 26px 26px; opacity: 0.7;
}
.hero__user { position: absolute; top: 30px; right: 34px; display: flex; align-items: center; gap: 12px; z-index: 6; }

.hero__inner { position: relative; z-index: 2; display: flex; align-items: center; gap: 40px; padding: 62px 64px; max-width: 1320px; margin: 0 auto; }

.hero__text { flex: 1.05; min-width: 430px; }
.hero__lockup { display: flex; align-items: center; gap: 18px; margin-bottom: 30px; }
/* Ambas as logos em branco e exatamente do mesmo tamanho visual */
.hero__lockup .hero__logo { display: block; width: auto; height: 30px; }
.hero__lockup .divider { width: 1px; height: 30px; background: rgba(255,255,255,0.3); }
.hero__title { margin: 0; font-size: 66px; line-height: 1.0; font-weight: 800; letter-spacing: -0.03em; color: #fff; }
.hero__subtitle { margin: 22px 0 0; font-size: 19px; font-weight: 500; line-height: 1.5; color: rgba(255,255,255,0.86); max-width: 440px; }
.hero__actions { display: flex; align-items: center; gap: 16px; margin-top: 38px; }
.hero__cta {
  display: inline-flex; align-items: center; gap: 12px;
  background: #fff; color: #BC4123; border: none; font-family: inherit;
  font-size: 16px; font-weight: 800; letter-spacing: -0.01em;
  padding: 16px 26px; border-radius: 14px; cursor: pointer;
  text-decoration: none;
  box-shadow: 0 14px 30px -12px rgba(80,20,5,0.6);
  transition: transform .35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow .35s ease;
}
.hero__cta:hover { transform: translateY(-3px); color: #BC4123; text-decoration: none; box-shadow: 0 20px 40px -12px rgba(80,20,5,0.7); }
.hero__cta:active { transform: translateY(-1px) scale(0.97); box-shadow: 0 8px 18px -10px rgba(80,20,5,0.6); }
.hero__cta .arrow { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: #BC4123; color: #fff; align-items: center; justify-content: center; font-size: 14px; transition: transform .35s ease; }
.hero__cta:hover .arrow { animation: arrow-bounce 1.5s ease-in-out infinite; }
@keyframes arrow-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
.hero__meta { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.82); }

/* composição à direita */
.hero__viz { position: relative; width: 430px; height: 340px; flex-shrink: 0; }
.viz-ring { position: absolute; top: -6px; right: -10px; width: 96px; height: 96px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.35); }
.glass-panel {
  position: absolute; top: 24px; right: 0; width: 360px; height: 268px;
  border-radius: 22px; padding: 26px;
  background: rgba(255,255,255,0.16);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow: 0 30px 60px -30px rgba(90,25,10,0.7);
}
.glass-panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.gauge { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: conic-gradient(#fff 0 73%, rgba(255,255,255,0.28) 73% 100%); }
.gauge__hole { width: 44px; height: 44px; border-radius: 50%; background: rgba(216,90,45,0.92); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 120px; }
.bars > div { flex: 1; border-radius: 7px 7px 3px 3px; }

.float-card {
  position: absolute; bottom: 0; left: -6px; width: 184px;
  border-radius: 16px; background: #fff; padding: 16px 18px;
  box-shadow: 0 22px 44px -20px rgba(70,20,5,0.55);
  animation: floaty 6s ease-in-out infinite;
}
.float-card__row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.float-card__icon { width: 26px; height: 26px; border-radius: 8px; background: #FCEAE0; display: flex; align-items: center; justify-content: center; color: #D85A2D; font-size: 14px; font-weight: 900; }
.float-card__bars { display: flex; align-items: flex-end; gap: 6px; height: 34px; }
.float-card__bars > div { flex: 1; border-radius: 3px; }

@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ── Profile widget ──────────────────────────────────────── */
.profile-widget { position: relative; display: flex; align-items: center; gap: 8px; }
.profile-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.16);
  border: 1.5px solid rgba(255,255,255,0.6);
  color: #fff;
  font-size: 14px; font-weight: 800; letter-spacing: 0.04em;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; user-select: none;
  transition: opacity var(--transition), box-shadow var(--transition);
}
.profile-avatar:hover { opacity: 0.88; box-shadow: 0 0 0 3px rgba(255,255,255,0.35); }
.profile-avatar:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.profile-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 210px; overflow: hidden; z-index: 200;
  animation: dropdown-in 0.15s ease;
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.profile-dropdown-name {
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  word-break: break-word;
}
.profile-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 11px 16px;
  font-family: var(--font); font-size: 0.875rem; font-weight: 500;
  color: var(--text); background: transparent; border: none;
  border-bottom: 1px solid var(--border); cursor: pointer; text-align: left;
  text-decoration: none;
  transition: background var(--transition), padding-left var(--transition), transform var(--transition);
}
.profile-dropdown-item:hover { text-decoration: none; }
.profile-dropdown-item:last-child { border-bottom: none; }
.profile-dropdown-item:hover { background: var(--bg-alt); padding-left: 20px; }
.profile-dropdown-item:active { transform: scale(0.98); }
.profile-dropdown-item--danger { color: var(--error); }

/* ── Rodapé ─────────────────────────────────────────────── */
.footer {
  background: var(--bg-alt);
  color: var(--text-muted);
  text-align: center;
  padding: 14px 24px;
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
}
.footer strong { color: var(--text); }

/* ═══════════════════════════════════════════════════════════
   ADMIN — COMPONENTES ADICIONAIS
═══════════════════════════════════════════════════════════ */

/* Loading / célula vazia */
.td-loading { text-align: center; color: var(--text-muted); padding: 32px; }
.td-date    { color: var(--text-muted); font-size: 0.8125rem; white-space: nowrap; }
.row-actions { display: flex; gap: 8px; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 42px; height: 23px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #cbd5e1; border-radius: 999px;
  transition: background var(--transition);
}
.switch-slider::before {
  content: ''; position: absolute;
  height: 17px; width: 17px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}
.switch input:checked + .switch-slider { background: var(--success); }
.switch input:checked + .switch-slider::before { transform: translateX(19px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Barra de filtros */
.filters-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 16px; align-items: center;
}
.filter-input {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  min-height: 38px;
}
.filter-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); outline: none; }
input.filter-input[type="search"] { min-width: 220px; flex: 1 1 220px; max-width: 320px; }
select.filter-input { cursor: pointer; }

/* Seletor moderno de intervalo de datas (período personalizado) */
.date-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  min-height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(7, 72, 102, 0.06);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.date-range:focus-within {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(7, 72, 102, 0.15);
}
.date-range-icon {
  display: inline-flex;
  color: var(--secondary);
  flex-shrink: 0;
}
.date-range-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.date-range-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.date-range-input {
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text);
  padding: 4px 2px;
  cursor: pointer;
}
.date-range-input:focus { outline: none; }
.date-range-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.55;
  filter: invert(22%) sepia(36%) saturate(1500%) hue-rotate(165deg);
}
.date-range-sep { color: var(--text-muted); font-size: 0.95rem; }

.field-help { font-size: 0.8125rem; color: var(--text-muted); margin: 4px 0 16px; line-height: 1.5; }
.field-hint { font-size: 0.8125rem; color: var(--text-muted); margin: 8px 0 0; line-height: 1.45; }

/* Upload de imagem */
.upload-row { display: flex; gap: 16px; align-items: flex-start; }
.upload-preview {
  width: 110px; height: 72px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-alt);
}
.upload-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.upload-status { font-size: 0.8125rem; color: var(--text-muted); }
.upload-status--ok    { color: var(--success); font-weight: 600; }
.upload-status--error { color: var(--error); font-weight: 600; }

/* Árvore de permissões (grupos) */
.perm-tree {
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; margin-top: 6px;
}
.perm-tab { padding: 6px 0; border-bottom: 1px solid var(--border); }
.perm-tab:last-child { border-bottom: none; }
.perm-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem; cursor: pointer; padding: 3px 0;
}
.perm-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.perm-row--tab { font-size: 0.9375rem; }
.perm-children { margin-left: 24px; }
.perm-children--cards { margin-left: 22px; }
.perm-row--card { font-size: 0.8125rem; color: var(--text-muted); }
.perm-empty { display: block; margin-left: 24px; font-size: 0.75rem; color: var(--text-muted); font-style: italic; padding: 2px 0; }

/* Tabelas de catálogo (Marcas + Subcategorias) — colunas alinhadas entre si */
.catalog-table { table-layout: fixed; }
.catalog-table th:nth-child(1), .catalog-table td:nth-child(1) { width: 26%; }   /* Nome */
.catalog-table th:nth-child(2), .catalog-table td:nth-child(2) { width: 8%; }    /* Ordem */
.catalog-table th:nth-child(3), .catalog-table td:nth-child(3) { width: 12%; }   /* Contagem */
.catalog-table th:nth-child(4), .catalog-table td:nth-child(4) { width: 11%; }   /* Status */
.catalog-table th:nth-child(5), .catalog-table td:nth-child(5) { width: 13%; }   /* Criado em */
.catalog-table th:nth-child(6), .catalog-table td:nth-child(6) { width: 13%; }   /* Atualizado em */
.catalog-table th:nth-child(7), .catalog-table td:nth-child(7) { width: 17%; }   /* Ações */
.catalog-table td:nth-child(1) { overflow: hidden; text-overflow: ellipsis; }

/* Hierarquia de subcategorias */
.hier-block { margin-bottom: 24px; }
.hier-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.hier-title { font-size: 1rem; font-weight: 700; color: var(--secondary); }

/* ── Modal de confirmação (perigo) ──────────────────────── */
.modal--danger { border: 2px solid var(--error); max-width: 480px; }
.modal-header--danger {
  background: var(--error);
  color: #fff;
  padding: 16px 24px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-bottom: 4px;
  animation: danger-pulse 1.6s ease-in-out infinite;
}
.modal-header--danger .modal-title { color: #fff; font-size: 1.1875rem; }
@keyframes danger-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.0); }
  50%      { box-shadow: 0 0 0 4px rgba(220,38,38,0.25); }
}
.confirm-message { font-size: 0.9375rem; color: var(--text); margin-bottom: 14px; }
.confirm-details {
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px;
}
.confirm-detail-row { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: 0.875rem; }
.confirm-detail-row + .confirm-detail-row { border-top: 1px dashed #fecaca; }
.confirm-detail-key { color: #991b1b; font-weight: 600; }
.confirm-detail-val { color: var(--text); text-align: right; word-break: break-word; }
.confirm-warning { font-size: 0.875rem; color: var(--error); font-weight: 600; }
.modal--danger .btn-danger { min-width: 140px; }

@media (max-width: 640px) {
  input.filter-input[type="search"] { max-width: none; }
  .filters-bar { gap: 8px; }
  .upload-preview { width: 88px; height: 58px; }
}

/* ── Lista de afetados (cascata) no modal de confirmação ── */
.confirm-affected {
  background: #fff7ed; border: 1px solid #fed7aa;
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px;
  max-height: 200px; overflow-y: auto;
}
.confirm-affected-title { font-size: 0.8125rem; font-weight: 700; color: #9a3412; margin-bottom: 6px; }
.confirm-affected-list { margin: 0; padding-left: 18px; }
.confirm-affected-list li { font-size: 0.8125rem; color: var(--text); padding: 1px 0; }

/* ── Toasts (canto inferior direito) ────────────────────── */
.toast-container {
  position: fixed; right: 20px; bottom: 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 2000; max-width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--text); color: #fff;
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500; line-height: 1.4;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--secondary);
  opacity: 0; transform: translateX(40px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.toast--in  { opacity: 1; transform: translateX(0); }
.toast--out { opacity: 0; transform: translateX(40px); }
.toast--success { border-left-color: var(--success); }
.toast--error   { border-left-color: var(--error); }
.toast--info    { border-left-color: var(--secondary); }

/* ── Heranças inativas / linhas desativadas ─────────────── */
.row-off td { opacity: 0.6; }
.row-inherited-off td { background: #fff7ed; }
.inherit-badge {
  display: inline-block; margin-left: 8px;
  font-size: 0.6875rem; font-weight: 600;
  color: #9a3412; background: #ffedd5;
  padding: 1px 7px; border-radius: 99px;
  vertical-align: middle;
}

/* Indeterminate nas caixas de permissão */
.perm-row input[type="checkbox"]:indeterminate { accent-color: var(--secondary); }

/* ── Toast de alerta (amarelo) ──────────────────────────── */
.toast--warning { border-left-color: var(--warning); }

/* ── Arrastar para reordenar ────────────────────────────── */
.drag-handle {
  display: inline-block; margin-right: 10px;
  color: var(--text-muted); cursor: grab;
  font-size: 1rem; line-height: 1; user-select: none;
  vertical-align: middle;
}
tr[data-id] { cursor: default; }
tr.dragging { opacity: 0.45; background: var(--bg-alt); }
tr.drag-over td { box-shadow: inset 0 2px 0 0 var(--primary); }
.order-num { font-weight: 600; color: var(--text); }

/* ── Conta própria (usuários) ───────────────────────────── */
.row-me td { background: rgba(7,72,102,0.05); }
.me-tag {
  display: block; width: fit-content; margin-top: 5px;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em;
  color: #fff; background: var(--secondary);
  padding: 1px 8px; border-radius: 99px; text-transform: uppercase;
}
.inherit-badge--info { color: var(--secondary); background: rgba(7,72,102,0.12); }

/* ── Botões de ação (Editar largo + lixeira) ────────────── */
.row-actions { display: flex; gap: 10px; align-items: center; }
.btn-edit {
  min-height: 36px; min-width: 104px;
  padding: 6px 24px; font-size: 0.8125rem; font-weight: 600;
}
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; min-height: 36px; padding: 0;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  flex: 0 0 auto;
  transition: background var(--transition), transform var(--transition);
}
.btn-icon:active { transform: scale(0.94); }
.btn-icon-danger { background: var(--error); color: #fff; }
.btn-icon-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-icon-danger:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-icon-neutral { background: rgba(7,72,102,0.1); color: var(--secondary); }
.btn-icon-neutral:hover:not(:disabled) { background: rgba(7,72,102,0.2); }

/* ── Checkbox em linha (modais) ─────────────────────────── */
.field label.checkbox-row {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-weight: 500; margin-bottom: 0;
}
.field .checkbox-row input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   FAQ — botão de ajuda no hero + página de Dúvidas Frequentes
═══════════════════════════════════════════════════════════ */

/* Coluna de resposta (prévia) na tabela de FAQ do admin */
.td-faq-answer { color: var(--text-muted); font-size: 0.85rem; max-width: 380px; }

/* Botão "?" com expansão suave revelando "Dúvidas Frequentes" (no hero laranja) */
.hero__help {
  display: inline-flex; align-items: center;
  height: 40px; max-width: 40px; border-radius: 999px;
  background: rgba(255,255,255,0.16);
  border: 1.5px solid rgba(255,255,255,0.6);
  color: #fff; text-decoration: none; flex: 0 0 auto;
  overflow: hidden;
  transition: max-width .5s cubic-bezier(.22,1,.36,1),
              background var(--transition), box-shadow var(--transition);
}
.hero__help-icon {
  flex: 0 0 38px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 800; line-height: 1;
}
.hero__help-label {
  white-space: nowrap; font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em;
  opacity: 0; transform: translateX(-6px);
  transition: opacity .35s ease, transform .45s cubic-bezier(.22,1,.36,1);
}
.hero__help:hover, .hero__help:focus-visible {
  max-width: 280px; text-decoration: none;
  background: rgba(255,255,255,0.28);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.22);
}
.hero__help:hover .hero__help-label,
.hero__help:focus-visible .hero__help-label { opacity: 1; transform: none; padding-right: 18px; }
.hero__help:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Indicador de administrador dentro do overlay de perfil (substitui a tag "Admin") */
.profile-dropdown-head {
  padding: 12px 16px; background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.profile-dropdown-head .profile-dropdown-name {
  padding: 0; background: none; border: none;
}
.profile-dropdown-role {
  display: inline-block; margin-top: 7px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--primary); color: #fff;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}

/* ── Página FAQ ──────────────────────────────────────────── */
.faq-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-alt);
}
.faq-topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 16px 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  animation: faq-fade-down .5s ease both;
  position: sticky;
  top: 0;
  z-index: 900;
}
/* Botão "Voltar" no fundo claro do FAQ: laranja da marca (o estilo base é p/ header escuro) */
.faq-topbar .btn-back {
  justify-self: start;
  color: var(--primary);
  background: transparent;
  border: 1.5px solid var(--primary);
}
.faq-topbar .btn-back:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.faq-topbar__logo { height: 38px; width: auto; justify-self: center; }
.faq-topbar__spacer { justify-self: end; }
.faq-topbar .profile-widget { justify-self: end; }
/* A topbar da FAQ tem fundo claro: o avatar branco padrão somia. Usa laranja da marca. */
.faq-topbar .profile-avatar {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.faq-topbar .profile-avatar:hover { box-shadow: 0 0 0 3px rgba(224,94,59,0.30); }
.faq-topbar .profile-avatar:focus-visible { outline-color: var(--primary); }

.faq-main {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}
.faq-title {
  text-align: center;
  color: var(--secondary);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  animation: faq-fade-up .55s cubic-bezier(.22,1,.36,1) both;
}

/* Bloco branco único que envolve as perguntas (inspirado no card de login) */
.faq-list {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
  padding: 40px;
}
.faq-loading, .faq-empty {
  text-align: center; color: var(--text-muted);
  font-size: 0.95rem; padding: 24px 0;
}

/* Animações de entrada (fluidas) */
@keyframes faq-fade-up   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes faq-fade-down { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

.faq-item {
  background: transparent;
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.faq-item--enter { opacity: 0; animation: faq-fade-up .5s cubic-bezier(.22,1,.36,1) forwards; }

.faq-question {
  width: 100%;
  display: flex; align-items: center; justify-content: flex-start; gap: 14px;
  padding: 20px 24px;
  background: var(--bg-alt); border: none;
  font-family: var(--font);
  font-size: 1.0625rem; font-weight: 600;
  color: var(--secondary);
  text-align: left; cursor: pointer;
  border-radius: 16px;
  transition: border-radius var(--transition);
}
/* Seta dentro de um círculo laranja; a seta usa a cor do fundo da pergunta.
   Desenhada em CSS (borda) p/ centralização exata — o glifo "›" do HTML é ocultado. */
.faq-question__icon {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg-alt);
  font-size: 0;
  transition: background var(--transition), color var(--transition);
}
.faq-question__icon::before {
  content: "";
  width: 8px; height: 8px;
  border-top: 2.5px solid currentColor;
  border-right: 2.5px solid currentColor;
  border-radius: 1px;
  /* aponta p/ direita; translate em -X recentra a ponta no círculo */
  transform: translateX(-1px) rotate(45deg);
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}
.faq-item.open .faq-question { border-radius: 16px 16px 0 0; }
/* Aberta: círculo branco e seta azul, apontando p/ baixo */
.faq-item.open .faq-question__icon {
  background: var(--bg);
  color: var(--secondary);
}
.faq-item.open .faq-question__icon::before {
  transform: translateY(-1px) rotate(135deg);
}
.faq-question__text { flex: 1 1 auto; }

/* Abertura/fechamento fluido via grid-template-rows (0fr → 1fr) */
.faq-answer {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .42s cubic-bezier(.22,1,.36,1);
}
.faq-item.open .faq-answer { grid-template-rows: 1fr; }
.faq-answer__inner { overflow: hidden; min-height: 0; }
.faq-answer__content {
  padding: 18px 24px;
  border: none;
  background: var(--bg);
  color: var(--secondary);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.65;
  border-radius: 0 0 16px 16px;
}
.faq-answer__content a { color: var(--primary); font-weight: 600; text-decoration: underline; word-break: break-word; }

/* ── Bloco "Para mais dúvidas" ───────────────────────────── */
.faq-contact {
  text-align: center;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  animation: faq-fade-up .55s cubic-bezier(.22,1,.36,1) .15s both;
}
.faq-contact__title { color: var(--secondary); font-size: 1.25rem; font-weight: 700; margin-bottom: 10px; }
.faq-contact__text { color: var(--secondary); font-size: 0.95rem; margin-bottom: 22px; }
.faq-contact__text a { color: var(--secondary); font-weight: 600; text-decoration: underline; }
.faq-contact__btn {
  display: inline-block;
  background: var(--secondary); color: #fff;
  padding: 13px 28px; border-radius: 999px;
  font-size: 0.95rem; font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}
.faq-contact__btn:hover { background: var(--secondary-dark); text-decoration: none; transform: translateY(-2px); }
.faq-contact__btn:active { transform: translateY(0) scale(0.98); }

@media (max-width: 600px) {
  .faq-topbar { padding: 14px 18px; }
  .faq-topbar__logo { height: 28px; }
  .faq-main { padding: 32px 16px 48px; }
  .faq-title { font-size: 1.75rem; margin-bottom: 28px; }
  .faq-question { padding: 18px 18px; font-size: 1rem; }
  .faq-answer__content { padding: 16px 18px; }
}

/* ── Cabeçalho de seção: botão "novo" compacto, sem quebrar título ── */
.admin-section-header { flex-wrap: wrap; gap: 12px; }
.admin-section-header h2 { flex: 1 1 auto; min-width: 0; }
.admin-section-header .btn {
  flex: 0 0 auto; white-space: nowrap;
  padding: 6px 12px; font-size: 0.8125rem; min-height: 32px; width: auto;
}

/* ═══════════════════════════════════════════════════════════
   USO DO SITE (Analytics) — KPIs, gráficos e tabelas
═══════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.kpi-card--wide { grid-column: span 2; }
.kpi-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.kpi-value { font-size: 1.75rem; font-weight: 700; color: var(--secondary); line-height: 1.1; }
.kpi-value--sm { font-size: 1.05rem; }
.kpi-desc { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; margin-top: 2px; }

.chart-desc { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.45; margin: -8px 0 16px; }

.chart-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 24px;
}
.chart-title { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0 0 16px; }
.chart-box { position: relative; height: 300px; }

.analytics-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.analytics-cols .chart-box { height: 260px; }

.td-empty { text-align: center; color: var(--text-muted); padding: 20px; font-size: 0.875rem; }

@media (max-width: 640px) {
  .kpi-card--wide { grid-column: span 1; }
  .chart-box { height: 240px; }
}
