/* =============================================================================
   CLUBE CAMPESTRE - DESIGN SYSTEM (EMERALD EDITION)
   ============================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color Tokens - Emerald Theme */
  --color-primary-50: #ecfdf5;
  --color-primary-100: #d1fae5;
  --color-primary-500: #10b981;
  --color-primary-600: #059669;
  --color-primary-700: #047857;
  --color-primary-900: #064e3b;
  
  /* Neutral Tokens - Slate */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --border-color: #e2e8f0;
  
  --text-main: #334155;
  --text-muted: #64748b;
  --text-dark: #0f172a;
  --text-white: #ffffff;

  /* Elevational Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Scaffolding */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--text-white);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.2s ease;
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-700));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.sidebar-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: var(--color-primary-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-menu {
  padding: 1.25rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.menu-group-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0 0.75rem 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.nav-link.active {
  background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-700));
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.nav-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  flex-shrink: 0;
}

/* Main Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 70px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--color-primary-600);
}

.breadcrumbs .current {
  color: var(--text-dark);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem;
  background-color: var(--bg-page);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-600);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
}

.btn-logout {
  color: #ef4444;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}

.btn-logout:hover {
  background-color: #fef2f2;
}

.content-area {
  padding: 2rem;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* UI Components & Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 0.25rem;
}

.kpi-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-box.emerald {
  background-color: var(--color-primary-50);
  color: var(--color-primary-600);
}

.kpi-icon-box.amber {
  background-color: #fffbeb;
  color: #d97706;
}

.kpi-icon-box.red {
  background-color: #fef2f2;
  color: #ef4444;
}

.kpi-icon-box.blue {
  background-color: #f0f9ff;
  color: #0284c7;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--color-primary-600);
  color: white;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.btn-primary:hover {
  background-color: var(--color-primary-700);
}

.btn-secondary {
  background-color: white;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: var(--bg-page);
  border-color: #cbd5e1;
}

.btn-danger {
  background-color: #ef4444;
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
  vertical-align: middle;
}

.table tbody tr {
  transition: background 0.15s;
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background-color: #d1fae5;
  color: #047857;
}

.badge-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}

.badge-warning {
  background-color: #fef3c7;
  color: #b45309;
}

.badge-info {
  background-color: #e0f2fe;
  color: #0369a1;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.375rem;
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.875rem;
  color: var(--text-dark);
  background-color: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--color-primary-600);
}

.tab-btn.active {
  border-bottom-color: var(--color-primary-600);
  color: var(--color-primary-600);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Avatar Circle */
.member-avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--color-primary-500);
  box-shadow: var(--shadow-md);
}

.member-avatar-sm {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 1px solid var(--border-color);
}

/* Flash Messages */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.alert-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

/* Aviso: algo ficou pendente (ex.: boleto ainda pagável no banco). Não é erro,
   mas não pode passar despercebido. #92400e sobre #fffbeb ≈ 7:1. */
.alert-warning {
  background-color: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}

/* Informação neutra. #1e40af sobre #eff6ff ≈ 8:1. */
.alert-info {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

/* =============================================================================
   CONFERÊNCIA COM O SICREDI — faixa de saúde e pendências
   A cor diz se dá para confiar no que a tela mostra: verde = conferido há
   pouco; âmbar = atrasado; vermelho = parado. Verde nunca é decoração.
   ============================================================================= */
.saude-sicredi {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}
.saude-sicredi.nivel-atencao { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.saude-sicredi.nivel-alerta  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.saude-sicredi .saude-texto { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; }
.saude-sicredi .saude-texto strong { font-weight: 700; }
.saude-sicredi .saude-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.saude-sicredi form { margin: 0; }
.saude-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid currentColor;
  color: inherit;
  transition: background-color 160ms cubic-bezier(.2,.7,.3,1);
}
.saude-chip:hover { background: rgba(255, 255, 255, 0.6); }
.saude-chip:focus-visible, .btn-atualizar-sicredi:focus-visible { outline: 2px solid #0a6480; outline-offset: 2px; }
.btn-atualizar-sicredi {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid #0a6480;
  background: #0a6480;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 160ms cubic-bezier(.2,.7,.3,1), opacity 160ms cubic-bezier(.2,.7,.3,1);
}
.btn-atualizar-sicredi:hover { background: #08546b; }
.btn-atualizar-sicredi[disabled] { opacity: 0.65; cursor: progress; }

.pendencias-tabela td, .pendencias-tabela th { vertical-align: top; }
.pendencia-motivo { font-size: 0.8rem; color: #475569; max-width: 42ch; }
.selo-baixa {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.selo-baixa.revisar, .selo-baixa.pendente { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.selo-baixa.solicitada { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.selo-baixa.falhou { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.selo-baixa.confirmada, .selo-baixa.ja_pago { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

@media (prefers-reduced-motion: reduce) {
  .saude-chip, .btn-atualizar-sicredi { transition: none; }
}

/* =============================================================================
   GRID ACTION BUTTONS — Sistema de botões Pill com ícone/emoji + texto (btn-pill)
   ============================================================================= */
.acoes-container {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.btn-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  text-decoration: none;
}

.btn-pill:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Variantes das Pills */
.pill-secondary { background-color: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.pill-secondary:hover { background-color: #e2e8f0; color: #334155; }

.pill-detalhes  { background-color: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.pill-detalhes:hover  { background-color: #e2e8f0; color: #0f172a; }

.pill-boleto    { background-color: #ffffff; color: #0284c7; border-color: #cbd5e1; }
.pill-boleto:hover    { background-color: #f0f9ff; border-color: #bae6fd; }

.pill-baixar    { background-color: #16a34a; color: #ffffff; border-color: #16a34a; }
.pill-baixar:hover    { background-color: #15803d; border-color: #15803d; color: #ffffff; }

.pill-regerar   { background-color: #f0f9ff; color: #0284c7; border-color: #bae6fd; }
.pill-regerar:hover   { background-color: #e0f2fe; color: #0369a1; }

.pill-edit      { background-color: #f0f9ff; color: #0284c7; border-color: #bae6fd; }
.pill-edit:hover      { background-color: #e0f2fe; color: #0369a1; }

.pill-danger    { background-color: #fef2f2; color: #dc2626; border-color: #fecaca; }
.pill-danger:hover    { background-color: #fee2e2; color: #b91c1c; }

.pill-success   { background-color: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.pill-success:hover   { background-color: #dcfce7; color: #15803d; }

/* =============================================================================
   MOBILE RESPONSIVENESS (max-width: 768px)
   ============================================================================= */

/* Mobile Header & Hamburger Menu */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
}

.hamburger-btn {
  background: none;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger-btn svg {
  width: 24px;
  height: 24px;
}

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 45;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Filters Collapse */
.filters-collapse-btn {
  display: none;
  width: 100%;
  justify-content: center;
  margin-bottom: 1rem;
}

.filters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* View Mode Toggle */
.view-mode-toggle {
  display: flex;
  background-color: var(--bg-page);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.view-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.view-mode-btn.active {
  background-color: white;
  color: var(--color-primary-600);
  box-shadow: var(--shadow-sm);
}

/* Cards View for Tables (Mobile Default) */
.table-cards-view .table,
.table-cards-view .table tbody,
.table-cards-view .table tr,
.table-cards-view .table td {
  display: block;
  width: 100%;
}

.table-cards-view .table thead {
  display: none;
}

.table-cards-view .table tr {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.table-cards-view .table td {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: right;
}

.table-cards-view .table td:last-child {
  border-bottom: none;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.table-cards-view .table td::before {
  content: attr(data-label);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  float: left;
  text-align: left;
  padding-right: 1rem;
}

@media (max-width: 768px) {
  /* Layout Changes */
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 50;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.sidebar-open {
    left: 0;
  }

  .mobile-header {
    display: flex;
  }

  .topbar {
    display: none;
  }

  .content-area {
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .page-header .btn {
    width: 100%;
    justify-content: center;
  }

  /* Kpi Grid */
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  /* Filters */
  .filters-collapse-btn {
    display: flex;
  }

  .filters-wrapper {
    display: none;
  }

  .filters-wrapper.open {
    display: flex;
  }

  .filters-wrapper form {
    flex-direction: column;
    align-items: stretch !important;
  }
}

/* ==== Barra de ações (ficha do sócio, central de fotos) ==== */
/* Barra de ações da ficha ------------------------------------------------
   Botões neutros com um só destaque: a cor aqui indica importância, não
   enfeita. Os grupos ficam separados por um filete discreto, para a barra
   ser lida como três blocos e não como sete botões avulsos. */
.ficha-acoes {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  justify-content: flex-end;
}
.ficha-acoes .acao-grupo { display: flex; flex-wrap: wrap; gap: .375rem; }

.acao {
  display: inline-flex; align-items: center; gap: .375rem;
  font-family: inherit; font-size: .8125rem; font-weight: 600;
  line-height: 1.2; white-space: nowrap; cursor: pointer;
  padding: .5rem .75rem; border-radius: 8px;
  border: 1px solid #D8E0E6; background: #fff; color: #33404D;
  text-decoration: none;
  transition: background 180ms cubic-bezier(.2,.7,.3,1),
              border-color 180ms cubic-bezier(.2,.7,.3,1),
              color 180ms cubic-bezier(.2,.7,.3,1);
}
.acao:hover { background: #F3F6F8; border-color: #A9B8C4; color: #08121F; }
.acao:focus-visible { outline: 2px solid #128BA8; outline-offset: 2px; }

/* Voltar é navegação, não ação: fica sem caixa para não competir. */
.acao-voltar {
  border-color: transparent; background: transparent; color: #5A6875;
  padding-left: .375rem; padding-right: .5rem;
}
.acao-voltar:hover { background: #F3F6F8; color: #08121F; }

/* O único destaque da barra: o que mais se faz nesta tela. */
.acao-principal {
  background: #128BA8; border-color: #128BA8; color: #fff;
}
.acao-principal:hover { background: #0A6480; border-color: #0A6480; color: #fff; }

.acao-nota { font-weight: 400; color: #5A6875; }
.acao:hover .acao-nota { color: #33404D; }

.acao-divisor {
  width: 1px; align-self: stretch; min-height: 22px;
  background: #D8E0E6; margin: 0 .125rem;
}

/* Em tela estreita a barra vira uma coluna: filete vertical entre blocos
   empilhados não separa nada, então some. */
@media (max-width: 820px) {
  .ficha-acoes { justify-content: flex-start; }
  .acao-divisor { display: none; }
  .ficha-acoes .acao-grupo { width: 100%; }
  .ficha-acoes .acao-grupo .acao { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .acao { transition: none; }
}

/* ==== Tabela que vira cartão no celular ====================================
   Numa tela estreita a tabela larga só oferece rolagem lateral, e ninguém
   encontra o botão que está fora do campo de visão. Abaixo de 820px cada
   linha vira um cartão empilhado: a foto e o nome no topo, o resto em
   pares rótulo/valor, e a ação ocupando a largura toda para caber no dedo.
   Acima disso a tabela continua exatamente como estava. */
.tabela-rolavel { overflow-x: auto; }

@media (max-width: 820px) {
  .tabela-rolavel { overflow-x: visible; }

  .tabela-cartao,
  .tabela-cartao tbody,
  .tabela-cartao tr,
  .tabela-cartao td { display: block; width: 100%; }

  .tabela-cartao thead { display: none; }   /* o rótulo passa para cada célula */

  .tabela-cartao tr {
    border: 1px solid #D8E0E6;
    border-radius: 12px;
    padding: .875rem;
    margin-bottom: .75rem;
    background: #fff;
    position: relative;
    padding-left: 4.75rem;                  /* espaço do retrato à esquerda */
    min-height: 5.25rem;
  }

  .tabela-cartao td {
    border: 0;
    padding: 0 0 .5rem;
  }
  .tabela-cartao td:last-child { padding-bottom: 0; }

  /* O retrato sai do fluxo e ancora no canto, como num contato do telefone. */
  .tabela-cartao .celula-foto {
    position: absolute;
    left: .875rem;
    top: .875rem;
    width: 3.25rem;
    padding: 0;
  }
  .tabela-cartao .celula-foto img {
    width: 3.25rem !important;
    height: 3.25rem !important;
  }

  .tabela-cartao .celula-pessoa { padding-bottom: .625rem; }

  /* Rótulo antes do valor, já que o cabeçalho da tabela sumiu. */
  .tabela-cartao td[data-rotulo]::before {
    content: attr(data-rotulo);
    display: block;
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #94A3B8;
    margin-bottom: .125rem;
  }

  /* Os botões descem para uma linha própria, do tamanho do dedo. */
  .tabela-cartao .celula-acao {
    text-align: left !important;
    white-space: normal !important;
    margin-left: -3.875rem;                 /* recupera o recuo do retrato */
    padding-top: .625rem;
    border-top: 1px solid #EEF2F5;
    display: flex;
    gap: .5rem;
  }
  .tabela-cartao .celula-acao .acao {
    flex: 1;
    justify-content: center;
    padding: .55rem .6rem !important;
  }
}

/* ==== Filtros e resumo em tela estreita ==================================== */
@media (max-width: 640px) {
  .ficha-acoes { width: 100%; }
  .ficha-acoes .acao { flex: 1; justify-content: center; }
}

/* Busca da central de fotos: no celular cada campo ocupa a linha inteira,
   porque campo de 260px ao lado de outro de 150px não cabe em 360px de tela. */
@media (max-width: 640px) {
  .filtro-fotos .filtro-busca,
  .filtro-fotos .filtro-tipo { flex: 1 1 100%; min-width: 0 !important; }
  .filtro-fotos .filtro-botao { flex: 1; justify-content: center; }
}

/* =============================================================================
   BLOQUEIO DE BOLETO POR CPF — "CPF do titular não informado"
   Grande de propósito: sem CPF válido o Sicredi não registra boleto, e a
   secretaria só descobria depois de tentar emitir. Vermelho aqui quer dizer
   "esta ação está impedida", nunca decoração.
   Contraste: #991b1b sobre #fef2f2 ≈ 7,9:1; #7f1d1d sobre #fef2f2 ≈ 9,6:1;
   branco sobre #b91c1c ≈ 6,5:1.
   ============================================================================= */
.alerta-bloqueio {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  background: #fef2f2;
  border: 2px solid #dc2626;
  border-left-width: 10px;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  color: #7f1d1d;
}
.alerta-bloqueio[hidden] { display: none; }
.alerta-bloqueio-corpo { flex: 1 1 22rem; min-width: 0; }
.alerta-bloqueio-titulo {
  margin: 0 0 0.375rem;
  font-size: 1.375rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #991b1b;
  text-wrap: balance;
}
.alerta-bloqueio-texto { margin: 0; font-size: 0.95rem; line-height: 1.5; }
.alerta-bloqueio-lista { margin: 0.5rem 0 0; font-size: 0.875rem; line-height: 1.7; }
.alerta-bloqueio-lista a { color: #991b1b; font-weight: 700; }
.alerta-bloqueio-acao {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  background: #b91c1c;
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 180ms cubic-bezier(.2,.7,.3,1);
}
.alerta-bloqueio-acao:hover { background: #991b1b; color: #fff; }
.alerta-bloqueio-acao:focus-visible { outline: 3px solid #fca5a5; outline-offset: 2px; }
.alerta-bloqueio.compacto { padding: 0.875rem 1.25rem; border-left-width: 8px; }
.alerta-bloqueio.compacto .alerta-bloqueio-titulo { font-size: 1.05rem; }

/* A mensagem que aparece depois de tentar emitir tem a mesma cara. */
.alert-bloqueio {
  background: #fef2f2;
  border: 2px solid #dc2626;
  border-left-width: 10px;
  color: #991b1b;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1.125rem 1.5rem;
}

/* Ação impedida: continua à vista, com o motivo no title — sumir com o botão
   faria a pessoa procurar em outro lugar. #475569 sobre #f1f5f9 ≈ 6,9:1. */
.acao-bloqueada,
.acao-bloqueada:hover {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
  cursor: not-allowed;
}

.doc-invalido {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
  font-size: 0.8rem;
}
.linha-sem-doc td { background: #fef2f2; }

/* Aviso no campo CPF do cadastro. */
.aviso-cpf-boleto {
  margin-top: 0.5rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid #fecaca;
  border-left: 5px solid #dc2626;
  border-radius: var(--radius-md);
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.875rem;
  line-height: 1.45;
}
.aviso-cpf-boleto[hidden] { display: none; }

/* =============================================================================
   INCONSISTÊNCIAS — um cartão por verificação
   Filete superior de 3px na cor da gravidade: vermelho impede ou arrisca
   cobrança, âmbar é dado a corrigir, azul é para conferir. Número em 800 com
   algarismos tabulares. Contraste do texto sobre branco: #b91c1c ≈ 6,5:1,
   #92400e ≈ 7,1:1, #075985 ≈ 7,9:1; contador vermelho (branco sobre #dc2626)
   ≈ 4,8:1.
   ============================================================================= */
.inc-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.inc-grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.inc-card {
  --inc-tom: #64748b;
  --inc-texto: #334155;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--inc-tom);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem 1.25rem;
}
.inc-card.bloqueio { --inc-tom: #dc2626; --inc-texto: #b91c1c; }
.inc-card.atencao  { --inc-tom: #d97706; --inc-texto: #92400e; }
.inc-card.info     { --inc-tom: #0284c7; --inc-texto: #075985; }
.inc-topo { display: flex; flex-direction: column; gap: 0.375rem; }
.inc-topo .inc-eyebrow { margin: 0; }
.inc-sev { color: var(--inc-texto); }
.inc-numero {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--inc-texto);
}
.inc-unidade { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; color: var(--text-muted); }
.inc-estado { font-size: 1.125rem; }
.inc-titulo { margin: 0; font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.01em; color: var(--text-dark); text-wrap: balance; }
.inc-texto { margin: 0; font-size: 0.875rem; line-height: 1.55; color: var(--text-main); }
.inc-amostra { margin: 0.125rem 0 0; padding: 0; list-style: none; font-size: 0.8125rem; line-height: 1.6; }
.inc-amostra a { color: var(--text-dark); text-decoration: underline; text-decoration-color: #cbd5e1; text-underline-offset: 2px; }
.inc-amostra a:hover { text-decoration-color: currentColor; }
.inc-mais { color: var(--text-muted); }
.inc-acao {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--inc-tom);
  border-radius: var(--radius-md);
  color: var(--inc-texto);
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 180ms cubic-bezier(.2,.7,.3,1);
}
.inc-acao:hover { background: color-mix(in srgb, var(--inc-tom) 10%, #fff); }
.inc-acao:focus-visible { outline: 2px solid var(--inc-tom); outline-offset: 2px; }
.inc-em-dia-titulo { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 800; color: var(--text-dark); }
.inc-em-dia ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.625rem; }
.inc-em-dia li { display: flex; gap: 0.625rem; font-size: 0.875rem; line-height: 1.5; color: var(--text-main); }
.inc-check { color: #047857; font-weight: 800; }
.inc-tudo-certo .inc-titulo { color: #047857; }

/* Botão do painel, com o contador de itens pedindo ação. */
.botao-inconsistencias { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.inc-contador {
  min-width: 1.5rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.inc-contador.bloqueio { background: #dc2626; color: #fff; }
.inc-contador.atencao  { background: #fef3c7; color: #92400e; }
.inc-contador.ok       { background: #d1fae5; color: #047857; }

/* Faixa "mostrando só…" nas listas abertas a partir de uma inconsistência. */
.faixa-filtro-inc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid #fcd34d;
  border-left: 5px solid #d97706;
  border-radius: var(--radius-md);
  background: #fffbeb;
  color: #92400e;
  font-size: 0.9rem;
}
.faixa-filtro-inc a { color: #92400e; font-weight: 700; }

/* =============================================================================
   LISTA PARA EMISSÃO — sócios por dia de vencimento
   ============================================================================= */
.le-contagem { margin: 0 0 1rem; font-size: 0.9rem; color: var(--text-main); font-variant-numeric: tabular-nums; }
.le-grupo-topo {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.5rem 1rem;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.le-grupo-titulo { margin: 0; font-size: 1.125rem; font-weight: 800; letter-spacing: -0.01em; color: var(--text-dark); }
.le-grupo-nota { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--text-muted); }
.le-grupo-numeros { margin: 0; font-size: 0.9rem; color: var(--text-main); font-variant-numeric: tabular-nums; }
.le-tabela { margin: 0; }
.le-tabela tfoot td { font-weight: 700; background: #f8fafc; }
.le-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.le-nome { font-weight: 600; color: var(--text-dark); }
.le-conferir {
  display: inline-block;
  margin-left: 0.375rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.7rem;
  font-weight: 700;
}
.le-sem-contato { color: var(--text-muted); font-size: 0.8125rem; }

/* Cadastro: aba Mensalidade e a linha da ficha. */
.form-ajuda { margin: 0 0 0.75rem; font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5; }
.ficha-mensalidade { margin-top: 0.5rem; font-size: 0.875rem; color: var(--text-main); }
.ficha-falta { color: #92400e; font-weight: 600; }
.le-envio { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.le-envio.whatsapp { background: #dcfce7; color: #166534; }
.le-envio.impresso { background: #e0f2fe; color: #075985; }
.le-sugerido { color: var(--text-muted); font-size: 0.75rem; font-style: italic; }

/* Lote "pelo cadastro" e a informação do cadastro no individual. */
.usar-cadastro {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  margin-top: 0.875rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  background: #ecfdf5;
  color: #065f46;
  cursor: pointer;
}
.usar-cadastro input { width: 18px; height: 18px; margin-top: 0.15rem; accent-color: var(--color-primary-600); }
.usar-cadastro small { display: block; margin-top: 0.15rem; font-size: 0.8rem; color: #047857; line-height: 1.45; }
.linha-fora td { background: #f8fafc; color: #64748b; }
.card[hidden] { display: none; }
.info-cadastro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.875rem;
}
.info-cadastro[hidden] { display: none; }
.info-cadastro.isento { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.info-cadastro button { font-size: 0.8rem; padding: 0.3rem 0.7rem; }

/* Lista de sócios: painel "Imprimir lista / planilha". */
.painel-lista { position: relative; }
.painel-lista > summary { list-style: none; cursor: pointer; padding: 0.5rem 1rem; font-size: 0.875rem; }
.painel-lista > summary::-webkit-details-marker { display: none; }
.painel-lista-corpo {
  position: absolute;
  right: 0;
  top: calc(100% + 0.375rem);
  z-index: 30;
  width: min(380px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.painel-lista-texto { margin: 0; font-size: 0.8125rem; color: var(--text-main); line-height: 1.5; }
.painel-lista-aviso { margin: 0; padding: 0.5rem 0.625rem; border-radius: var(--radius-md); background: #fffbeb; color: #92400e; font-size: 0.8125rem; }
.painel-lista-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 0.375rem 0.75rem; font-size: 0.875rem; }
.painel-lista-colunas label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.painel-lista-botoes { display: flex; gap: 0.5rem; }

/* Sugestão no lote: ajustar data e valor ao grupo filtrado. */
.lote-sugestao {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.85rem;
}
.lote-sugestao[hidden] { display: none; }
.lote-sugestao button { font-size: 0.8rem; padding: 0.3rem 0.7rem; }

/* ==== Prova da captura (fila de conferência) ===============================
   A tira de quadros vira uma animação curta: cada quadro é uma posição do
   fundo, e steps(n, jump-none) para exatamente em cada uma, do primeiro ao
   último. Passar o mouse pausa para examinar um quadro. Para quem pede menos
   movimento, a animação dá lugar à tira inteira, rolável. */
.prova-rotulo {
  margin: 0 0 .375rem; font-size: .625rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: #0A6480; text-align: center;
}
.prova-anim {
  width: 100%; max-width: 200px; aspect-ratio: 1; margin: 0 auto;
  border-radius: 8px; background-color: #f1f5f9; background-repeat: no-repeat;
  background-size: calc(var(--quadros) * 100%) 100%;
  animation: prova-quadros calc(var(--quadros) * 180ms) steps(var(--quadros), jump-none) infinite;
}
.prova-anim:hover { animation-play-state: paused; }
@keyframes prova-quadros {
  from { background-position: 0% 0; }
  to   { background-position: 100% 0; }
}
.prova-tira { display: none; }
.prova-legenda { margin: .5rem 0 0; font-size: .75rem; line-height: 1.4; color: #5A6875; text-align: center; }
.prova-ok      { color: #0C6647; font-weight: 600; }
.prova-alerta  { color: #A82A20; font-weight: 700; }
.prova-vazia   { margin: 0; padding: .5rem 0; font-size: .75rem; color: #64748b; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .prova-anim { display: none; }
  .prova-tira { display: block; overflow-x: auto; }
  .prova-tira img { display: block; height: 88px; width: auto; max-width: none; border-radius: 8px; }
}
