
/* ════════════════════════════════════════════════════════════
   OVERRIDE GLOBAL — Garante que Tailwind CDN não quebra
   inputs date/time e outros elementos do sistema
   ════════════════════════════════════════════════════════════ */

/* Calendário/Relógio — ícone SEMPRE branco no tema escuro */
*::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.65) !important;
    cursor: pointer !important;
    background: transparent !important;
}
*::-webkit-calendar-picker-indicator:hover {
    filter: invert(1) opacity(1) !important;
}

/* Color scheme escuro em TODOS os inputs do admin */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
    color-scheme: dark !important;
}

/* ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   DESIGN SYSTEM — Apple HIG / macOS Sequoia
   Igreja Casa Admin — v4.0

   BUGS CORRIGIDOS:
   1. Scroll freeze no desktop → min-height:0 cascade fix
   2. Sidebar mobile desalinhada → posicionamento via CSS
   3. Mobile feio → safe-area, 44pt targets, Apple font stack
   4. Imagens distorcidas → object-fit global
   5. Bottom nav mobile ausente → novo componente iOS-style
   ============================================================ */

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:              #000000;
  --surface:         #0a0a0a;
  --surface-2:       #111113;
  --surface-3:       #1c1c1e;
  --surface-hover:   rgba(255,255,255,0.04);
  --surface-active:  rgba(255,255,255,0.08);

  --border:          rgba(255,255,255,0.08);
  --border-hover:    rgba(255,255,255,0.18);
  --border-strong:   rgba(255,255,255,0.28);
  --separator:       rgba(255,255,255,0.06);

  --text-primary:    #f5f5f7;
  --text-secondary:  #86868b;
  --text-tertiary:   #3a3a3c;

  --accent:          #ffffff;
  --accent-hover:    #e8e8e8;

  /* Apple font stack exata */
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter',
          system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter',
                  system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;

  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-2xl: 28px;

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.5);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.5);

  /* iOS safe areas */
  --safe-top:    env(safe-area-inset-top,    0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left,   0px);
  --safe-right:  env(safe-area-inset-right,  0px);

  --bottom-nav-h: 50px;

  /* ─── v4.1 DESIGN TOKENS ────────────────────────────────── */
  /* Typography scale — melhora legibilidade (spec: corpo >=14px) */
  --fs-xs:     11px;
  --fs-sm:     12px;
  --fs-body:   14px;
  --fs-md:     15px;
  --fs-lg:     17px;
  --fs-xl:     20px;
  --fs-2xl:    24px;
  --fs-3xl:    30px;

  /* Spacing scale */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;

  /* Status colors — semânticas */
  --color-success:   #30D158;
  --color-warning:   #FF9F0A;
  --color-danger:    #FF453A;
  --color-info:      #0A84FF;
  --color-purple:    #BF5AF2;

  /* Transition tokens */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.15s;
  --duration-normal: 0.25s;
  --duration-slow: 0.35s;
}

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

/* ─── BUG FIX #1: SCROLL FREEZE NO DESKTOP ──────────────────
   Causa: cadeia flex sem min-height:0.
   Cada elemento flex na cadeia vertical PRECISA ter min-height:0
   para que o overflow:auto do filho funcione corretamente.
   Cadeia: html → body → #dashboard-view → #main-shell → #main-content-area
   ──────────────────────────────────────────────────────────── */
html {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  overflow: hidden;
  min-height: 0;  /* FIX: permite que filhos flex colapem */
}

#dashboard-view {
  min-height: 0 !important;  /* FIX CRÍTICO */
}

/* #main-shell é o ID adicionado no HTML para a coluna direita */
#main-shell {
  min-height: 0;          /* FIX CRÍTICO */
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  overflow: hidden;
}

#main-content-area {
  flex: 1 1 0;
  min-height: 0;          /* FIX CRÍTICO — sem isso overflow:auto não ativa */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Espaço para bottom nav no mobile */
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
}

@media (min-width: 1024px) {
  #main-content-area {
    padding-bottom: 32px;
  }
}

/* ─── TIPOGRAFIA ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.2;
  color: var(--text-primary);
}

.kpi-value {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  font-feature-settings: 'tnum';
}

/* ─── BUG FIX #2: SIDEBAR MOBILE ────────────────────────────
   O toggleSidebar() conflitava com classes Tailwind.
   Solução: CSS controla o estado via transform, não display.
   ──────────────────────────────────────────────────────────── */
aside#sidebar-menu {
  background: var(--surface) !important;
  border-right: 1px solid var(--separator) !important;
  flex-shrink: 0;
  overflow: hidden;  /* aside não scrolla — o nav interno sim */
}

@media (max-width: 1023px) {
  aside#sidebar-menu {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 260px !important;
    z-index: 50 !important;
    /* Estado default: oculto via transform */
    transform: translateX(-100%) !important;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1) !important;
    /* Garante que a sidebar é visível quando não está hidden */
    padding-top: max(20px, var(--safe-top)) !important;
    padding-bottom: max(16px, var(--safe-bottom)) !important;
    display: flex !important;  /* sempre flex; transform controla visibilidade */
  }

  /* Quando JS remove .hidden → sidebar desliza para dentro */
  aside#sidebar-menu:not(.hidden) {
    transform: translateX(0) !important;
  }
}

/* Label de seção no nav */
.nav-section-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-secondary);
  opacity: 0.45;
  display: block;
  user-select: none;
  pointer-events: none;
}

/* Ícone padrão do nav — SEMPRE o mesmo tamanho e margem */
.nav-icon {
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0;
  margin-right: 9px;
  opacity: 0.5;
  transition: opacity 0.1s;
}

/* Item de sidebar */
.sidebar-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 34px;           /* altura fixa — elimina variação vertical */
  padding: 0 10px !important;
  border-radius: var(--radius-sm);
  font-size: 13px !important;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  transition: background 0.1s ease, color 0.1s ease;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item span:not([id]) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item:hover {
  background: var(--surface-hover) !important;
  color: var(--text-primary) !important;
}
.sidebar-item:hover .nav-icon { opacity: 1; }

.sidebar-active {
  background: var(--surface-active) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}
.sidebar-active .nav-icon { opacity: 1; }

/* ─── HEADER ─────────────────────────────────────────────── */
header {
  background: rgba(0,0,0,0.78) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--separator) !important;
  padding-top: var(--safe-top);
  flex-shrink: 0;
}

/* ─── CARDS ──────────────────────────────────────────────── */
.glass-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.hover-card {
  transition: background 0.15s ease, border-color 0.15s ease,
              box-shadow 0.15s ease, transform 0.15s ease;
}
.hover-card:hover {
  background: rgba(255,255,255,0.033);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ─── BOTÕES ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  color: #000000 !important;
  font-size: 13px !important;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, var(--shadow-sm);
  transition: filter 0.12s, transform 0.12s, box-shadow 0.12s;
  cursor: pointer;
  min-height: 36px;
  padding: 0 14px;
}
.btn-primary * { color: #000000 !important; }
.btn-primary svg { stroke: #000000 !important; }
.btn-primary:hover { filter: brightness(0.92); transform: translateY(-0.5px); }
.btn-primary:active { transform: translateY(0); filter: brightness(0.85); }
.btn-primary:disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-3);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: background 0.1s, border-color 0.1s;
  cursor: pointer;
  min-height: 36px;
  padding: 0 12px;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--border-hover);
  color: #fff;
}
.btn-secondary:disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; }

/* ─── INPUTS ─────────────────────────────────────────────── */
.input-dark,
input[type="text"]:not(.input-code),
input[type="email"]:not(.input-code),
input[type="tel"]:not(.input-code),
input[type="number"]:not(.input-code),
input[type="password"]:not(.input-code),
input[type="url"]:not(.input-code),
input[type="date"]:not(.input-code),
input[type="time"]:not(.input-code),
textarea:not(.input-code) {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
  min-height: 38px;
  color-scheme: dark;
}

/* ── CALENDÁRIO / CLOCK — ícone SEMPRE branco, sobrevive ao Tailwind CDN ── */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.65) !important;
  cursor: pointer !important;
  background-color: transparent !important;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  filter: invert(1) opacity(1) !important;
}

/* Ícones Lucide — garante herança de cor e evita caixas pretas antes de renderizar */
i[data-lucide] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}
i[data-lucide] svg {
  stroke: currentColor;
  fill: none;
  width: 1em;
  height: 1em;
}
.input-dark:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.36);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}
.input-dark::placeholder,
input::placeholder,
textarea::placeholder { color: var(--text-tertiary); }

select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: border-color 0.12s;
  min-height: 38px;
}
select:focus {
  border-color: rgba(255,255,255,0.36);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}
select option { background: #1c1c1e; color: var(--text-primary); }

.input-code {
  font-family: var(--mono) !important;
  font-size: 12px !important;
  background: #0a0a0a !important;
  color: #a9b7c6 !important;
  line-height: 1.6;
  border: 1px solid rgba(255,255,255,0.05) !important;
}

/* ─── TABELAS ────────────────────────────────────────────── */
.overflow-x-auto {
  display: block !important;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  table-layout: auto;
}

th {
  font-size: 10.5px !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--separator);
  background: rgba(255,255,255,0.015);
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--separator);
  font-size: 13.5px;
  color: var(--text-primary);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none !important; }
tr:hover td { background: rgba(255,255,255,0.018); }

/* ─── BUG FIX #3: IMAGENS NUNCA DISTORCEM ───────────────────
   object-fit garante proporção correta em todo contexto.    */
img {
  display: block;
  max-width: 100%;
}

img[class*="rounded"],
img[class*="w-"][class*="h-"],
aside img {
  object-fit: cover;
}

/* ─── MAIN ───────────────────────────────────────────────── */
main { background: var(--bg) !important; }

/* ─── ANIMAÇÕES ──────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.25s ease-out both; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.animate-slide-up { animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
.animate-slide-left { animation: slideLeft 0.3s cubic-bezier(0.32, 0.72, 0, 1) both; }

@keyframes pop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.animate-pop { animation: pop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.animate-float      { animation: float 3s ease-in-out infinite; }
.animate-float-slow { animation: float 5s ease-in-out infinite; }

/* ─── ONLINE DOT ─────────────────────────────────────────── */
@keyframes pingGreen {
  0%   { transform: scale(1);   opacity: 0.8; }
  75%  { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}
.online-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.online-dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgb(52,211,153);
  animation: pingGreen 2s cubic-bezier(0,0,0.2,1) infinite;
}

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }
.scrollbar-hide { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ─── BUG FIX #4: MOBILE BOTTOM NAV — iOS Tab Bar ───────────
   Era referenciado no CSS mas NÃO existia no HTML.
   Agora o HTML também recebe o componente (ver index.html).  */
#mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-top: 1px solid var(--separator);
  z-index: 100;
  align-items: stretch;
  justify-content: space-around;
}

@media (max-width: 1023px) { #mobile-bottom-nav { display: flex; } }
@media (min-width: 1024px) { #mobile-bottom-nav { display: none !important; } }

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.1s ease;
  min-height: var(--bottom-nav-h);
  padding: 0 4px;
  position: relative;
}

.bottom-nav-btn svg,
.bottom-nav-btn i {
  width: 22px !important;
  height: 22px !important;
  flex-shrink: 0;
}

.bottom-nav-btn.active {
  color: #ffffff;
}

.bottom-nav-btn.active i {
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.35));
}

.bottom-nav-badge {
  position: absolute;
  top: 5px;
  left: calc(50% + 6px);
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1.5px solid #000;
}

/* ─── SETTINGS ───────────────────────────────────────────── */
.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 860px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .settings-layout { flex-direction: row; gap: 48px; align-items: flex-start; }
}

.settings-nav { width: 100%; flex-shrink: 0; }

@media (min-width: 1024px) {
  .settings-nav { width: 180px; position: sticky; top: 80px; }
}

.settings-nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  min-height: 36px;
}
.settings-nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.settings-nav-item.active {
  background: var(--surface-active);
  color: #fff;
  font-weight: 600;
}

.settings-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.settings-section {
  border-bottom: 1px solid var(--separator);
  padding: 24px 0;
}
.settings-section:first-child { padding-top: 0; }
.settings-section:last-child  { border-bottom: none; padding-bottom: 0; }

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.settings-field:last-child { border-bottom: none; }

@media (min-width: 640px) {
  .settings-field {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
  }
}

.settings-label-group { flex: 1; min-width: 0; }
.settings-label { font-size: 13.5px; font-weight: 500; color: var(--text-primary); display: block; margin-bottom: 2px; }
.settings-description { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.settings-input-group { width: 100%; flex-shrink: 0; }
@media (min-width: 640px) { .settings-input-group { width: 260px; } }

.settings-danger-zone {
  border: 1px solid rgba(239,68,68,0.18);
  border-radius: var(--radius-md);
  background: rgba(239,68,68,0.04);
  padding: 20px 24px;
}

/* ─── MODAIS — BOTTOM SHEET NO MOBILE ───────────────────── */
@media (max-width: 639px) {
  #person-form-modal,
  #user-modal,
  #ministry-modal {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  #person-form-modal > div,
  #user-modal > div,
  #ministry-modal > div {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-top: 24px !important;
    padding-bottom: max(24px, var(--safe-bottom)) !important;
    max-height: 94dvh;
  }
  #person-form-modal > div::before,
  #user-modal > div::before,
  #ministry-modal > div::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.2);
    margin: -12px auto 16px auto;
  }
}

/* ─── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green  { background: rgba(52,211,153,0.12);  color: #34d399; border: 1px solid rgba(52,211,153,0.2); }
.badge-blue   { background: rgba(96,165,250,0.12);  color: #60a5fa; border: 1px solid rgba(96,165,250,0.2); }
.badge-yellow { background: rgba(250,204,21,0.12);  color: #facc15; border: 1px solid rgba(250,204,21,0.2); }
.badge-red    { background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }
.badge-gray   { background: rgba(255,255,255,0.06); color: var(--text-secondary); border: 1px solid var(--border); }

/* ─── CHAT ───────────────────────────────────────────────── */
#chat-mensagens p { line-height: 1.55; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-4px); opacity: 1; }
}
#chat-typing .animate-bounce {
  animation: typing-bounce 1.2s ease-in-out infinite !important;
}

/* ─── TOASTS & BELL ──────────────────────────────────────── */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateY(-8px) scale(0.96); }
}
@keyframes bellPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.15); opacity: 0.8; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

/* ─── DOMUM ──────────────────────────────────────────────── */
#section-domum { min-height: 0; overflow: visible; }

#domum-tabs .domum-tab-btn {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
  min-height: 44px;
}

.domum-touch-target {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 639px) {
  #domum-modal-edicao,
  #domum-modal-pessoa,
  #domum-modal-dept {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  #domum-modal-edicao > div,
  #domum-modal-pessoa > div,
  #domum-modal-dept   > div {
    border-bottom-left-radius:  0 !important;
    border-bottom-right-radius: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-top: 20px !important;
    padding-bottom: max(20px, var(--safe-bottom)) !important;
  }
  #domum-modal-edicao > div::before,
  #domum-modal-pessoa > div::before,
  #domum-modal-dept   > div::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.2);
    margin: -12px auto 16px auto;
  }
}

@media (max-width: 767px) {
  .domum-table-desktop { display: none !important; }
  .domum-cards-mobile  { display: block !important; }
}
@media (min-width: 768px) {
  .domum-table-desktop { display: block !important; }
  .domum-cards-mobile  { display: none !important; }
}

.domum-servo-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.domum-servo-card:hover { box-shadow: var(--shadow-md); }

@keyframes domumCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#domum-edicao-selector > div > div {
  animation: domumCardIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}
#domum-edicao-selector > div > div:nth-child(2) { animation-delay: 0.05s; }
#domum-edicao-selector > div > div:nth-child(3) { animation-delay: 0.10s; }

@keyframes checkinPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
  50%       { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.12); }
}
.domum-checkin-done { animation: checkinPulse 1.5s ease-in-out 2; }

/* ─── RESPONSIVIDADE ─────────────────────────────────────── */
@media (max-width: 768px) {
  td, th { padding: 10px 12px !important; font-size: 12.5px !important; }
  h2     { font-size: 1.1rem !important; }
  .kpi-value { font-size: 1.65rem !important; }
  .settings-input-group { width: 100% !important; }

  header {
    padding-left:  max(16px, var(--safe-left));
    padding-right: max(16px, var(--safe-right));
  }
}


/* ─── KPI MOBILE ────────────────────────────────────────── */
@media (max-width: 639px) {
  #people-kpis {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  #people-kpis > div:first-child {
    grid-column: 1 / -1 !important;
    height: auto !important;
    min-height: 56px !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  #people-kpis > div:first-child h3 { font-size: 2rem !important; }
  #people-kpis > div:not(:first-child) {
    height: auto !important;
    min-height: 72px !important;
    padding: 12px !important;
  }
  #people-kpis > div:not(:first-child) h3 { font-size: 1.6rem !important; }
}

/* ─── ACESSIBILIDADE ─────────────────────────────────────── */
button:focus-visible,
a:focus-visible,
/* ─── ACESSIBILIDADE ─────────────────────────────────────── */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(255,255,255,0.4);
  outline-offset: 2px;
}
button:focus:not(:focus-visible) { outline: none; }

::selection { background: rgba(255,255,255,0.15); color: #fff; }
button, a { -webkit-tap-highlight-color: transparent; }

input:-webkit-autofill,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px #111113 inset;
}

button:disabled, input:disabled, select:disabled, textarea:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* ─── UTILITÁRIOS ────────────────────────────────────────── */
.divider-line { border: none; border-top: 1px solid var(--border); margin: 0; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-gradient {
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.65) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.safe-area-pb { padding-bottom: max(20px, var(--safe-bottom)); }
.safe-area-pt { padding-top: max(0px, var(--safe-top)); }

/* ============================================================
   PEOPLE LIST — Responsivo
   Mobile: cards empilhados com todas as infos visíveis
   Desktop (≥768px): linhas compactas em grid
   Sem scroll horizontal em nenhum tamanho de tela
   ============================================================ */

/* ── CARD DE PESSOA (layout padrão em todos os tamanhos) ──── */
.person-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--separator);
  transition: background 0.1s;
  cursor: pointer;
  min-width: 0;
}
.person-card:last-child { border-bottom: none; }
.person-card:hover      { background: var(--surface-hover); }
.person-card:active     { background: var(--surface-active); }

/* Avatar */
.person-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1c1c1e, #000);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  transition: transform 0.15s;
}
.person-card:hover .person-avatar { transform: scale(1.06); }

/* Bloco principal — cresce e corta */
.person-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.person-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}
.person-sub {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badges inline */
.person-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.person-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 100px;
  border: 1px solid;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-tipo {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
}
.badge-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid;
}

/* Ações — sempre visíveis, sem precisar scrollar */
.person-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.btn-ver-perfil {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
}
.btn-ver-perfil:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.5);
}
.btn-icon-sm {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-icon-sm:hover { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-icon-sm.danger { border-color: rgba(239,68,68,0.25); color: rgba(239,68,68,0.6); }
.btn-icon-sm.danger:hover { background: rgba(239,68,68,0.15); color: #f87171; border-color: rgba(239,68,68,0.5); }

/* ── MOBILE (< 640px): card compacto com tudo visível ─────── */
@media (max-width: 639px) {
  .person-card { padding: 12px 14px; gap: 10px; }
  .person-avatar { width: 36px; height: 36px; min-width: 36px; font-size: 13px; }
  .btn-ver-perfil { padding: 6px 10px; font-size: 11px; }
}

/* ── DESKTOP (≥ 640px): linha mais densa, meta-info lateral ── */
@media (min-width: 640px) {
  .person-card { padding: 10px 20px; gap: 14px; }
  .person-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
  }
  .person-meta-item {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 80px;
  }
  .person-meta-item.wide { min-width: 110px; }
}

/* Header da lista (só desktop) */
.people-list-header {
  display: none;
}
@media (min-width: 640px) {
  .people-list-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--separator);
  }
  .people-list-header span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
  }
  .people-list-header .col-name  { flex: 1; min-width: 0; padding-left: 54px; }
  .people-list-header .col-meta  { display: flex; gap: 12px; flex-shrink: 0; }
  .people-list-header .col-meta span { min-width: 80px; }
  .people-list-header .col-meta span.wide { min-width: 110px; }
  .people-list-header .col-action { min-width: 90px; text-align: right; flex-shrink: 0; }
}

/* Inativo — opacidade no avatar */
.person-card.inactive .person-avatar { opacity: 0.35; }

/* ── MOBILE: card limpo — menos ruído visual ─────────────────
   Filosofia: no mobile o card exibe SOMENTE o essencial.
   Nome + contato + 1 badge de status.
   Meta-info fica dentro do perfil. Reduz de 6-8 chips para 1.
   ──────────────────────────────────────────────────────────── */
.person-meta          { display: none; }
.sm-only-badges       { display: flex; }

/* No mobile: oculta tipo, origem e tags — mantém SOMENTE status */
.sm-only-badges .badge-tipo,
.sm-only-badges .badge-overflow-trigger,
.sm-only-badges .person-badge { display: none !important; }
.sm-only-badges .badge-status { display: inline-flex !important; }

/* Mobile: card com mais respiro */
@media (max-width: 639px) {
  .person-card        { padding: 14px 16px; gap: 12px; }
  .person-avatar      { width: 42px; height: 42px; min-width: 42px; font-size: 16px; background: linear-gradient(135deg, #1e1e22, #0a0a0a); }
  .person-name        { font-size: 15px !important; letter-spacing: -0.015em; }
  .person-sub         { font-size: 13px !important; margin-top: 1px; }
  .person-badges.sm-only-badges { margin-top: 4px; }
  .btn-ver-perfil     { padding: 7px 12px; font-size: 12px; border-radius: 10px; }
  .btn-icon-sm        { width: 32px; height: 32px; }
}

/* Desktop ≥640px: mostra meta, esconde badges inline */
@media (min-width: 640px) {
  .person-meta        { display: flex; }
  .sm-only-badges     { display: none; }
}

/* ============================================================
   v4.1 — UI/UX REDESIGN STYLES
   - Badge overflow (+N) com tooltip
   - Legibilidade melhorada
   - Acessibilidade (WCAG 2.1 AA)
   - Micro-interações
   - prefer-reduced-motion fallback
   - Profile drawer lateral
   - Keyboard navigation
   ============================================================ */

/* ─── BADGE OVERFLOW (+N) ─────────────────────────────────── */
.badges-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  min-width: 0;
}
.badge-overflow-trigger {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: background var(--duration-fast), border-color var(--duration-fast);
  flex-shrink: 0;
}
.badge-overflow-trigger:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.35);
  color: var(--text-primary);
}

/* Tooltip com lista completa de badges */
.badge-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28,28,30,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  min-width: 160px;
  max-width: 260px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 200;
  pointer-events: none;
}
.badge-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(28,28,30,0.97);
}
.badge-overflow-trigger:hover .badge-tooltip,
.badge-overflow-trigger:focus .badge-tooltip {
  display: block;
  animation: tooltipIn var(--duration-fast) var(--ease-out) both;
}
.badge-tooltip-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 11px;
  color: var(--text-primary);
  white-space: nowrap;
}
.badge-tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

@keyframes tooltipIn {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── LEGIBILIDADE v4.1 ──────────────────────────────────── */
.person-name {
  font-size: var(--fs-body) !important;   /* >=14px — spec */
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.person-sub {
  font-size: 13px !important;             /* email: 13-14px — spec */
  color: var(--text-secondary);
  opacity: 0.85;                          /* opacidade 70-85% — spec */
}

/* ─── VER PERFIL CTA (filled) ─────────────────────────────── */
.btn-ver-perfil {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, var(--shadow-sm);
  transition: filter var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
}
.btn-ver-perfil:hover {
  filter: brightness(0.92) !important;
  transform: translateY(-0.5px) !important;
  background: #ffffff !important;
  border-color: rgba(255,255,255,0.3) !important;
}
.btn-ver-perfil:active {
  transform: translateY(0) !important;
  filter: brightness(0.85) !important;
}
.btn-ver-perfil:focus-visible {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}

/* ─── KEYBOARD NAVIGATION ────────────────────────────────── */
.person-card:focus-visible {
  outline: 2px solid rgba(255,255,255,0.4);
  outline-offset: -2px;
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
}
.person-card[tabindex="0"] {
  position: relative;
}

/* Skip-to-content link */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 99999;
  background: #ffffff;
  color: #000;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  transition: top 0.2s;
}
.skip-link:focus {
  top: 16px;
}


/* ─── ACESSIBILIDADE — ARIA e CONTRASTE ──────────────────── */
/* Contraste mínimo 4.5:1 para texto sobre fundo escuro */
.contrast-check {
  color: #f5f5f7;  /* branco sobre #000 = 19.3:1 ✓ */
}

/* Botões disabled com tooltip */
.btn-disabled-tooltip {
  position: relative;
  cursor: not-allowed;
  opacity: 0.38;
}
.btn-disabled-tooltip::after {
  content: attr(data-tooltip);
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28,28,30,0.95);
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 100;
  pointer-events: none;
}
.btn-disabled-tooltip:hover::after,
.btn-disabled-tooltip:focus::after {
  display: block;
}

/* ─── PREFER-REDUCED-MOTION ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-left,
  .animate-pop,
  .animate-float,
  .animate-float-slow {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .person-card:hover .person-avatar {
    transform: none !important;
  }
  .hover-card:hover {
    transform: none !important;
  }
}

/* ─── PERSON CARD v4.1 — micro-interações refinadas ──────── */
.person-card {
  transition: background var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
}
.person-card:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Card compacto / expandido via classe */
.person-card--compact {
  padding: 8px 16px !important;
  gap: 10px !important;
}
.person-card--compact .person-avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  font-size: 12px !important;
}
.person-card--compact .person-name {
  font-size: 13px !important;
}

/* Loading skeleton */
.person-card--loading {
  pointer-events: none;
}
.person-card--loading .skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
}
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── PROFILE DRAWER (lateral no desktop) ─────────────────── */
#person-profile-modal {
  transition: opacity var(--duration-normal) ease;
}
#person-profile-modal .profile-drawer {
  transition: transform var(--duration-slow) var(--ease-out);
}

@media (min-width: 1024px) {
  #person-profile-modal .profile-drawer {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(640px, 50vw);
    max-width: 100%;
    transform: translateX(100%);
    border-left: 1px solid var(--border);
    box-shadow: -20px 0 60px rgba(0,0,0,0.4);
  }
  #person-profile-modal:not(.hidden) .profile-drawer {
    transform: translateX(0);
  }
}

/* ─── FILTER BAR — melhor UX mobile ──────────────────────── */
@media (max-width: 1023px) {
  .filter-bar-scrollable {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }
  .filter-bar-scrollable::-webkit-scrollbar { display: none; }
  .filter-bar-scrollable select,
  .filter-bar-scrollable input[type="date"] {
    flex-shrink: 0;
    min-width: 112px;
    max-width: 140px;
    scroll-snap-align: start;
  }
}

/* ─── KPI CARDS — animação de entrada escalonada ─────────── */
.kpi-animate-in > * {
  opacity: 0;
  transform: translateY(8px);
  animation: kpiCardIn 0.3s var(--ease-out) forwards;
}
.kpi-animate-in > *:nth-child(1) { animation-delay: 0.00s; }
.kpi-animate-in > *:nth-child(2) { animation-delay: 0.05s; }
.kpi-animate-in > *:nth-child(3) { animation-delay: 0.10s; }
.kpi-animate-in > *:nth-child(4) { animation-delay: 0.15s; }
.kpi-animate-in > *:nth-child(5) { animation-delay: 0.20s; }

@keyframes kpiCardIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── EMPTY STATE — mais polido ──────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}
.empty-state-icon {
  width: 48px;
  height: 48px;
  color: rgba(255,255,255,0.06);
}
.empty-state-text {
  font-size: var(--fs-body);
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.5;
}
.empty-state-action {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--duration-fast);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.empty-state-action:hover {
  color: var(--text-primary);
}

/* ─── STAGGER ANIMATION para lista de cards ──────────────── */
.person-card {
  opacity: 0;
  animation: personCardIn 0.2s var(--ease-out) forwards;
}
.person-card:nth-child(1)  { animation-delay: 0s; }
.person-card:nth-child(2)  { animation-delay: 0.02s; }
.person-card:nth-child(3)  { animation-delay: 0.04s; }
.person-card:nth-child(4)  { animation-delay: 0.06s; }
.person-card:nth-child(5)  { animation-delay: 0.08s; }
.person-card:nth-child(6)  { animation-delay: 0.10s; }
.person-card:nth-child(7)  { animation-delay: 0.12s; }
.person-card:nth-child(8)  { animation-delay: 0.14s; }
.person-card:nth-child(9)  { animation-delay: 0.16s; }
.person-card:nth-child(10) { animation-delay: 0.18s; }
.person-card:nth-child(n+11) { animation-delay: 0.2s; }

/* O header da lista NÃO recebe animação de stagger */
.people-list-header {
  opacity: 1 !important;
  animation: none !important;
}

@keyframes personCardIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── PROFILE TAB INDICATOR — barra animada ──────────────── */
.profile-tab-btn {
  position: relative;
  transition: color var(--duration-fast);
}
.profile-tab-btn.tab-active {
  color: #fff !important;
}
.profile-tab-btn.tab-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #fff;
  border-radius: 2px 2px 0 0;
  animation: tabIndicator var(--duration-fast) var(--ease-out) both;
}
@keyframes tabIndicator {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ─── TOOLTIP GENÉRICO ───────────────────────────────────── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28,28,30,0.95);
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 100;
  pointer-events: none;
  animation: tooltipIn var(--duration-fast) var(--ease-out) both;
}


/* ══════════════════════════════════════════════════════════════
   MICRO-INTERACTIONS v5 — polimento UX completo
   Igreja Casa Admin — refinamentos baseados em Apple HIG + Material 3
   ══════════════════════════════════════════════════════════════ */

/* ─── KEYFRAMES AUSENTES ──────────────────────────────────────
   tooltipIn: referenciado em [data-tooltip]:hover::before
   bellPulse:  referenciado no badge da campainha
   ──────────────────────────────────────────────────────────── */
@keyframes tooltipIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(4px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes bellPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(1.6); }
}

/* ─── SIDEBAR: INDICADOR LATERAL DE ITEM ATIVO ───────────────
   Barra branca 3px à esquerda, animada — estilo macOS Finder / VSCode
   ──────────────────────────────────────────────────────────── */
.sidebar-active {
  position: relative;
}
.sidebar-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  background: #ffffff;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(255,255,255,0.4);
  animation: sidebarBarIn var(--duration-fast) var(--ease-spring) both;
}
@keyframes sidebarBarIn {
  from { height: 0; opacity: 0; }
  to   { height: 14px; opacity: 1; }
}

/* ─── SIDEBAR: ícone com brilho leve no item ativo e hover ── */
.sidebar-active .nav-icon {
  opacity: 1 !important;
  filter: drop-shadow(0 0 5px rgba(255,255,255,0.2));
}
.sidebar-item:hover .nav-icon {
  filter: drop-shadow(0 0 3px rgba(255,255,255,0.1));
}

/* Shimmer sutil ao hover — cria profundidade */
.sidebar-item {
  position: relative;
  isolation: isolate;
}
.sidebar-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent 60%,
    rgba(255,255,255,0.025) 100%
  );
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
  pointer-events: none;
}
.sidebar-item:hover::after { opacity: 1; }

/* ─── BOTTOM NAV: pill animado acima do ícone ativo ─────────
   Padrão iOS tab bar (iOS 18)
   ──────────────────────────────────────────────────────────── */
.bottom-nav-btn {
  transition: color var(--duration-fast) ease,
              transform 0.12s var(--ease-spring);
  position: relative;
}
.bottom-nav-btn:active {
  transform: scale(0.85);
}
.bottom-nav-btn.active::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: #ffffff;
  border-radius: 99px;
  box-shadow: 0 0 8px rgba(255,255,255,0.45);
  animation: navPillIn var(--duration-normal) var(--ease-spring) both;
}
@keyframes navPillIn {
  from { width: 0; opacity: 0; }
  to   { width: 24px; opacity: 1; }
}

/* ─── SEÇÃO: animação de entrada ao trocar de aba ────────────
   Substitui animate-slide-up — reinicia corretamente via JS
   ──────────────────────────────────────────────────────────── */
.section-animate {
  animation: sectionEnter var(--duration-normal) var(--ease-out) both;
}
@keyframes sectionEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── FOCUS VISIBLE: acessibilidade via teclado ─────────────*/
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}
.sidebar-item:focus-visible {
  outline: 2px solid rgba(255,255,255,0.28);
  outline-offset: -2px;
  background: var(--surface-hover) !important;
}
.bottom-nav-btn:focus-visible {
  outline: 2px solid rgba(255,255,255,0.35);
  outline-offset: 2px;
}

/* ─── BTN SECONDARY: estado active mais responsivo ──────────*/
.btn-secondary:active {
  transform: scale(0.97);
  background: rgba(255,255,255,0.04);
  transition-duration: 0.07s;
}

/* ─── BADGE POP: quando nova notificação aparece ─────────────*/
@keyframes badgePop {
  0%   { transform: scale(0); }
  65%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.badge-pop {
  animation: badgePop 0.3s var(--ease-spring) both;
}

/* ─── HEADER: shadow ao fazer scroll no conteúdo ─────────────*/
header {
  transition: box-shadow var(--duration-fast) ease !important;
}
.header-scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,0.45) !important;
}

/* ─── INPUT: micro-animação de foco ─────────────────────────*/
.input-dark,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea {
  transition: border-color 0.14s ease,
              background   0.14s ease,
              box-shadow   0.18s ease !important;
}

/* ─── TABLE ROW: hover com translate sutil ───────────────────*/
tr:hover td {
  background: rgba(255,255,255,0.022) !important;
  transition: background 0.1s ease;
}

/* ─── MODAL OVERLAY: scroll-lock visual ─────────────────────*/
body.modal-open {
  overflow: hidden;
}

/* ─── LOGOUT BTN: hover red semântico via CSS ────────────────*/
#sidebar-footer-logout:hover {
  background: rgba(255,59,48,0.08) !important;
  color: #ff453a !important;
}
#sidebar-footer-logout:hover .nav-icon {
  filter: drop-shadow(0 0 4px rgba(255,59,48,0.4));
}

/* ─── SCROLL SMOOTH na área principal ───────────────────────*/
#main-content-area {
  scroll-behavior: smooth;
}

/* ─── CARD HOVER: elevar mais o box-shadow ───────────────────*/
.hover-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.45),
              0 1px 0 rgba(255,255,255,0.04) inset !important;
}
