/* ============================================
   SOS Venezuela Terremoto 2026 - Estilos
   Paleta: Blanco y Negro, con acentos de emergencia
   ============================================ */

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:        #0a0a0a;
  --gray-900:     #1a1a1a;
  --gray-800:     #2d2d2d;
  --gray-700:     #404040;
  --gray-600:     #595959;
  --gray-400:     #9a9a9a;
  --gray-200:     #e0e0e0;
  --gray-100:     #f4f4f4;
  --white:        #ffffff;

  --red-danger:   #c0392b;
  --red-light:    #fdf0ef;
  --red-border:   #e74c3c;
  --amber:        #d4860a;
  --amber-light:  #fef9ee;
  --green:        #1e7e34;
  --green-light:  #edf7ee;
  --blue-link:    #1a5fa8;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow:    0 2px 8px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
  --transition: 0.18s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--black);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: var(--blue-link); }
a:hover { text-decoration: underline; }

/* ---- HEADER ---- */
.site-header {
  background: var(--black);
  color: var(--white);
  padding: 1rem 0;
  border-bottom: 4px solid var(--red-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sos-badge {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -1px;
  background: var(--red-border);
  color: var(--white);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  animation: pulse-sos 2s infinite;
}

@keyframes pulse-sos {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

.site-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
}

.site-subtitle {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--gray-400);
  margin-top: 0.15rem;
}

.date-badge {
  background: var(--gray-800);
  border: 1px solid var(--gray-700);
  color: var(--gray-200);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ---- ALERT BANNER ---- */
.alert-banner {
  background: #fff3cd;
  border-bottom: 2px solid var(--amber);
  padding: 0.75rem 0;
}

.alert-content {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 0.05rem; }

.alert-content p {
  font-size: 0.875rem;
  color: var(--gray-900);
  line-height: 1.5;
  flex: 1;
}

.alert-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--gray-600);
  flex-shrink: 0;
  padding: 0.1rem 0.25rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.alert-close:hover { background: rgba(0,0,0,0.1); }

/* ---- STATS BAR ---- */
.stats-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  transition: box-shadow var(--transition);
}

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

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--black);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* ---- NAVIGATION ---- */
.main-nav {
  background: var(--white);
  border-bottom: 2px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.9rem 1.2rem;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  position: relative;
  bottom: -2px;
}

.nav-tab:hover { color: var(--black); background: var(--gray-100); }

.nav-tab.active {
  color: var(--black);
  border-bottom-color: var(--black);
  font-weight: 700;
}

.tab-icon { font-size: 1rem; }

/* ---- MAIN CONTENT ---- */
.main-content {
  flex: 1;
  padding: 2rem 1.25rem;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }

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

/* ---- PANEL HEADER ---- */
.panel-header { margin-bottom: 1.5rem; }
.panel-header h2 { font-size: 1.6rem; font-weight: 800; color: var(--black); }
.panel-desc { font-size: 0.9rem; color: var(--gray-600); margin-top: 0.4rem; max-width: 680px; }

/* ---- RESPONSIBILITY NOTICE ---- */
.responsibility-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--red-light);
  border: 1.5px solid var(--red-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
}

.notice-icon { font-size: 1.5rem; flex-shrink: 0; }
.notice-text { font-size: 0.875rem; color: var(--gray-900); line-height: 1.6; }
.notice-text strong { color: var(--red-danger); }

/* ---- FORM STYLES ---- */
.registro-form { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }

.form-section {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--gray-200);
}
.form-section:last-of-type { border-bottom: none; }

.form-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--gray-100);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

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

.form-group.full-width { grid-column: 1 / -1; }
.form-group.required label::after { content: ' *'; color: var(--red-danger); }

label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--gray-700);
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="email"],
select,
textarea {
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--black);
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}

input::placeholder, textarea::placeholder { color: var(--gray-400); }

select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23595959' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; cursor: pointer; }

textarea { resize: vertical; min-height: 80px; }

.field-hint { font-size: 0.75rem; color: var(--gray-400); line-height: 1.4; }

input.error, select.error, textarea.error { border-color: var(--red-border); }

/* ---- CONSENT CHECKBOX ---- */
.form-footer {
  padding: 1.5rem 2rem;
  background: var(--gray-100);
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--gray-200);
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex: 1;
  min-width: 220px;
}

.consent-check input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--black);
}

.consent-check label {
  font-size: 0.83rem;
  font-weight: 400;
  cursor: pointer;
  color: var(--gray-700);
}

/* ---- BUTTONS ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.7rem 1.5rem;
  border: 2px solid var(--black);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--gray-800);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  background: var(--gray-400);
  border-color: var(--gray-400);
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.btn-secondary:hover { border-color: var(--black); background: var(--gray-100); }

.btn-submit { min-width: 180px; }
.btn-icon { font-size: 1rem; }

/* ---- FORM MESSAGE ---- */
.form-message {
  margin: 0 2rem 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-message.success {
  background: var(--green-light);
  border: 1.5px solid var(--green);
  color: #155724;
}

.form-message.error {
  background: var(--red-light);
  border: 1.5px solid var(--red-border);
  color: var(--red-danger);
}

.form-message.hidden { display: none; }

/* ---- SEARCH ---- */
.search-bar-container {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0 0.5rem 0 1rem;
  transition: border-color var(--transition);
  background: var(--white);
  margin-bottom: 0.85rem;
}

.search-bar:focus-within { border-color: var(--black); }

.search-icon { font-size: 1rem; color: var(--gray-400); flex-shrink: 0; }

.search-bar input {
  border: none;
  box-shadow: none;
  flex: 1;
  font-size: 1rem;
  padding: 0.65rem 0.25rem;
}

.search-bar input:focus { box-shadow: none; }

.btn-search {
  background: var(--black);
  color: var(--white);
  border: none;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.btn-search:hover { background: var(--gray-800); }

.search-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-filters select {
  flex: 1;
  min-width: 160px;
  font-size: 0.83rem;
  padding: 0.5rem 0.75rem;
}

.search-bar.mini {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0 0.75rem;
  margin-bottom: 1rem;
  gap: 0.4rem;
  display: flex;
  align-items: center;
}

.search-bar.mini input {
  border: none;
  box-shadow: none;
  font-size: 0.875rem;
  padding: 0.55rem 0.25rem;
  flex: 1;
}

.search-bar.mini input:focus { box-shadow: none; }

/* ---- RESULTS ---- */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.record-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem 1rem;
  align-items: start;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.record-card:hover { box-shadow: var(--shadow); border-color: var(--gray-400); }

.record-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  font-weight: 700;
}

.record-avatar.nino    { background: #e8f4fd; }
.record-avatar.adulto   { background: var(--gray-100); }
.record-avatar.adulto_mayor { background: #fff8e7; }

.record-info { min-width: 0; }

.record-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.record-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.record-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
}

.tag-tipo-nino      { background: #e0f0ff; color: #1565c0; }
.tag-tipo-adulto    { background: var(--gray-100); color: var(--gray-700); }
.tag-tipo-am        { background: #fff8e7; color: #7c5c00; }

.tag-salud-sano     { background: var(--green-light);  color: var(--green); }
.tag-salud-leve     { background: #fff8e0; color: #8a6200; }
.tag-salud-grave    { background: #fff0eb; color: #c0392b; }
.tag-salud-critico  { background: #fde8e8; color: #8b0000; }
.tag-salud-fallecido{ background: #2d2d2d; color: #ffffff; }
.tag-salud-desconocido { background: var(--gray-100); color: var(--gray-600); }

.tag-reg-encontrado { background: var(--green-light);  color: var(--green); }
.tag-reg-buscado    { background: var(--red-light);    color: var(--red-danger); }
.tag-reg-en_refugio { background: #e8f4fd; color: #1565c0; }
.tag-reg-hospitalizado { background: #fff0eb; color: #c0392b; }

.record-location {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-top: 0.35rem;
}

.record-location span { margin-right: 0.75rem; }

.record-actions { flex-shrink: 0; }

.record-timestamp {
  font-size: 0.72rem;
  color: var(--gray-400);
  white-space: nowrap;
}

/* ---- ESTADOS GRID ---- */
.estados-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.estado-btn {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}

.estado-btn:hover {
  border-color: var(--black);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.estado-btn-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--black);
  display: block;
}

.estado-btn-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--black);
  display: block;
  margin-bottom: 0.1rem;
}

.estado-btn-label {
  font-size: 0.7rem;
  color: var(--gray-400);
  font-weight: 500;
}

.estado-btn.has-data {
  border-color: var(--black);
  background: var(--black);
}

.estado-btn.has-data .estado-btn-name,
.estado-btn.has-data .estado-btn-count,
.estado-btn.has-data .estado-btn-label { color: var(--white); }

/* ---- ESTADO DETALLES ---- */
.estado-detalles { display: none; }
.estado-detalles.visible { display: block; }

.estado-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
  flex-wrap: wrap;
}

.estado-header h3 { font-size: 1.3rem; font-weight: 800; }

.estado-count {
  background: var(--black);
  color: var(--white);
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

.btn-back {
  background: none;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-back:hover { border-color: var(--black); background: var(--gray-100); }

/* ---- ANUNCIOS ---- */
.anuncios-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.anuncio-form-container, .anuncios-list-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.anuncio-form-container h3,
.anuncios-list-container h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.anuncio-form-container .registro-form {
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.anuncio-form-container .form-section {
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.anuncio-form-container .form-footer {
  padding: 1rem 0 0;
  background: none;
  border: none;
  flex-direction: column;
  gap: 0.75rem;
}

.count-badge {
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.anuncios-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.anuncio-card {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.anuncio-card:hover { box-shadow: var(--shadow); border-color: var(--gray-500, #888); }

.anuncio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.anuncio-nombre {
  font-size: 1rem;
  font-weight: 700;
  color: var(--black);
}

.anuncio-ts {
  font-size: 0.7rem;
  color: var(--gray-400);
  white-space: nowrap;
}

.anuncio-desc {
  font-size: 0.85rem;
  color: var(--gray-700);
  line-height: 1.5;
  margin-bottom: 0.6rem;
}

.anuncio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.anuncio-contacto {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--black);
}

.anuncio-ubicacion {
  font-size: 0.75rem;
  color: var(--gray-500, #888);
}

/* ---- CONFIG ---- */
.config-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.config-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--gray-100);
}

.config-steps {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.config-steps li {
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  padding-left: 0.25rem;
}

.config-steps code {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.4rem;
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
  word-break: break-all;
}

.config-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
}

.config-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.config-apps-script .code-block-wrapper { position: relative; }

.btn-copy {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.75rem;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  z-index: 2;
}

.btn-copy:hover { border-color: var(--black); background: var(--gray-100); }

.code-block {
  background: var(--gray-900);
  color: #a8d8a8;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre;
  max-height: 450px;
  overflow-y: auto;
}

/* ---- EMPTY & LOADING STATES ---- */
.empty-state, .loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--white);
  border-radius: var(--radius);
  border: 2px dashed var(--gray-200);
}

.empty-icon { font-size: 3rem; }
.empty-state p, .loading-state p { color: var(--gray-600); font-size: 0.9rem; }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- MODAL ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden { display: none; }

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  cursor: pointer;
}

.modal-box {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  max-width: 440px;
  width: 90%;
  text-align: center;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.modal-box h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.5rem; }
.modal-box p { font-size: 0.9rem; color: var(--gray-600); margin-bottom: 1rem; }
.modal-id { font-size: 0.8rem; color: var(--gray-400); margin-bottom: 1.5rem; font-family: monospace; }

/* ---- TOAST ---- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
  max-width: 340px;
}

.toast {
  background: var(--black);
  color: var(--white);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.toast.success { background: var(--green); }
.toast.error   { background: var(--red-danger); }
.toast.warning { background: var(--amber); color: var(--black); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--black);
  color: var(--gray-200);
  margin-top: auto;
  padding: 2rem 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding-bottom: 1.5rem;
}

.footer-left p, .footer-right p {
  font-size: 0.83rem;
  line-height: 1.7;
  color: var(--gray-400);
}

.footer-left p:first-child, .footer-right p:first-child { font-weight: 700; color: var(--white); }
.footer-right a { color: var(--gray-200); }

.footer-bottom {
  border-top: 1px solid var(--gray-800);
  padding: 0.75rem 1.25rem;
  text-align: center;
}

.footer-bottom p { font-size: 0.75rem; color: var(--gray-600); }

/* ---- HIDDEN ---- */
.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .anuncios-layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .site-title { font-size: 1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-section { padding: 1.25rem 1rem; }
  .form-footer { padding: 1rem; flex-direction: column; }
  .panel-header h2 { font-size: 1.25rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .record-card { grid-template-columns: auto 1fr; }
  .record-card > .record-actions { grid-column: 2; }
  .config-card { padding: 1rem; }
  .nav-tab { padding: 0.75rem 0.85rem; font-size: 0.8rem; }
  .tab-icon { display: none; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .stat-number { font-size: 1.5rem; }
  .sos-badge { font-size: 1.5rem; }
}

/* ---- PRINT ---- */
@media print {
  .main-nav, .alert-banner, .site-footer, .btn-primary, .btn-secondary { display: none !important; }
  .tab-panel { display: block !important; }
}
