/* ── Google Fonts: Plus Jakarta Sans ── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ── Reset & Base Variables ── */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --font-family-base: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 250px;
  --topbar-h: 58px;
  
  /* Modern Dark Sidebar Palette */
  --sb-bg: #0f172a;
  --sb-accent: #3b82f6;
  --sb-text: #94a3b8;
  --sb-text-hover: #ffffff;
  --sb-text-muted: #64748b;
  --sb-active-bg: rgba(59, 130, 246, 0.12);
  --sb-active-text: #60a5fa;
  --sb-hover-bg: rgba(255, 255, 255, 0.05);
  --sb-border: rgba(255, 255, 255, 0.08);

  /* Light Theme Main Background & Surface */
  --body-bg: #f8fafc;
  --surface-card: #ffffff;
  --surface-border: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  /* Accent Gradients & Colors */
  --primary-gradient: linear-gradient(135deg, #1e3c6e 0%, #0f2b57 100%);
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
  --shadow-md: 0 10px 25px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 24px 40px -8px rgba(15, 23, 42, 0.12), 0 8px 24px -4px rgba(15, 23, 42, 0.05);
  --radius-card: 12px;
  --radius-btn: 8px;
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background-color: var(--body-bg);
  font-family: var(--font-family-base);
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video, canvas, svg {
  max-width: 100%;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ── App Shell ── */
.sp-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sp-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sp-sidebar__logo {
  height: var(--topbar-h);
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}

.sp-sidebar__logo-icon {
  width: 34px;
  height: 34px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.sp-sidebar__logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sp-sidebar__logo-text {
  line-height: 1.2;
}

.sp-sidebar__logo-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.sp-sidebar__logo-text span {
  font-size: 10.5px;
  color: var(--sb-text-muted);
  font-weight: 500;
}

.sp-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.sp-sidebar__section {
  padding: 16px 12px 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--sb-text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.sp-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: var(--sb-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  margin-bottom: 2px;
  transition: var(--transition-fast);
  position: relative;
}

.sp-nav-item:hover {
  background: var(--sb-hover-bg);
  color: var(--sb-text-hover);
  text-decoration: none;
  transform: translateX(2px);
}

.sp-nav-item.active {
  background: var(--sb-active-bg);
  color: var(--sb-active-text);
  font-weight: 600;
}

.sp-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3.5px;
  background: var(--sb-accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px var(--sb-accent);
}

.sp-nav-item i {
  font-size: 18px;
  width: 18px;
  flex-shrink: 0;
  text-align: center;
  transition: var(--transition-fast);
}

.sp-nav-item:hover i {
  color: var(--sb-accent);
}

.sp-nav-badge {
  margin-left: auto;
  background: var(--sb-accent);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  line-height: 1.4;
}

.sp-sidebar__user {
  padding: 14px 16px;
  border-top: 1px solid var(--sb-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.15);
}

.sp-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.sp-sidebar__user-info {
  flex: 1;
  min-width: 0;
}

.sp-sidebar__user-info p {
  font-size: 12.5px;
  color: #ffffff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.sp-sidebar__user-info small {
  font-size: 10.5px;
  color: var(--sb-text-muted);
}

.sp-logout-btn {
  color: var(--sb-text-muted);
  font-size: 18px;
  text-decoration: none;
  transition: var(--transition-fast);
  flex-shrink: 0;
  padding: 4px;
  border-radius: 6px;
}

.sp-logout-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ── Topbar ── */
.sp-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 999;
}


.sp-topbar__toggle {
  display: none;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 22px;
}

.sp-topbar__breadcrumb {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
}

.sp-topbar__breadcrumb .page-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.3px;
}

.sp-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-icon-btn {
  width: 36px;
  height: 36px;
  background: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
  transition: var(--transition-fast);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.sp-icon-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* ── Main Layout & Cards ── */
.sp-main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  flex: 1;
}

.sp-content {
  padding: 28px;
  max-width: 1400px;
  min-width: 0;
  margin: 0 auto;
}

/* ── Minimalist Cards ── */
.sp-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.sp-module-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.sp-module-grid .sp-module-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
}


.sp-module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 25px -8px rgba(59, 130, 246, 0.15), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  border-color: rgba(59, 130, 246, 0.35);
}

.sp-module-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sp-module-card__header i {
  font-size: 20px;
  flex-shrink: 0;
}

.sp-module-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.2px;
}

.sp-module-card__desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
  flex-grow: 1;
}

.sp-module-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}


.sp-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.sp-stat-card {
  background: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.sp-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 25px -8px rgba(59, 130, 246, 0.1), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  border-color: rgba(59, 130, 246, 0.25);
}


.sp-stat-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
  transition: var(--transition-fast);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.sp-stat-card__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sp-stat-card__value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.5px;
}

.sp-stat-card__sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Icon Color Utilities with Pastel Backgrounds ── */
.icon-blue  { background: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; }
.icon-green { background: #f0fdf4; color: #10b981; border: 1px solid #dcfce7; }
.icon-amber { background: #fffbeb; color: #d97706; border: 1px solid #fef3c7; }
.icon-coral { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }
.icon-teal  { background: #f0fdfa; color: #0d9488; border: 1px solid #ccfbf1; }

/* ── Modern Buttons ── */
.sp-btn-sm {
  font-family: var(--font-family-base);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 15px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-btn);
  background: #ffffff;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.sp-btn-sm:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--text-primary);
  text-decoration: none;
  transform: translateY(-1px);
}

.sp-btn-sm.primary {
  background: var(--primary-gradient);
  border-color: #1e3c6e;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(30, 60, 110, 0.25);
}

.sp-btn-sm.primary:hover {
  background: linear-gradient(135deg, #162d53 0%, #0a1f40 100%);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 60, 110, 0.35);
}

/* ── Table Enhancements ── */
.table {
  color: var(--text-primary);
  vertical-align: middle;
}

.table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--surface-border);
  padding: 12px 16px;
}

.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px;
  transition: background 0.12s;
}

.table-hover tbody tr:hover td {
  background-color: #f8fafc !important;
}

/* ── Form Controls & Inputs ── */
.form-control, .form-select {
  font-family: var(--font-family-base);
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  padding: 8px 12px;
  color: var(--text-primary);
  transition: var(--transition-fast);
  background-color: #ffffff;
}

.form-control:focus, .form-select:focus {
  border-color: var(--sb-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}

/* ── Modals & Dialogs ── */
.modal-content {
  border-radius: 14px;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* ── Badges ── */
.badge {
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 4px 10px;
  border-radius: 20px;
}

/* ── Responsive: Mobile ── */
@media (max-width: 768px) {
  .sp-sidebar {
    transform: translateX(-100%);
  }
  .sp-sidebar.open {
    transform: translateX(0);
  }
  .sp-topbar {
    left: 0;
    gap: 8px;
    padding: 0 12px;
  }
  .sp-topbar__toggle {
    display: flex;
  }
  .sp-main {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .sp-content {
    width: 100%;
    padding: 14px 12px 24px;
    overflow: hidden;
  }
  .sp-topbar__breadcrumb {
    min-width: 0;
    overflow: hidden;
  }
  .sp-topbar__breadcrumb .breadcrumb {
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
  }
  .sp-topbar__breadcrumb .breadcrumb-item {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sp-topbar__actions { gap: 6px; }
  .sp-topbar__actions .sp-icon-btn { width: 34px; height: 34px; }
  .sp-module-card, .sp-stat-card {
    min-width: 0;
    padding: 15px;
    border-radius: 8px;
  }
  .sp-module-card:hover, .sp-stat-card:hover { transform: none; }
  .sp-module-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sp-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sp-stat-card { padding: 15px; }
  .sp-stat-card__value { font-size: 22px; }
  .sp-content > .d-flex.justify-content-between,
  .sp-module-card > .d-flex.justify-content-between {
    align-items: flex-start !important;
    flex-wrap: wrap;
    gap: 10px;
  }
  .sp-content > .d-flex.justify-content-between > .d-flex,
  .sp-module-card > .d-flex.justify-content-between > .d-flex {
    max-width: 100%;
    flex-wrap: wrap;
  }
  .sp-content > .d-flex.justify-content-between > .d-flex .sp-btn-sm {
    flex: 1 1 auto;
    justify-content: center;
  }
  .sp-btn-sm {
    min-height: 38px;
    padding: 8px 12px;
    white-space: normal;
    text-align: center;
  }
  .form-control, .form-select {
    min-height: 42px;
    font-size: 16px;
  }
  textarea.form-control { min-height: auto; }
  fieldset { min-width: 0; }
  .input-group { max-width: 100% !important; }
  .modal-dialog {
    width: auto;
    max-width: none;
    margin: 8px;
  }
  .modal-content { max-height: calc(100dvh - 16px); }
  .modal-body { overflow-y: auto; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .sp-btn-sm { flex: 1; justify-content: center; }
  .table-responsive {
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .sp-module-card:has(> table),
  .sp-module-card:has(> .dataTables_wrapper),
  .sp-module-card:has(.table:not(.fc-scrollgrid)) {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .sp-module-card > table,
  .sp-module-card > .dataTables_wrapper table,
  .sp-module-card .table:not(.fc-scrollgrid) {
    min-width: 680px;
  }
  .dataTables_wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .dataTables_wrapper .row {
    min-width: 0;
    margin-right: 0;
    margin-left: 0;
  }
  .dataTables_info, .dataTables_paginate {
    padding: 10px 12px !important;
    white-space: normal !important;
  }
  dl.row dt, dl.row dd { overflow-wrap: anywhere; }
  .sp-content form .form-select[style*="max-width"],
  .sp-content form .form-control[style*="max-width"] {
    width: 100% !important;
    max-width: 100% !important;
  }
  .sp-content form > .d-flex {
    align-items: stretch !important;
    flex-wrap: wrap;
  }
  .sp-content form > .d-flex > .form-select,
  .sp-content form > .d-flex > .form-control {
    flex: 1 1 180px;
  }
  .sp-content form .d-flex.justify-content-between {
    flex-wrap: wrap;
    gap: 10px;
  }
  .sp-content form .d-flex.justify-content-between .sp-btn-sm {
    flex: 1 1 auto;
    justify-content: center;
  }
  #calendar-container { overflow: hidden; }
  .fc .fc-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .fc .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
  }
  .fc .fc-toolbar-title { font-size: 17px; text-align: center; }
  .fc .fc-button {
    min-height: 36px;
    padding: 6px 9px;
    font-size: 12px;
  }
  .fc .fc-list-event-title,
  .fc .fc-list-event-time { font-size: 12px; }
  .sp-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
  }
  .sp-sidebar-overlay.open {
    display: block;
  }
}

@media (max-width: 420px) {
  .sp-topbar__breadcrumb { font-size: 11px; }
  .sp-topbar__actions .sp-icon-btn:first-child { display: none; }
  .sp-content { padding-right: 10px; padding-left: 10px; }
  .sp-stat-grid { grid-template-columns: 1fr; }
  .sp-empty-state { padding: 36px 18px; }
  .badge { white-space: normal; }
}

/* ── Modern Empty States ── */
.sp-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  background: var(--surface-card);
  border: 1px dashed var(--surface-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}

.sp-empty-state__icon {
  width: 64px;
  height: 64px;
  background: #f1f5f9;
  color: var(--text-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.sp-empty-state__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.sp-empty-state__desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Modern Badges with Soft Gradients ── */
.badge.text-bg-success {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
  color: #065f46 !important;
  border: 1px solid #a7f3d0 !important;
}
.badge.text-bg-secondary {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}
.badge.text-bg-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
}
.badge.text-bg-danger {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
  color: #991b1b !important;
  border: 1px solid #fecaca !important;
}
.badge.text-bg-primary {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
  color: #1e40af !important;
  border: 1px solid #bfdbfe !important;
}

/* ── Entrance Fade-in Micro-animations ── */
@keyframes spFadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sp-module-card, .sp-stat-card {
  animation: spFadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Culto Detail ── */
.culto-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.culto-hero__main, .culto-hero__actions, .culto-meta-list {
  display: flex;
  align-items: center;
}
.culto-hero__main { gap: 14px; }
.culto-hero__actions { gap: 8px; flex-shrink: 0; }
.culto-meta-list { gap: 14px; flex-wrap: wrap; color: var(--text-muted); font-size: 12px; }
.culto-meta-list span { display: inline-flex; align-items: center; gap: 5px; }
.culto-date-tile {
  width: 52px;
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a5f;
  border: 1px solid #dbeafe;
  flex-shrink: 0;
}
.culto-date-tile span { font-size: 10px; font-weight: 700; text-transform: uppercase; }
.culto-date-tile strong { font-size: 22px; line-height: 1.05; }
.culto-summary { padding: 18px 20px; }
.culto-summary__grid { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 24px; }
.culto-entry-form {
  padding: 18px;
  background: #f8fafc;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
}
.culto-entry-form label { font-size: 12px; font-weight: 600; color: #475569; }
.culto-entry-form .form-text { font-size: 11px; line-height: 1.35; }
.culto-empty-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #f8fafc;
  border: 1px dashed #d6dee9;
  border-radius: 8px;
  color: #64748b;
}
.culto-empty-inline > i { font-size: 24px; color: #94a3b8; }
.culto-empty-inline strong { display: block; color: #475569; font-size: 13px; }
.culto-empty-inline span { display: block; font-size: 12px; margin-top: 2px; }
.culto-song-modal {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .2);
  overflow: hidden;
}
.culto-song-modal .modal-header {
  align-items: flex-start;
  padding: 22px 24px 18px;
  border-bottom-color: #e2e8f0;
}
.culto-song-modal .modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  color: #172033;
  font-size: 18px;
  font-weight: 650;
}
.culto-song-modal .modal-header p {
  margin: 5px 36px 0 0;
  color: #64748b;
  font-size: 13px;
}
.culto-song-modal__eyebrow {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.culto-song-modal .modal-body { padding: 22px 24px 12px; }
.culto-song-modal .modal-body label {
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}
.culto-song-modal__hint {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 2px;
  padding: 10px 12px;
  color: #64748b;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 12px;
}
.culto-song-modal .modal-footer {
  padding: 14px 24px 20px;
  border-top: 0;
}

/* ── Congregaciones directory ── */
.congregaciones-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.congregaciones-heading__eyebrow {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.congregaciones-heading h1 {
  margin: 3px 0 2px;
  color: #172033;
  font-size: 24px;
  font-weight: 650;
}
.congregaciones-heading p { margin: 0; color: #64748b; font-size: 13px; }
.congregaciones-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.congregaciones-stats > div {
  position: relative;
  min-height: 86px;
  padding: 16px 54px 14px 18px;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.congregaciones-stats span { display: block; color: #64748b; font-size: 11px; }
.congregaciones-stats strong { display: block; margin-top: 4px; color: #172033; font-size: 24px; }
.congregaciones-stats i {
  position: absolute;
  top: 20px;
  right: 18px;
  color: #3b82f6;
  font-size: 24px;
}
.congregaciones-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.congregaciones-search,
.congregaciones-filter {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  color: #94a3b8;
  background: #f8fafc;
  border: 1px solid #dbe4ef;
  border-radius: 6px;
}
.congregaciones-search { flex: 1; }
.congregaciones-filter { width: 210px; }
.congregaciones-search input,
.congregaciones-filter select {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 8px;
  color: #334155;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
}
.congregaciones-results { margin: 16px 2px 8px; }
.congregaciones-results p { margin: 0; color: #64748b; font-size: 12px; }
.congregaciones-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.congregacion-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.congregacion-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 18px 13px;
}
.congregacion-card__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 7px;
  font-size: 20px;
}
.congregacion-card__identity { min-width: 0; }
.congregacion-card__identity h2 { margin: 0 0 3px; font-size: 15px; font-weight: 650; }
.congregacion-card__identity h2 a {
  display: block;
  color: #172033;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.congregacion-status { color: #94a3b8; font-size: 11px; }
.congregacion-status.is-active { color: #15803d; }
.congregacion-card__body { flex: 1; padding: 0 18px 15px; }
.congregacion-card__address {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-height: 38px;
  margin: 0 0 12px;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}
.congregacion-card__address i { margin-top: 2px; color: #94a3b8; }
.congregacion-card__address span { color: #94a3b8; font-style: italic; }
.congregacion-card__pastor {
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 6px;
}
.congregacion-card__pastor span { display: block; color: #94a3b8; font-size: 10px; text-transform: uppercase; }
.congregacion-card__pastor strong {
  display: block;
  margin-top: 3px;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}
.congregacion-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.congregacion-card__metrics div { padding: 9px 8px; text-align: center; }
.congregacion-card__metrics div + div { border-left: 1px solid #e2e8f0; }
.congregacion-card__metrics strong { display: block; color: #1e3a5f; font-size: 15px; }
.congregacion-card__metrics span { display: block; color: #64748b; font-size: 10px; }
.congregacion-card__actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px;
  background: #fbfdff;
  border-top: 1px solid #e8edf3;
}

/* ── Pastoral reminders ── */
.reminders-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.reminders-heading__eyebrow { color: #64748b; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.reminders-heading h1 { margin: 3px 0 2px; color: #172033; font-size: 24px; font-weight: 650; }
.reminders-heading p { margin: 0; color: #64748b; font-size: 13px; }
.reminders-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
}
.reminders-toolbar label {
  display: flex;
  align-items: center;
  width: min(100%, 340px);
  height: 38px;
  padding: 0 10px;
  color: #94a3b8;
  background: #f8fafc;
  border: 1px solid #dbe4ef;
  border-radius: 6px;
}
.reminders-toolbar select {
  width: 100%;
  height: 100%;
  padding: 0 8px;
  color: #334155;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
}
.reminders-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.reminders-stats > div {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px 14px;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
}
.reminders-stats i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 6px;
  font-size: 18px;
}
.reminders-stats span { color: #64748b; font-size: 11px; line-height: 1.25; }
.reminders-stats strong { color: #172033; font-size: 20px; }
.reminders-stats .is-warning i { color: #a16207; background: #fef9c3; }
.reminders-stats .is-danger i { color: #b91c1c; background: #fee2e2; }
.reminders-today {
  margin-bottom: 14px;
  padding: 17px 18px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
}
.reminders-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.reminders-section-title > div { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.reminders-section-title > div > i { grid-row: 1 / 3; color: #64748b; font-size: 20px; }
.reminders-section-title span { color: #94a3b8; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.reminders-section-title h2 { margin: 1px 0 0; color: #273449; font-size: 14px; font-weight: 650; }
.reminders-section-title > a { color: #1d4ed8; font-size: 11px; text-decoration: none; }
.reminders-count {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  color: #1e40af !important;
  background: #dbeafe;
  border-radius: 12px;
  font-size: 11px !important;
}
.reminders-people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.reminders-people > a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 10px;
  color: #334155;
  background: #fff;
  border: 1px solid #fcd34d;
  border-radius: 7px;
  text-decoration: none;
}
.reminders-people .sp-avatar, .reminders-list .sp-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  font-size: 11px;
}
.reminders-people > a > span:nth-child(2) { min-width: 0; flex: 1; }
.reminders-people strong, .reminders-people small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reminders-people strong { font-size: 12px; }
.reminders-people small { color: #64748b; font-size: 10px; }
.reminders-people > a > i { color: #94a3b8; }
.reminders-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .8fr); gap: 14px; }
.reminders-layout main, .reminders-layout aside { display: flex; min-width: 0; flex-direction: column; gap: 14px; }
.reminders-panel {
  min-width: 0;
  padding: 17px 18px;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.reminders-list { border-top: 1px solid #edf1f5; }
.reminders-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 2px;
  color: #334155;
  border-bottom: 1px solid #edf1f5;
  text-decoration: none;
}
.reminders-list__item:last-child { border-bottom: 0; }
.reminders-list__content { min-width: 0; flex: 1; }
.reminders-list__content > a { color: #334155; text-decoration: none; }
.reminders-list__content strong, .reminders-list__content small { display: block; }
.reminders-list__content strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.reminders-list__content small { margin-top: 2px; color: #64748b; font-size: 10px; }
.reminders-date, .reminders-event-date {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  flex: 0 0 38px;
  color: #1e40af;
  background: #eff6ff;
  border-radius: 6px;
}
.reminders-date strong, .reminders-event-date strong { font-size: 15px; line-height: 1; }
.reminders-date small, .reminders-event-date small { font-size: 9px; text-transform: uppercase; }
.reminders-days {
  padding: 4px 7px;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 10px;
  font-size: 9px;
  white-space: nowrap;
}
.reminders-days.is-overdue { color: #b91c1c; background: #fef2f2; }
.reminders-list .sp-avatar.is-danger { background: #b91c1c; }
.reminders-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 72px;
  padding: 16px;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #d6dee9;
  border-radius: 7px;
  font-size: 12px;
  text-align: center;
}
.reminders-empty i { color: #94a3b8; font-size: 22px; }
.reminders-empty.is-success i { color: #15803d; }
.reminders-events > div,
.reminders-events > a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid #edf1f5;
}
.reminders-events > div > span:last-child,
.reminders-events > a > span:last-child { min-width: 0; }
.reminders-events > a { color: inherit; text-decoration: none; }
.reminders-events strong, .reminders-events small { display: block; }
.reminders-events strong { color: #334155; font-size: 12px; }
.reminders-events small { margin-top: 3px; color: #64748b; font-size: 10px; line-height: 1.4; }
.reminders-month-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: #334155;
  border-top: 1px solid #edf1f5;
  font-size: 12px;
  text-decoration: none;
}
.reminders-month-list time { width: 26px; color: #1d4ed8; font-weight: 700; text-align: center; }
.reminders-month-list a > span { min-width: 0; }
.reminders-month-list small { display: block; color: #94a3b8; font-size: 9px; }
.reminders-next-month {
  display: flex;
  justify-content: space-between;
  margin: 12px -18px -17px;
  padding: 11px 18px;
  color: #64748b;
  background: #f8fafc;
  border-top: 1px solid #edf1f5;
  font-size: 11px;
}
.reminders-next-month strong { color: #334155; }

/* ── Family directory ── */
.families-heading, .family-detail-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.families-heading > div > span { color: #64748b; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.families-heading h1, .family-detail-hero h1 { margin: 3px 0 2px; color: #172033; font-size: 24px; font-weight: 650; }
.families-heading p, .family-detail-hero p { margin: 0; color: #64748b; font-size: 13px; }
.families-stats, .family-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.families-stats > div {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
}
.families-stats i { display: grid; place-items: center; width: 36px; height: 36px; color: #1d4ed8; background: #eff6ff; border-radius: 6px; font-size: 19px; }
.families-stats span { color: #64748b; font-size: 11px; }
.families-stats strong { color: #172033; font-size: 20px; }
.families-stats .is-warning i { color: #a16207; background: #fef9c3; }
.families-toolbar {
  display: flex;
  gap: 8px;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
}
.families-search, .families-filter {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 10px;
  color: #94a3b8;
  background: #f8fafc;
  border: 1px solid #dbe4ef;
  border-radius: 6px;
}
.families-search { min-width: 0; flex: 1; }
.families-filter { width: 250px; }
.families-search input, .families-filter select { width: 100%; min-width: 0; height: 100%; padding: 0 8px; color: #334155; background: transparent; border: 0; outline: 0; font-size: 13px; }
.families-results { margin: 15px 2px 8px; color: #64748b; font-size: 12px; }
.families-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.family-card { min-width: 0; background: #fff; border: 1px solid var(--surface-border); border-radius: 8px; box-shadow: var(--shadow-sm); overflow: hidden; }
.family-card header { display: flex; align-items: center; gap: 11px; padding: 16px 17px 12px; }
.family-card__icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; color: #0f766e; background: #ecfdf5; border-radius: 7px; font-size: 20px; }
.family-card header > div { min-width: 0; flex: 1; }
.family-card h2 { margin: 0 0 3px; font-size: 15px; }
.family-card h2 a { display: block; overflow: hidden; color: #172033; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.family-card header > div > span { color: #64748b; font-size: 10px; }
.family-card__count { display: grid; place-items: center; min-width: 26px; height: 26px; color: #0f766e; background: #d1fae5; border-radius: 13px; font-size: 11px; font-weight: 700; }
.family-card__contact { margin: 0 17px 12px; padding: 10px 12px; background: #f8fafc; border-radius: 6px; }
.family-card__contact span, .family-card__contact strong, .family-card__contact small { display: block; }
.family-card__contact span { color: #94a3b8; font-size: 9px; text-transform: uppercase; }
.family-card__contact strong { margin-top: 3px; color: #334155; font-size: 12px; }
.family-card__contact small { margin-top: 2px; color: #64748b; font-size: 10px; }
.family-card__members { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 0 17px 14px; }
.family-card__members > span { display: flex; align-items: center; gap: 5px; color: #475569; font-size: 10px; }
.family-card__members .sp-avatar { width: 23px; height: 23px; font-size: 9px; font-style: normal; }
.family-card__members > small { color: #64748b; font-size: 10px; }
.family-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 17px; background: #fbfdff; border-top: 1px solid #e8edf3; }
.family-card footer span { color: #64748b; font-size: 10px; }
.family-card footer a { color: #1d4ed8; font-size: 11px; font-weight: 600; text-decoration: none; }
.family-breadcrumb { font-size: 13px; }
.family-breadcrumb a { color: #64748b; text-decoration: none; }
.family-detail-hero { align-items: center; padding: 17px 19px; background: #fff; border: 1px solid var(--surface-border); border-radius: 8px; box-shadow: var(--shadow-sm); }
.family-detail-hero__identity { display: flex; align-items: center; gap: 13px; }
.family-detail-hero__identity > span { display: grid; place-items: center; width: 52px; height: 52px; color: #0f766e; background: #ecfdf5; border-radius: 8px; font-size: 25px; }
.family-detail-hero small { color: #94a3b8; font-size: 9px; text-transform: uppercase; }
.family-detail-hero p i { margin-right: 3px; }
.family-detail-stats > div { padding: 13px 16px; background: #fff; border: 1px solid var(--surface-border); border-radius: 8px; }
.family-detail-stats span { display: block; color: #64748b; font-size: 10px; }
.family-detail-stats strong { display: block; margin-top: 3px; color: #172033; font-size: 20px; }
.family-detail-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr); gap: 14px; }
.family-detail-panel { min-width: 0; padding: 17px 18px; background: #fff; border: 1px solid var(--surface-border); border-radius: 8px; box-shadow: var(--shadow-sm); }
.family-detail-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.family-detail-title span { color: #94a3b8; font-size: 9px; text-transform: uppercase; }
.family-detail-title h2 { margin: 2px 0 0; color: #273449; font-size: 14px; }
.family-detail-title > span { padding: 4px 8px; color: #1e40af; background: #dbeafe; border-radius: 10px; font-size: 10px; }
.family-members article { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px 2px; border-top: 1px solid #edf1f5; }
.family-members .sp-avatar { width: 32px; height: 32px; flex: 0 0 32px; font-size: 11px; }
.family-member__identity { min-width: 130px; flex: 1; }
.family-member__identity a { display: block; overflow: hidden; color: #334155; font-size: 12px; font-weight: 600; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.family-member__identity span, .family-member__contact span { display: block; color: #64748b; font-size: 10px; }
.family-member__contact { width: 210px; }
.family-member__status { padding: 4px 7px; color: #64748b; background: #f1f5f9; border-radius: 10px; font-size: 9px; }
.family-member__status.is-active { color: #15803d; background: #dcfce7; }
.family-contact-block { padding: 12px 0; border-top: 1px solid #edf1f5; }
.family-contact-block h3 { margin: 0 0 9px; color: #64748b; font-size: 10px; text-transform: uppercase; }
.family-contact-block p { margin: 0 0 8px; color: #334155; font-size: 11px; line-height: 1.4; }
.family-contact-block p strong, .family-contact-block p span { display: block; }
.family-contact-block p span { color: #94a3b8; font-size: 9px; }
.family-contact-block .is-empty { color: #94a3b8; font-style: italic; }

/* ── Main dashboard ── */
.dashboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 19px 21px;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-left: 4px solid #1e3a5f;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.dashboard-heading__main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.dashboard-heading__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 8px;
  font-size: 22px;
}
.dashboard-heading__main > div { min-width: 0; }
.dashboard-heading__eyebrow { color: #64748b; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.dashboard-heading h1 { margin: 2px 0; color: #172033; font-size: 21px; font-weight: 700; }
.dashboard-heading p { margin: 0; color: #64748b; font-size: 12px; }
.dashboard-heading__aside { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.dashboard-heading__aside > div { text-align: right; }
.dashboard-heading__aside span, .dashboard-heading__aside strong { display: block; }
.dashboard-heading__aside span { color: #94a3b8; font-size: 9px; text-transform: uppercase; }
.dashboard-heading__aside strong { margin-top: 2px; color: #334155; font-size: 11px; }
.dashboard-stats { gap: 12px; }
.dashboard-stats .sp-stat-card {
  position: relative;
  min-height: 94px;
  padding: 16px 16px 14px 62px;
}
.dashboard-stats .sp-stat-card__icon {
  position: absolute;
  top: 18px;
  left: 15px;
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 7px;
}
.dashboard-stats .sp-stat-card__label { margin: 0 0 5px; font-size: 9px; }
.dashboard-stats .sp-stat-card__value { font-size: 23px; }
.dashboard-quick-actions { padding: 14px 17px; }
.dashboard-action-income { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.dashboard-action-income:hover { color: #166534; background: #dcfce7; border-color: #86efac; }
.dashboard-action-expense { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.dashboard-action-expense:hover { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }

/* ── Mobile treasury workflow ── */
.treasury-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.treasury-heading > div > span { color: #64748b; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.treasury-heading h1 { margin: 3px 0 2px; color: #172033; font-size: 24px; font-weight: 650; }
.treasury-heading p { margin: 0; color: #64748b; font-size: 13px; }
.treasury-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.treasury-action {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 14px;
  color: #334155;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  text-decoration: none;
}
button.treasury-action { width: 100%; font-family: inherit; cursor: pointer; }
.treasury-action > i { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 7px; font-size: 20px; }
.treasury-action > span { min-width: 0; }
.treasury-action strong, .treasury-action small { display: block; }
.treasury-action strong { color: #273449; font-size: 12px; }
.treasury-action small { margin-top: 2px; color: #64748b; font-size: 10px; }
.treasury-action.is-income > i { color: #15803d; background: #dcfce7; }
.treasury-action.is-expense > i { color: #b91c1c; background: #fee2e2; }
.treasury-action.is-complete > i { color: #1d4ed8; background: #dbeafe; }
.treasury-action:hover { color: #334155; border-color: #bfdbfe; }
.treasury-filters { margin-bottom: 16px; padding: 10px 12px; background: #fff; border: 1px solid var(--surface-border); border-radius: 8px; }
.treasury-export { color: #fff; background: #0f766e; border-color: #0f766e; }
.treasury-transaction-modal { border: 0; border-radius: 8px; }
.treasury-transaction-modal .modal-header { align-items: flex-start; padding: 19px 20px 15px; }
.treasury-transaction-modal .modal-header span { color: #64748b; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.treasury-transaction-modal .modal-title { margin-top: 2px; color: #172033; font-size: 18px; font-weight: 650; }
.treasury-transaction-modal .modal-body { padding: 18px 20px 8px; }
.treasury-transaction-modal .modal-footer { padding: 12px 20px 18px; border-top: 0; }
.treasury-transaction-modal .form-label { margin-bottom: 5px; color: #475569; font-size: 11px; font-weight: 650; }
.treasury-type-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 15px; }
.treasury-type-selector label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #dbe4ef;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
#quickTipoIngreso:checked + label { color: #166534; background: #dcfce7; border-color: #86efac; }
#quickTipoEgreso:checked + label { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }
.treasury-amount-field { position: relative; }
.treasury-amount-field > span { position: absolute; bottom: 8px; left: 13px; color: #64748b; font-size: 18px; font-weight: 600; }
.treasury-amount-field input { padding-left: 30px; font-size: 20px; font-weight: 650; }
.treasury-advanced-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 7px;
  margin-top: 13px;
  padding: 10px 0;
  color: #64748b;
  background: transparent;
  border: 0;
  border-top: 1px solid #edf1f5;
  font-family: inherit;
  font-size: 11px;
}
.treasury-advanced-toggle i:last-child { margin-left: auto; }
.treasury-mobile-transactions > a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 0;
  color: #334155;
  border-top: 1px solid #edf1f5;
  text-decoration: none;
}
.treasury-mobile-transactions__icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 7px; }
.treasury-mobile-transactions__icon.is-income { color: #15803d; background: #dcfce7; }
.treasury-mobile-transactions__icon.is-expense { color: #b91c1c; background: #fee2e2; }
.treasury-mobile-transactions__content { min-width: 0; flex: 1; }
.treasury-mobile-transactions__content strong, .treasury-mobile-transactions__content small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.treasury-mobile-transactions__content strong { font-size: 11px; }
.treasury-mobile-transactions__content small { color: #64748b; font-size: 9px; }
.treasury-mobile-transactions__amount { font-size: 11px; font-weight: 700; white-space: nowrap; }
.treasury-mobile-transactions__amount.is-income { color: #15803d; }
.treasury-mobile-transactions__amount.is-expense { color: #b91c1c; }

@media (max-width: 768px) {
  .culto-hero { align-items: flex-start; flex-direction: column; padding: 16px; }
  .culto-hero__actions { width: 100%; flex-wrap: wrap; }
  .culto-summary__grid { grid-template-columns: 1fr; gap: 12px; }
  .culto-song-modal .modal-header,
  .culto-song-modal .modal-body { padding-left: 18px; padding-right: 18px; }
  .culto-song-modal .modal-footer { padding: 12px 18px 18px; }
  .congregaciones-heading { align-items: flex-start; flex-direction: column; }
  .congregaciones-heading .sp-btn-sm { width: 100%; justify-content: center; }
  .congregaciones-stats { grid-template-columns: 1fr; }
  .congregaciones-toolbar { align-items: stretch; flex-direction: column; }
  .congregaciones-filter { width: 100%; }
  .congregaciones-toolbar > .sp-btn-sm { justify-content: center; }
  .congregaciones-grid { grid-template-columns: 1fr; }
  .reminders-heading { align-items: flex-start; flex-direction: column; }
  .reminders-heading .sp-btn-sm { width: 100%; justify-content: center; }
  .reminders-toolbar { align-items: stretch; flex-direction: column; }
  .reminders-toolbar label { width: 100%; }
  .reminders-toolbar .sp-btn-sm { justify-content: center; }
  .reminders-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reminders-people { grid-template-columns: 1fr; }
  .reminders-layout { grid-template-columns: 1fr; }
  .reminders-list__item { align-items: flex-start; flex-wrap: wrap; }
  .reminders-list__content { min-width: calc(100% - 92px); }
  .reminders-days { margin-left: 48px; }
  .families-heading, .family-detail-hero { align-items: flex-start; flex-direction: column; }
  .families-heading .sp-btn-sm, .family-detail-hero .sp-btn-sm { width: 100%; justify-content: center; }
  .families-stats, .family-detail-stats { grid-template-columns: 1fr; }
  .families-toolbar { align-items: stretch; flex-direction: column; }
  .families-filter { width: 100%; }
  .families-toolbar .sp-btn-sm { justify-content: center; }
  .families-grid, .family-detail-layout { grid-template-columns: 1fr; }
  .family-members article { align-items: flex-start; flex-wrap: wrap; }
  .family-member__identity { min-width: calc(100% - 86px); }
  .family-member__contact { width: auto; margin-left: 42px; flex: 1; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; gap: 14px; padding: 16px; }
  .dashboard-heading__aside { width: 100%; justify-content: space-between; }
  .dashboard-heading__aside > div { text-align: left; }
  .dashboard-heading__aside .sp-btn-sm { justify-content: center; }
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-stats .sp-stat-card { min-height: 86px; padding: 13px 10px 12px 52px; }
  .dashboard-stats .sp-stat-card__icon { top: 14px; left: 11px; width: 32px; height: 32px; }
  .dashboard-stats .sp-stat-card__value { font-size: 20px; }
  .dashboard-quick-actions > .d-flex { align-items: stretch !important; flex-direction: column; }
  .dashboard-quick-actions > .d-flex > .d-flex:last-child { display: grid !important; grid-template-columns: 1fr 1fr; width: 100%; }
  .dashboard-quick-actions .sp-btn-sm { justify-content: center; }
  .treasury-heading { align-items: flex-start; flex-direction: column; }
  .treasury-heading .sp-btn-sm { width: 100%; justify-content: center; }
  .treasury-quick-actions { grid-template-columns: 1fr 1fr; }
  .treasury-action.is-complete { grid-column: 1 / -1; }
  .treasury-filters > .d-flex { display: grid !important; grid-template-columns: 1fr 1fr; }
  .treasury-filters .form-select { max-width: none !important; }
  .treasury-filters .treasury-export { grid-column: 1 / -1; margin-left: 0 !important; justify-content: center; }
  .treasury-summary > div { width: 33.333%; }
  .treasury-summary .sp-stat-card { height: 100%; padding: 13px 10px; }
  .treasury-summary .sp-stat-card > div:first-child { font-size: 9px !important; }
  .treasury-summary .sp-stat-card > div:last-child { overflow-wrap: anywhere; font-size: 17px !important; }
}

@media (max-width: 420px) {
  .treasury-action { padding: 11px; }
  .treasury-action > i { width: 34px; height: 34px; flex-basis: 34px; }
  .treasury-action small { display: none; }
  .treasury-summary { --bs-gutter-x: 6px; }
  .treasury-transaction-modal .modal-header,
  .treasury-transaction-modal .modal-body { padding-right: 16px; padding-left: 16px; }
  .treasury-transaction-modal .modal-footer { padding-right: 16px; padding-left: 16px; }
  .dashboard-heading__main { align-items: flex-start; }
  .dashboard-heading__icon { width: 40px; height: 40px; flex-basis: 40px; }
  .dashboard-heading h1 { font-size: 18px; }
  .dashboard-heading__aside { align-items: stretch; flex-direction: column; }
  .dashboard-quick-actions > .d-flex > .d-flex:last-child { grid-template-columns: 1fr; }
}
