@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Variables ── */
:root {
  color-scheme: light dark;

  /* Light */
  --ink: #0f1a17;
  --ink-2: #253630;
  --muted: #4a5c56;
  --muted-2: #6b7d77;
  --line: #d4ddd9;
  --line-2: #e8eeeb;
  --paper: #f4f6f4;
  --panel: #ffffff;
  --panel-2: #f9faf9;
  --glass: rgba(255,255,255,0.72);

  --red: #c9342a;
  --red-2: #e74c42;
  --orange: #d47820;
  --orange-2: #f0962e;
  --green: #1f7d4e;
  --green-2: #28a865;
  --blue: #1e6bbf;
  --blue-2: #2b84e8;
  --gray: #6b7d77;
  --teal: #0a6a74;
  --teal-2: #0d8a97;
  --amber: #8a6a14;
  --purple: #6c2fd4;
  --purple-2: #8b52f5;
  --darkred: #7d1414;
  --magenta: #a81254;
  --magenta-2: #d01f6e;

  --focus: var(--teal);
  --focus-2: var(--teal-2);

  --shadow-sm: 0 1px 3px rgba(15,26,23,0.08), 0 1px 2px rgba(15,26,23,0.06);
  --shadow-md: 0 4px 12px rgba(15,26,23,0.10), 0 2px 4px rgba(15,26,23,0.06);
  --shadow-lg: 0 16px 40px rgba(15,26,23,0.12), 0 4px 8px rgba(15,26,23,0.06);
  --shadow-xl: 0 32px 64px rgba(15,26,23,0.16);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition: 180ms cubic-bezier(0.4,0,0.2,1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8f0ed;
    --ink-2: #c8d8d2;
    --muted: #8fa89e;
    --muted-2: #6b8278;
    --line: #2a3d36;
    --line-2: #1e2e28;
    --paper: #0d1714;
    --panel: #14211d;
    --panel-2: #1a2c26;
    --glass: rgba(20,33,29,0.82);

    --red: #e84c42;
    --red-2: #f76e65;
    --orange: #f09030;
    --orange-2: #f5a84a;
    --green: #2db362;
    --green-2: #45cc7a;
    --blue: #3b8af0;
    --blue-2: #5ca4ff;
    --gray: #8fa89e;
    --teal: #14aabb;
    --teal-2: #22ccd6;
    --amber: #c4a020;
    --purple: #9b6af0;
    --purple-2: #b990ff;
    --darkred: #c43030;
    --magenta: #e0286a;
    --magenta-2: #f55a8a;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.36);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.42);
    --shadow-xl: 0 32px 64px rgba(0,0,0,0.5);
  }
}

body.dark-mode {
  --ink: #e8f0ed;
  --ink-2: #c8d8d2;
  --muted: #8fa89e;
  --muted-2: #6b8278;
  --line: #2a3d36;
  --line-2: #1e2e28;
  --paper: #0d1714;
  --panel: #14211d;
  --panel-2: #1a2c26;
  --glass: rgba(20,33,29,0.82);
  --teal: #14aabb;
  --teal-2: #22ccd6;
  color-scheme: dark;
}

body.light-mode {
  --ink: #0f1a17;
  --ink-2: #253630;
  --muted: #4a5c56;
  --line: #d4ddd9;
  --paper: #f4f6f4;
  --panel: #ffffff;
  --glass: rgba(255,255,255,0.72);
  --teal: #0a6a74;
  --teal-2: #0d8a97;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }
p { margin: 0; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--line-2); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 0 clamp(16px,4vw,48px);
  background: var(--glass);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.mark {
  width: 22px;
  height: 22px;
  background: conic-gradient(from 0deg, var(--red), var(--orange), var(--green), var(--blue), var(--magenta), var(--red));
  border-radius: 50%;
  flex-shrink: 0;
  animation: spin-slow 12s linear infinite;
}

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

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav a:hover { color: var(--ink); background: var(--line-2); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover:not(:disabled) { background: var(--ink-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-danger:hover:not(:disabled) { background: var(--red-2); transform: translateY(-1px); }

.btn-ghost {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover:not(:disabled) { background: var(--panel-2); border-color: var(--muted-2); }
.btn-ghost.active { background: var(--panel-2); border-color: var(--ink); color: var(--ink); }

.btn-teal {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.btn-teal:hover:not(:disabled) { background: var(--teal-2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(10,106,116,0.3); }

.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { min-height: 48px; padding: 0 24px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-xl { min-height: 56px; padding: 0 32px; font-size: 17px; border-radius: var(--radius-lg); font-weight: 700; }

/* Legacy compat */
.icon-button { composes: btn btn-ghost; min-width: 44px; font-weight: 700; }
.ghost-button { composes: btn btn-ghost; }
.primary-action { composes: btn btn-primary; }
.secondary-action { composes: btn btn-ghost; }

/* ── Urgency badge ── */
.badge-urgent {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  animation: pulse-urgent 2s ease-in-out infinite;
}

@keyframes pulse-urgent {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,52,42,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(201,52,42,0); }
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: min(720px, calc(90vh - 60px));
  display: grid;
  grid-template-columns: minmax(0,1fr) 380px;
  gap: clamp(24px,6vw,80px);
  align-items: center;
  padding: clamp(40px,7vw,96px) clamp(16px,6vw,72px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 60% -20%, rgba(10,106,116,0.07) 0%, transparent 70%),
              radial-gradient(ellipse 60% 80% at 0% 80%, rgba(30,107,191,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.hero-copy { max-width: 820px; position: relative; }

.eyebrow {
  color: var(--teal);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  margin-bottom: 16px;
}

h1 {
  font-size: clamp(38px,5.5vw,76px);
  line-height: 0.97;
  letter-spacing: -0.02em;
  font-weight: 900;
  color: var(--ink);
}

h2 {
  font-size: clamp(22px,2.8vw,34px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h3 { font-size: 18px; font-weight: 700; color: var(--ink); }

.hero p {
  max-width: 640px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
  margin-top: 16px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* ── Live stats bar ── */
.live-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 28px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.live-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.live-stat-value {
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}

.live-stat-value.urgent { color: var(--red); }

.live-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
  margin-right: 4px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* ── Safety panel ── */
.safety-panel {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.safety-panel strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.safety-panel strong::before {
  content: '🛡️';
  font-size: 16px;
}

.safety-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.safety-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: var(--panel-2);
  flex-shrink: 0;
}

/* ── Sections ── */
.section {
  padding: 40px clamp(16px,5vw,64px);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin-top: 6px;
  max-width: 700px;
}

/* ── Alerts ── */
.alert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.alert-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.alert-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.alert-card.critico { border-left-color: var(--red); }
.alert-card.alto { border-left-color: var(--orange); }
.alert-card.medio { border-left-color: var(--amber); }
.alert-card.bajo { border-left-color: var(--green); }

.alert-card strong { font-size: 14px; font-weight: 700; }
.alert-card span { font-size: 13px; color: var(--muted); }

/* ── Map section ── */
.map-section {
  padding: 32px clamp(16px,5vw,64px) 0;
  border-bottom: 1px solid var(--line);
}

.map-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.layer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.layer-toggle:hover { border-color: var(--muted-2); background: var(--panel-2); }
.layer-toggle input { width: auto; margin: 0; accent-color: var(--teal); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.legend span { display: flex; align-items: center; gap: 5px; }

.dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-red { background: var(--red); }
.dot-orange { background: var(--orange); }
.dot-green { background: var(--green); }
.dot-blue { background: var(--blue); }
.dot-gray { background: var(--gray); }
.dot-teal { background: var(--teal); }
.dot-amber { background: var(--amber); }
.dot-purple { background: var(--purple); }
.dot-darkred { background: var(--darkred); }
.dot-magenta { background: var(--magenta); }

/* Legacy dots */
.red { background: var(--red); }
.orange { background: var(--orange); }
.green { background: var(--green); }
.blue { background: var(--blue); }
.gray { background: var(--gray); }
.teal { background: var(--teal); }
.amber { background: var(--amber); }
.purple { background: var(--purple); }
.darkred { background: var(--darkred); }
.magenta { background: var(--magenta); }

/* ── Map wrapper + side panel ── */
.map-wrapper {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  min-height: 560px;
}

.map {
  width: 100%;
  height: min(65vh, 580px);
  min-height: 400px;
}

.map-side-panel {
  background: var(--panel);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-side-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.map-side-header h3 { font-size: 14px; font-weight: 700; }

.map-detail {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.map-detail-empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 32px 16px;
  line-height: 1.6;
}

.map-detail-card {
  display: grid;
  gap: 10px;
  animation: fade-in 200ms ease-out;
}

@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.map-detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-abuso { background: rgba(201,52,42,0.12); color: var(--red); }
.badge-necesidad { background: rgba(212,120,32,0.12); color: var(--orange); }
.badge-seguro { background: rgba(31,125,78,0.12); color: var(--green); }
.badge-refugio { background: rgba(30,107,191,0.12); color: var(--blue); }
.badge-social { background: rgba(168,18,84,0.12); color: var(--magenta); }
.badge-zone { background: rgba(108,47,212,0.12); color: var(--purple); }

/* ── Text feed ── */
.text-feed { display: grid; gap: 10px; margin-top: 16px; }

.feed-item {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.feed-item:hover { box-shadow: var(--shadow-md); }
.feed-item strong { font-size: 14px; font-weight: 700; }
.feed-item span, .feed-item small { font-size: 12px; color: var(--muted); }
.feed-item p { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ── Zone list ── */
.zone-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.zone-item {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-md);
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

/* ── Layout del Wizard ───────────────────────────────────────────────────────── */
.wizard-container { display: flex; flex-direction: column; height: 100%; overflow-y: auto; overflow-x: hidden; position: relative; }
.wizard-content { flex: 1; padding: 24px; padding-bottom: 80px; } /* Espacio para botones y barra de emergencia */
.wizard-footer {
  padding: 16px 24px; background: rgba(13,13,15,0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; position: sticky; bottom: 0;
}

/* ── Emergency Bar ─────────────────────────────────────────────────────────────── */
.emergency-bar {
  position: fixed; bottom: 0; left: 0; width: 100%; z-index: 10000;
  background: rgba(13,13,15,0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 12px 16px;
  display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap;
  font-size: 12px; font-weight: 700; color: var(--fg);
}
@media (min-width: 1024px) {
  .emergency-bar { left: 520px; width: calc(100% - 520px); } /* Solo sobre el mapa en desktop */
}
.zone-item.alto { border-left-color: var(--purple); }
.zone-item.critico { border-left-color: var(--darkred); }

.zone-item-header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.zone-item strong { font-size: 13px; font-weight: 700; }
.zone-item span, .zone-item small { font-size: 12px; color: var(--muted); }
.zone-item p { font-size: 12px; color: var(--muted); line-height: 1.4; }
.pressure-bar-wrap { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.pressure-bar { height: 100%; background: var(--purple); border-radius: 2px; transition: width 600ms ease; }
.pressure-bar.critico { background: var(--darkred); }
.pressure-bar.alto { background: var(--purple); }
.pressure-bar.medio { background: var(--amber); }

/* ── Social signals ── */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.social-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.platform-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.platform-btn:hover, .platform-btn.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.platform-btn.x.active { background: #000; border-color: #000; color: #fff; }
.platform-btn.instagram.active { background: linear-gradient(135deg,#f58529,#dd2a7b,#8134af,#515bd4); border-color: #dd2a7b; color: #fff; }
.platform-btn.tiktok.active { background: #010101; border-color: #010101; color: #fff; }
.platform-btn.facebook.active { background: #1877f2; border-color: #1877f2; color: #fff; }

.social-card {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.social-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.social-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}

.pi-x { background: #000; }
.pi-instagram { background: linear-gradient(135deg,#f58529,#dd2a7b,#515bd4); }
.pi-tiktok { background: #010101; }
.pi-facebook { background: #1877f2; }

.trust-bar-wrap { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; flex: 1; }
.trust-bar { height: 100%; border-radius: 2px; transition: width 600ms ease; }
.trust-high { background: var(--green); }
.trust-mid { background: var(--orange); }
.trust-low { background: var(--gray); }

.social-card-location { font-size: 13px; font-weight: 700; }
.social-card-type { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.social-card-summary { font-size: 13px; color: var(--muted); line-height: 1.5; }
.social-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.social-time { font-size: 11px; color: var(--muted-2); }
.social-link { font-size: 12px; font-weight: 700; color: var(--teal); }
.social-link:hover { color: var(--teal-2); }

/* ── Resources ── */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.resource-card {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.resource-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.resource-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.resource-top strong { font-size: 14px; font-weight: 700; line-height: 1.3; }

.kind-badge {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--panel-2);
  color: var(--teal);
  border: 1px solid var(--line);
}

.confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.confidence-badge.verificado { color: var(--green); }
.resource-card p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.resource-card a { font-size: 12px; color: var(--teal); font-weight: 700; }

/* ── Wizard form ── */
.report-section {
  padding: 40px clamp(16px,5vw,64px);
  border-bottom: 1px solid var(--line);
}

.form-wizard {
  max-width: 760px;
  margin: 0 auto;
}

.wizard-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  counter-reset: step;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  transition: all var(--transition);
  flex-shrink: 0;
  z-index: 1;
}

.step-item.active .step-circle { border-color: var(--teal); background: var(--teal); color: #fff; box-shadow: 0 0 0 4px rgba(10,106,116,0.15); }
.step-item.done .step-circle { border-color: var(--green); background: var(--green); color: #fff; }

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--line);
  transition: background var(--transition);
}

.step-item.done + .step-item .step-connector,
.step-item.done .step-connector { background: var(--green); }

.step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}

.step-item.active .step-label { color: var(--teal); }
.step-item.done .step-label { color: var(--green); }

.wizard-step-content { display: none; animation: fade-in 200ms ease; }
.wizard-step-content.active { display: grid; gap: 20px; }

/* Category selector */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.category-card {
  padding: 16px 14px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition);
}

.category-card:hover { border-color: var(--muted-2); box-shadow: var(--shadow-sm); }
.category-card.selected { border-color: var(--teal); background: rgba(10,106,116,0.06); box-shadow: 0 0 0 3px rgba(10,106,116,0.15); }
.category-card.selected.abuso { border-color: var(--red); background: rgba(201,52,42,0.06); box-shadow: 0 0 0 3px rgba(201,52,42,0.12); }
.category-card.selected.necesidad { border-color: var(--orange); background: rgba(212,120,32,0.06); box-shadow: 0 0 0 3px rgba(212,120,32,0.12); }
.category-card.selected.seguro { border-color: var(--green); background: rgba(31,125,78,0.06); box-shadow: 0 0 0 3px rgba(31,125,78,0.12); }
.category-card.selected.refugio { border-color: var(--blue); background: rgba(30,107,191,0.06); box-shadow: 0 0 0 3px rgba(30,107,191,0.12); }

.cat-icon { font-size: 24px; line-height: 1; }
.cat-label { font-size: 14px; font-weight: 700; }
.cat-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* Urgency toggle */
.urgency-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(201,52,42,0.05);
  border: 2px solid rgba(201,52,42,0.2);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
}

.urgency-toggle:hover { border-color: rgba(201,52,42,0.4); }
.urgency-toggle.active { background: rgba(201,52,42,0.10); border-color: var(--red); }
.urgency-toggle input { width: auto; accent-color: var(--red); transform: scale(1.3); }
.urgency-text strong { font-size: 14px; font-weight: 700; display: block; }
.urgency-text span { font-size: 12px; color: var(--muted); }

/* Map pick */
.map-pick-mini {
  height: 260px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  overflow: hidden;
}

.map-pick-note {
  font-size: 12px;
  color: var(--teal);
  font-weight: 600;
  margin-top: 4px;
}

/* Evidence drop zone */
.evidence-drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--panel-2);
}

.evidence-drop:hover, .evidence-drop.drag-over {
  border-color: var(--teal);
  background: rgba(10,106,116,0.04);
}

.evidence-drop-icon { font-size: 28px; margin-bottom: 8px; }
.evidence-drop-text { font-size: 14px; font-weight: 600; color: var(--muted); }
.evidence-drop-hint { font-size: 12px; color: var(--muted-2); margin-top: 4px; }

.evidence-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 80px);
  gap: 8px;
  margin-top: 12px;
}

.evidence-thumb {
  position: relative;
  width: 80px; height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.evidence-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.evidence-thumb-remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}

.evidence-thumb-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 3px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 9px;
  text-align: center;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Char counter */
.char-counter {
  font-size: 11px;
  color: var(--muted-2);
  text-align: right;
  font-weight: 600;
}

.char-counter.warn { color: var(--orange); }
.char-counter.limit { color: var(--red); }

/* Tracking result */
.tracking-result {
  padding: 20px 24px;
  background: rgba(31,125,78,0.08);
  border: 2px solid var(--green);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 12px;
  animation: fade-in 300ms ease;
}

.tracking-code {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ── Forms ── */
.form-group { display: grid; gap: 6px; }
.form-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

input[type="text"], input[type="number"], input[type="search"], input[type="password"], input[type="email"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}

input[type="checkbox"], input[type="radio"] {
  accent-color: var(--teal);
  cursor: pointer;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(10,106,116,0.15);
}

input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { resize: vertical; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }

.input-group { position: relative; }
.input-group input { padding-right: 40px; }
.input-suffix {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px; font-weight: 700;
  color: var(--muted-2);
  pointer-events: none;
}

.honeypot { position: absolute; left: -9999px; opacity: 0; }

/* ── Status section ── */
.status-form {
  display: flex;
  gap: 10px;
  max-width: 500px;
}

.status-result {
  max-width: 500px;
  margin-top: 16px;
}

.status-card {
  padding: 20px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  animation: fade-in 200ms ease;
}

.status-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.status-row:last-child { border-bottom: none; }
.status-key { font-weight: 600; color: var(--muted); }
.status-val { font-weight: 700; }
.status-nuevo { color: var(--blue); }
.status-revision { color: var(--orange); }
.status-publicado { color: var(--green); }
.status-resuelto { color: var(--gray); }

/* ── Compression ── */
.compression-status {
  font-size: 13px;
  color: var(--teal);
  font-weight: 600;
}

/* ── Footer ── */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px clamp(16px,5vw,64px);
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

/* ── Spinner ── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  display: inline-block;
}

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

/* ── Skeleton loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--line-2) 25%, var(--line) 50%, var(--line-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 9999;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in 200ms ease, toast-out 200ms ease 3800ms forwards;
  pointer-events: auto;
  max-width: 320px;
}

.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.info { background: var(--teal); }

@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; } }

/* ── Admin ── */
.admin-body { background: var(--paper); }
.admin-main { padding: 24px clamp(16px,5vw,64px); }

.tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--panel-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  margin-bottom: 24px;
  width: fit-content;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn:hover { color: var(--ink); }
.tab-btn.active { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 380px;
  gap: 20px;
  align-items: start;
}

.report-list { display: grid; gap: 8px; }

.admin-card {
  padding: 14px 16px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: grid;
  gap: 6px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.admin-card:hover { box-shadow: var(--shadow-md); border-color: var(--muted-2); }
.admin-card[aria-selected="true"] { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(10,106,116,0.15); }
.admin-card.urgent { border-left: 4px solid var(--red); }

.admin-card strong { font-size: 13px; font-weight: 700; }
.admin-card span { font-size: 12px; color: var(--muted); }
.admin-card p { font-size: 12px; color: var(--muted); line-height: 1.4; }
.admin-card small { font-size: 11px; color: var(--muted-2); }

.moderation-panel {
  position: sticky;
  top: 72px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.metric {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.metric strong { font-size: 26px; font-weight: 900; color: var(--ink); line-height: 1; }
.metric span { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.metric.urgent strong { color: var(--red); }

/* Scraping panel */
.scrape-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.scrape-card {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.scrape-card-header { display: flex; align-items: center; gap: 10px; }
.scrape-card h3 { font-size: 14px; font-weight: 700; }
.scrape-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.scrape-status.idle { background: var(--panel-2); color: var(--muted); }
.scrape-status.running { background: rgba(10,106,116,0.12); color: var(--teal); }
.scrape-status.success { background: rgba(31,125,78,0.12); color: var(--green); }
.scrape-status.error { background: rgba(201,52,42,0.12); color: var(--red); }

.scrape-log-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.scrape-log-table th { text-align: left; padding: 6px 10px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.scrape-log-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.scrape-log-table tr:last-child td { border-bottom: none; }

/* ── Lite mode ── */
.lite .map, .lite .legend, .lite .map-wrapper, .lite .map-side-panel { display: none; }
.lite .hero { min-height: auto; grid-template-columns: 1fr; }

/* ── Result output ── */
.result {
  font-size: 13px;
  color: var(--teal);
  font-weight: 600;
  white-space: pre-wrap;
  line-height: 1.5;
}

.result.error { color: var(--red); }

/* ── Responsive ── */
@media (max-width: 1000px) {
  .map-wrapper { grid-template-columns: 1fr; }
  .map-side-panel { border-left: none; border-top: 1px solid var(--line); }
  .map { height: min(55vh, 480px); }
}

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .safety-panel { display: none; }
  .admin-layout { grid-template-columns: 1fr; }
  .moderation-panel { position: static; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(3,1fr); }
  .scrape-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 10px; min-height: auto; padding: 10px 16px; }
  .nav { width: 100%; overflow-x: auto; padding-bottom: 4px; gap: 2px; }
  .category-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2,1fr); }
  h1 { font-size: 34px; }
  h2 { font-size: 24px; }
  .wizard-steps { gap: 4px; }
  .step-label { display: none; }
}

@media (max-width: 420px) {
  .metrics { grid-template-columns: 1fr; }
  .alert-grid { grid-template-columns: 1fr; }
}

/* ── Leaflet overrides ── */
.leaflet-popup-content-wrapper {
  background: var(--panel) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: var(--radius-md) !important;
}

.leaflet-popup-tip { background: var(--panel) !important; }
.leaflet-popup-content { font-family: 'Inter', sans-serif !important; font-size: 13px !important; line-height: 1.6 !important; }
.leaflet-popup-content strong { font-weight: 700; }
.leaflet-container { font-family: 'Inter', sans-serif !important; }
