/* ==========================================================================
   SISTEMA DE REGISTRO CENSAL Y ALERTAS - EL CASTAÑO, ARAGUA
   Design System: Clean Modern Civic Blue, Glassmorphic & High-Fidelity UI
   Matching Stitch/Figma Design System
   ========================================================================== */

:root {
  /* Soft Pastel Palette inspired by Mobile Safety UI */
  --bg-page: #f6f7fb;
  --bg-card: #ffffff;
  --bg-card-subtle: #fafbfe;
  --bg-input: #f8f9fd;
  --bg-glass: rgba(255, 255, 255, 0.92);

  /* Primary: Soft Pastel Periwinkle Lavender */
  --primary: #6c72d6;
  --primary-hover: #5d63cb;
  --primary-light: #eff0fc;
  --primary-dark: #4b4fa3;

  /* Pastel Mint */
  --accent-emerald: #10b981;
  --accent-emerald-light: #ecfdf5;

  /* Pastel Coral Red */
  --alert-danger: #f87171;
  --alert-danger-light: #fef2f2;

  /* Pastel Warm Amber */
  --alert-warning: #f59e0b;
  --alert-warning-light: #fffbeb;

  /* Pastel Soft Sky */
  --alert-info: #60a5fa;
  --alert-info-light: #f0f7ff;

  --text-main: #2d3748;
  --text-muted: #718096;
  --text-dim: #a0aec0;

  --border-color: #e8ecf4;
  --border-focus: #9aa0fa;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 2px 8px rgba(108, 114, 214, 0.05);
  --shadow-md: 0 6px 20px rgba(108, 114, 214, 0.07);
  --shadow-lg: 0 12px 32px rgba(108, 114, 214, 0.10);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

/* Layout Container */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

/* Navigation Header */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 0;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  cursor: pointer;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: #0047ba;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 71, 186, 0.25);
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text h1 {
  font-size: 1.12rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
  border-color: rgba(55, 81, 254, 0.2);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* User Greeting (Sin sombreado ni contenedor gris) */
.user-greeting {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  white-space: nowrap;
}

.greeting-prefix {
  color: #64748b;
  font-weight: 500;
}

.user-greeting-name {
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 135px;
  display: inline-block;
}

/* Logout Open Door Button */
.btn-icon-logout {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-icon-logout:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
  transform: scale(1.04);
}

.role-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-weight: 700;
  text-transform: uppercase;
}

.role-admin {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.role-participante {
  background: #eff0fc;
  color: #6c72d6;
  border: 1px solid #dcdff8;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(108, 114, 214, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 18px rgba(108, 114, 214, 0.35);
  transform: translateY(-1px);
}

.btn-success {
  background: #10b981;
  color: #ffffff;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-outline {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: #475569;
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text-main);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
}

/* Cards & Panels */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.85rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #1e293b;
}

/* Expansive Scenic Hero Background with Gradient Fade */
.landing-hero-backdrop {
  position: relative;
  width: calc(100% + 2.5rem);
  margin-left: -1.25rem;
  margin-right: -1.25rem;
  margin-top: -1.25rem;
  max-width: none;
  overflow: hidden;
  background-image: 
    linear-gradient(180deg, rgba(30, 32, 54, 0.32) 0%, rgba(30, 32, 54, 0.44) 50%, rgba(246, 247, 251, 0.95) 88%, #f6f7fb 100%),
    url('/images/el_castano_hero.jpg');
  background-size: cover;
  background-position: center 62%;
  color: #ffffff;
  padding: 4.5rem 1.5rem 8rem;
  text-align: center;
}

.landing-hero-backdrop .hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.landing-hero-backdrop h2 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.85rem;
  line-height: 1.2;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
}

.landing-hero-backdrop p {
  font-size: 1.08rem;
  color: rgba(255, 255, 255, 0.95);
  max-width: 680px;
  margin: 0 auto;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  line-height: 1.5;
}

/* Floating Form Card Overlapping the Faded Background */
.form-card-overlapping {
  position: relative;
  z-index: 20;
  margin-top: -5rem !important;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  box-shadow: 0 16px 40px rgba(108, 114, 214, 0.08);
}

/* Community Stats Row (Matching Stitch Mockup 1) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-info h3 {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
  color: #1e293b;
}

.stat-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-weight: 500;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus {
  background: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(108, 114, 214, 0.15);
}

/* Input Prefixes */
.input-with-prefix {
  display: flex;
  gap: 0.4rem;
}

.input-prefix {
  width: 90px;
  flex-shrink: 0;
}

/* Accessible Senior Verification Box */
.accessible-verify-box {
  background: #f8f9fd;
  border: 1.5px solid #e0e4f5;
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  transition: var(--transition);
}

.accessible-verify-box:hover {
  border-color: #b4b9f8;
  background: #ffffff;
}

.accessible-check-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
}

.accessible-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.accessible-check-custom {
  width: 28px;
  height: 28px;
  background: #ffffff;
  border: 2px solid #b4b9f8;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(108, 114, 214, 0.1);
}

.accessible-checkbox:checked ~ .accessible-check-custom {
  background: #6c72d6;
  border-color: #6c72d6;
}

.accessible-check-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.accessible-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #2d3748;
}

.accessible-subtitle {
  font-size: 0.8rem;
  color: #718096;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.census-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.census-table th {
  background: #f8fafc;
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: #64748b;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.census-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  background: #ffffff;
}

.census-table tr:hover td {
  background: #f8fafc;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-sector {
  background: #eff0fc;
  color: #6c72d6;
  border: 1px solid #dcdff8;
}

.badge-vulnerable {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

/* ==========================================================================
   RESIDENT SCREEN: FULL BACKGROUND MAP & MOBILE SAFETY UI (MATCHING IMAGES)
   ========================================================================== */
#view-resident-zone {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: -1.25rem;
  margin-bottom: -2rem;
  overflow: hidden;
  padding: 0;
}

.resident-map-hero {
  position: relative;
  width: 100%;
  height: calc(100vh - 65px - 60px);
  height: calc(100dvh - 65px - 56px);
  min-height: calc(100dvh - 65px - 56px);
  overflow: hidden;
  box-shadow: none;
  border-radius: 0;
  border: none;
}

#resident-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Floating Controls Layer on Map (Organized, clean & compact) */
.map-floating-layer {
  position: absolute;
  top: 1.85rem; /* Bajado con suficiente margen para que nada se tape con el header */
  left: 1rem;
  right: 1rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  pointer-events: none;
}

.map-floating-topbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.map-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}

.map-topbar-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 0.42rem 0.85rem;
  border-radius: 9999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

/* Stack Vertical de Botones Superiores Derechos (Relieve y Ficha: solo icono, uno arriba del otro) */
.map-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: auto;
}

.map-square-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(108, 114, 214, 0.12);
  transition: var(--transition);
  flex-shrink: 0;
  box-sizing: border-box;
}

.map-square-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: scale(1.05);
}

/* Floating Map Navigation & Zoom Controls (Siempre Visibles: Flechita de ubicación encima de + y -) */
.map-navigation-controls {
  position: absolute;
  right: 1rem;
  top: 175px; /* Alineado armónicamente debajo de la columna de relieve y ficha */
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  pointer-events: auto;
}

.map-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  box-sizing: border-box;
}

.map-nav-btn:hover {
  color: var(--primary);
  background: #ffffff;
  transform: scale(1.05);
}

#btn-recenter-location {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(108, 114, 214, 0.35);
  box-shadow: 0 4px 14px rgba(108, 114, 214, 0.2);
}

#btn-recenter-location:hover {
  background: var(--primary);
  color: #ffffff;
}

.map-zoom-group {
  width: 38px;
  display: flex;
  flex-direction: column;
  border-radius: 11px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
}

.map-zoom-group .map-nav-btn {
  width: 100%;
  height: 36px;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.zoom-btn-bottom {
  border-top: 1px solid var(--border-color) !important;
}

/* Compact Location Pill (Non-intrusive, sleek backdrop blur) */
.map-floating-location-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border: 1.5px solid #e2e8f8;
  border-radius: 9999px;
  padding: 0.35rem 0.9rem;
  box-shadow: 0 4px 14px rgba(108, 114, 214, 0.12);
  font-size: 0.82rem;
  color: #1e293b;
}

.map-floating-location-pill strong {
  font-weight: 700;
  color: #1e293b;
}

.loc-pill-sep {
  color: #cbd5e1;
  font-weight: 700;
}

.loc-pill-sub {
  color: #64748b;
  font-size: 0.76rem;
}

/* Radar Pulse Marker on Map (Screen 2 Style) */
.map-radar-marker {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.15s ease-out;
}

.radar-pulse {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(108, 114, 214, 0.25);
  animation: radar-grow 2.2s infinite ease-out;
}

.radar-dot {
  position: relative;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #6c72d6;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(108, 114, 214, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes radar-grow {
  0% { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Bottom Sheet Overlaid on Background Map (Interactive Drawer with Drag Handle Only) */
.resident-zone-sheet {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% - 64px)); /* Plegado por defecto: asoma la barrita con altura visible reconocible */
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  width: calc(100% - 1.5rem);
  max-width: 640px;
  z-index: 900;
  background: #ffffff;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -8px 36px rgba(15, 23, 42, 0.16);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  box-sizing: border-box;
}

.resident-zone-sheet.expanded {
  transform: translateX(-50%) translateY(0); /* Desplegado completamente */
}

/* Handle Bar Button ("Solo la Barrita") */
.sheet-handle-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  padding: 0.45rem 0 0.85rem;
  user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.sheet-drag-pill {
  width: 54px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 9999px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.sheet-handle-bar:hover .sheet-drag-pill,
.resident-zone-sheet.expanded .sheet-drag-pill {
  background: var(--primary);
  transform: scaleX(1.15);
}

.sheet-expanded-content {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.resident-zone-sheet.expanded .sheet-expanded-content {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* Sheet SOS Section (Exact match to Screen 2 in Reference) */
.sheet-sos-section {
  text-align: center;
  padding-bottom: 0.35rem;
}

.sheet-sos-prompt {
  font-size: 1.18rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.35rem;
}

.sheet-sos-desc {
  font-size: 0.82rem;
  color: #718096;
  max-width: 440px;
  margin: 0 auto 1.35rem;
  line-height: 1.45;
}

.sheet-sos-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.sos-pulse-button {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c82e8, #6c72d6);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 0 0 8px rgba(108, 114, 214, 0.18), 0 6px 18px rgba(108, 114, 214, 0.3);
  transition: var(--transition);
  flex-shrink: 0;
  animation: pulse-ring 2.5s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 4px rgba(108, 114, 214, 0.25); }
  50% { box-shadow: 0 0 0 16px rgba(108, 114, 214, 0.06); }
  100% { box-shadow: 0 0 0 4px rgba(108, 114, 214, 0.25); }
}

.sos-pulse-button:hover {
  transform: scale(1.04);
}

.btn-emergency-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 9999px;
  border: 2px solid #f87171;
  background: #ffffff;
  color: #ef4444;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

.btn-emergency-pill:hover {
  background: #fef2f2;
  border-color: #ef4444;
  transform: translateY(-1px);
}

/* Warning Card (Exact Match to Reference Image Yellow & Mustard-Orange) */
.zone-warning-card {
  background: #ffec9e; /* Amarillo pastel cálido suave como la imagen de referencia */
  border-radius: 20px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 4px 18px rgba(180, 110, 20, 0.08);
  border: none;
  margin-bottom: 1.25rem;
}

.warning-card-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.15rem;
}

.warning-card-main {
  flex: 1;
}

.warning-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Palabra de alerta: mostaza / amarillo naranjoso cálido que resalta directamente sobre el amarillo, sin subrayado ni fondo */
.warning-label {
  font-size: 1.28rem;
  font-weight: 800;
  color: #e2542a; /* Mostaza naranjoso cálido idéntico al "Warning!" de la imagen */
  letter-spacing: -0.01em;
  background: transparent !important;
  border: none !important;
  text-decoration: none !important;
  padding: 0;
  margin: 0;
  display: inline-block;
  line-height: 1.2;
}

.warning-time {
  font-size: 0.74rem;
  color: #78531e;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.warning-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #4a3410;
  margin-top: 0.15rem;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.warning-desc {
  font-size: 0.86rem;
  color: #584422; /* Tono cálido oscuro legible como el cuerpo de texto de la imagen */
  line-height: 1.45;
  font-weight: 500;
  margin: 0;
}

.warning-card-icon-aside {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.88;
}

/* Dedicated Profile Page Styles */
.profile-page-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 1.5rem;
}

.profile-hero-card {
  padding: 1.5rem 1.75rem;
}

.profile-hero-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.profile-hero-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #eff0fc;
  border: 2px solid #dcdff8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-hero-meta h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.35rem;
}

.profile-tags-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.profile-details-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.profile-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.pdetail-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #eff0fc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdetail-info {
  display: flex;
  flex-direction: column;
}

.pdetail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.pdetail-value {
  font-size: 0.92rem;
  color: #1e293b;
  font-weight: 700;
}

.profile-sync-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: #065f46;
}

.profile-sync-callout strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

/* Bottom Navigation Bar for Mobile */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #6c72d6;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0.75rem 0.5rem;
  box-shadow: 0 -4px 20px rgba(108, 114, 214, 0.22);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: none;
  border: none;
  padding: 0.35rem 1.5rem;
  border-radius: 12px;
}

.bottom-nav-item:hover, .bottom-nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.bottom-nav-item span.icon {
  font-size: 1.25rem;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}

/* Toasts (Desactivados por completo) */
#toast-container {
  display: none !important;
}

.toast {
  display: none !important;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  color: #1e293b;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease forwards;
  min-width: 280px;
  max-width: 420px;
}

.toast-success { border-left: 4px solid var(--accent-emerald); }
.toast-error { border-left: 4px solid var(--alert-danger); }
.toast-info { border-left: 4px solid var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Ficha Censal Digital Grid */
.participant-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
}

/* ==========================================================================
   COMPREHENSIVE MOBILE RESPONSIVENESS & ZERO-HORIZONTAL-SCROLL RULES
   ========================================================================== */
@media (max-width: 768px) {
  /* Prevent horizontal scroll anywhere */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .container {
    padding: 0 0.85rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Navigation Header on Mobile */
  .navbar {
    padding: 0.5rem 0 !important;
  }

  .nav-container {
    gap: 0.5rem !important;
  }

  .nav-links {
    display: none !important; /* El móvil utiliza la barra de navegación inferior fija */
  }

  .brand-text p {
    display: none !important; /* Ocultar subtítulo largo en móvil para evitar aglomeración */
  }

  .brand-text h1 {
    font-size: 1.02rem !important;
    line-height: 1.2 !important;
  }

  .brand-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
  }

  .user-greeting {
    font-size: 0.8rem !important;
    gap: 0.25rem !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .user-greeting-name {
    max-width: 90px !important;
    font-size: 0.8rem !important;
  }

  /* Full-bleed sections adjusted to mobile container padding */
  .landing-hero-backdrop {
    width: calc(100% + 1.7rem) !important;
    margin-left: -0.85rem !important;
    margin-right: -0.85rem !important;
    max-width: none !important;
  }

  #view-resident-zone {
    width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    margin-top: -1.25rem !important;
    margin-bottom: -2rem !important;
    padding: 0 !important;
  }

  /* Map View & Floating Controls (Full screen edge-to-edge, zero borders) */
  .resident-map-hero {
    width: 100% !important;
    height: calc(100vh - 60px - 56px) !important;
    height: calc(100dvh - 60px - 56px) !important;
    min-height: calc(100dvh - 60px - 56px) !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    border: none !important;
  }

  .map-floating-layer {
    top: 1.65rem !important; /* Bajado con holgura para que el título y el botón de relieve nunca rocen el header */
    left: 0.85rem !important;
    right: 0.85rem !important;
    gap: 0.45rem !important;
  }

  .map-topbar-title {
    font-size: 0.82rem !important;
    padding: 0.35rem 0.75rem !important;
  }

  .map-actions-stack {
    gap: 0.35rem !important;
  }

  .map-square-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
  }

  .map-navigation-controls {
    right: 0.85rem !important; /* Mismo margen que la barra superior para perfecta alineación */
    top: 158px !important;
    gap: 0.45rem !important;
  }

  .map-nav-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
  }

  .map-zoom-group {
    width: 34px !important;
  }

  .map-zoom-group .map-nav-btn {
    width: 100% !important;
    height: 33px !important;
  }

  .btn-icon-logout {
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
  }

  .map-floating-location-pill {
    padding: 0.28rem 0.75rem !important;
    font-size: 0.76rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  }

  /* Resident Bottom Sheet on Mobile (Interactive Collapsible Drawer - Drag Handle peeks with clear height) */
  .resident-zone-sheet {
    position: fixed !important;
    bottom: 56px !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(calc(100% - 64px)) !important; /* Asoma 64px de tarjeta para que se entienda claramente que es un desplegable */
    width: calc(100% - 1rem) !important;
    max-width: 100% !important;
    border-radius: 28px 28px 0 0 !important;
    padding: 0.65rem 0.85rem 1.65rem !important;
    gap: 1rem !important;
    box-sizing: border-box !important;
    z-index: 900 !important;
  }

  .resident-zone-sheet.expanded {
    transform: translateX(-50%) translateY(0) !important;
  }

  .sheet-sos-prompt {
    font-size: 1.02rem !important;
  }

  .sheet-sos-desc {
    font-size: 0.78rem !important;
    margin-bottom: 0.95rem !important;
    line-height: 1.35 !important;
  }

  .sheet-sos-controls {
    gap: 1.15rem !important;
  }

  .sos-pulse-button {
    width: 72px !important;
    height: 72px !important;
    font-size: 1.2rem !important;
  }

  .btn-emergency-pill {
    padding: 0.5rem 0.95rem !important;
    font-size: 0.8rem !important;
  }

  /* Profile Page Grid on Mobile */
  .profile-page-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .profile-hero-card {
    padding: 1.25rem 1rem !important;
  }

  .profile-hero-header {
    gap: 0.85rem !important;
    padding-bottom: 1rem !important;
  }

  .profile-hero-avatar {
    width: 56px !important;
    height: 56px !important;
  }

  .profile-hero-meta h3 {
    font-size: 1.18rem !important;
  }

  /* Warning Card on Mobile */
  .zone-warning-card {
    padding: 0.95rem 1rem !important;
    border-radius: 16px !important;
    margin-bottom: 0.85rem !important;
    box-sizing: border-box !important;
  }

  .warning-label {
    font-size: 1.15rem !important;
  }

  .warning-desc {
    font-size: 0.82rem !important;
  }

  .warning-card-icon-aside {
    width: 44px !important;
    height: 44px !important;
  }

  .warning-card-icon-aside svg {
    width: 40px !important;
    height: 40px !important;
  }

  /* Profile Card on Mobile */
  .zone-profile-card {
    padding: 1rem !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }

  /* Landing Hero & Registration Form on Mobile */
  .landing-hero-backdrop {
    padding: 3.5rem 1rem 6.5rem !important;
  }

  .landing-hero-backdrop h2 {
    font-size: 1.7rem !important;
  }

  .landing-hero-backdrop p {
    font-size: 0.9rem !important;
  }

  .form-card-overlapping {
    margin-top: -3.8rem !important;
    padding: 1.5rem 1rem !important;
    border-radius: 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  /* Ficha Censal Grid on Mobile */
  .participant-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Statistics Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
  }

  .stat-card {
    padding: 0.85rem !important;
  }

  .stat-info h3 {
    font-size: 1.3rem !important;
  }

  /* Bottom Navigation Bar on Mobile */
  .bottom-nav-bar {
    padding: 0.55rem 0.25rem !important;
  }

  .bottom-nav-item {
    font-size: 0.7rem !important;
  }

  .bottom-nav-item svg {
    width: 18px !important;
    height: 18px !important;
  }

  /* Toasts on Mobile */
  #toast-container {
    left: 1rem !important;
    right: 1rem !important;
    bottom: 5rem !important;
  }

  .toast {
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

/* ============================================================ */
/* PERFIL CIUDADANO (ESTILO MOBILE INSPIRADO EN MOCKUP)         */
/* ============================================================ */
.profile-container-mobile {
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: 2.5rem;
}

/* Curved Hero Banner with Civic Modern Gradient */
.profile-hero-curved-banner {
  position: relative;
  background: linear-gradient(150deg, #1a1e4a 0%, #2b3270 50%, #464da0 100%);
  border-radius: 0 0 36px 36px;
  padding: 1.25rem 1.25rem 2.8rem 1.25rem;
  box-shadow: 0 12px 30px -8px rgba(30, 34, 74, 0.25);
  overflow: hidden;
}

/* Organic Civic Accent Glow in Background */
.profile-hero-curved-banner::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -50px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(108, 114, 214, 0.45) 0%, rgba(93, 99, 203, 0.2) 50%, transparent 75%);
  border-radius: 50%;
  pointer-events: none;
}

.profile-hero-curved-banner::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.profile-banner-nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.profile-nav-back-btn,
.profile-nav-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-nav-back-btn:hover,
.profile-nav-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.profile-banner-tag {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.75px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.profile-avatar-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-qr-badge-card {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 22px;
  background: #ffffff;
  border: 4px solid #ffffff;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.65rem;
  padding: 4px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-qr-badge-card:hover {
  transform: scale(1.03);
  box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.35);
}

.profile-qr-box {
  width: 92px;
  height: 92px;
  border-radius: 14px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.profile-qr-box canvas,
.profile-qr-box img {
  width: 92px !important;
  height: 92px !important;
  display: block;
}

.profile-btn-download-qr {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 0.8rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.profile-btn-download-qr:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.profile-verified-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #10b981;
  border: 2.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.profile-user-name {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.2rem 0;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-user-role {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 0.65rem 0;
  font-weight: 500;
}

.profile-id-pills {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
}

.profile-pill-id {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.profile-pill-status {
  background: #10b981;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.22rem 0.6rem;
  border-radius: 9999px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

/* Floating Metrics Strip Card */
.profile-stats-card {
  position: relative;
  z-index: 10;
  margin: -1.75rem 1rem 1.25rem 1rem;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 14px 35px -8px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.85);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0.95rem 0.5rem;
}

.profile-stat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pstat-val {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
}

.pstat-lbl {
  font-size: 0.76rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 0.15rem;
}

.pstat-sub {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 500;
}

.pstat-divider {
  width: 1px;
  height: 32px;
  background: #e2e8f0;
}

/* Section Cards */
.profile-section-card {
  margin: 0 1rem 1.5rem 1rem;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 6px 20px -4px rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 1.25rem;
}

.profile-sec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  gap: 0.75rem;
}

.profile-sec-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.profile-sec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-sec-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.profile-sec-subtitle {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0 0 1rem 0;
  line-height: 1.35;
}

.btn-add-family-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6c72d6 0%, #5d63cb 100%);
  color: #ffffff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(108, 114, 214, 0.28);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  line-height: 0;
}

.btn-add-family-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
  pointer-events: none;
}

.btn-add-family-icon:hover {
  background: #4b4fa3;
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(108, 114, 214, 0.38);
}

/* Emergency Family Member Card */
.emergency-family-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.emergency-member-card {
  background: #fdfdfd;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  padding: 0.95rem 1rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: all 0.2s ease;
}

.emergency-member-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.emember-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.emember-badges {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.emember-relation-badge {
  background: #eff0fc;
  color: #4b4fa3;
  border: 1px solid #dce0fb;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  letter-spacing: 0.2px;
}

.emember-age-badge {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
}

.btn-delete-emember {
  background: none;
  border: none;
  color: #94a3b8;
  padding: 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-delete-emember:hover {
  background: #fee2e2;
  color: #ef4444;
}

.emember-name {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.15rem 0;
}

.emember-meta-text {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0 0 0.65rem 0;
}

.emember-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px dashed #e2e8f0;
}

.emember-cond-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-call-emergency {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #059669;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-call-emergency:hover {
  background: #d1fae5;
  color: #047857;
  transform: translateY(-1px);
}

/* Empty State Card (Sin duplicar botón) */
.emergency-empty-state {
  text-align: center;
  padding: 1.75rem 1.25rem;
  background: #fafbfe;
  border-radius: 16px;
  border: 1.5px dashed #cbd5e1;
}

.emergency-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #eff0fc;
  color: #6c72d6;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem auto;
}

.emergency-empty-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 0.35rem 0;
}

.emergency-empty-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

