/* rescatevzla.xyz — style.css */
/* Mobile-first. System fonts. Sin dependencias. WCAG AA. */

:root {
  --bg:          #FAF9F6;
  --surface:     #FFFFFF;
  --border:      #E4DED7;
  --text:        #1C1917;
  --text-muted:  #6B6560;
  --green:       #7D9B76;
  --green-dark:  #5A7554;
  --green-light: #EEF4ED;
  --blue:        #A8D5E3;
  --blue-dark:   #4A9BB5;
  --blue-light:  #EBF7FB;
  --red:         #C0392B;
  --red-light:   #FEF0EE;
  --yellow:      #D97706;
  --yellow-light:#FFFBEB;
  --radius:      12px;
  --radius-sm:   6px;
  --shadow:      0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.10);
  --font:        system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── TIPOGRAFÍA ─────────────────────────── */
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 700; line-height: 1.2; }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.125rem; font-weight: 600; }
p  { max-width: 65ch; }
a  { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── LAYOUT ─────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.section   { padding: 3rem 0; }

/* ── HEADER ─────────────────────────────── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; max-width: 1100px; margin: 0 auto;
}
.logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.125rem; color: var(--text);
  text-decoration: none;
}
.logo-icon {
  width: 36px; height: 36px; background: var(--green);
  border-radius: 8px; display: flex; align-items: center;
  justify-content: center; font-size: 1.25rem; flex-shrink: 0;
}
.nav { display: flex; gap: 0.25rem; align-items: center; }
.nav a {
  padding: 0.4rem 0.8rem; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--green-light); color: var(--green-dark); text-decoration: none; }
.nav .btn-nav {
  background: var(--green); color: #fff; padding: 0.4rem 1rem;
}
.nav .btn-nav:hover { background: var(--green-dark); }

/* ── HERO ───────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #f0f7ef 0%, #e8f4f8 100%);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 1.25rem;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  background: var(--red-light); color: var(--red);
  border: 1px solid #f5c6c1; border-radius: 20px;
  padding: 0.25rem 0.875rem; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 1rem;
}
.hero h1 { margin-bottom: 0.75rem; color: var(--text); }
.hero p   { color: var(--text-muted); font-size: 1.05rem; margin: 0 auto 1.75rem; }
.hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ── BOTONES ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.25rem; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  border: 2px solid transparent; transition: all 0.15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--green); color: #fff; border-color: var(--green); }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-secondary { background: transparent; color: var(--green-dark); border-color: var(--green); }
.btn-secondary:hover { background: var(--green-light); }
.btn-danger    { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm        { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.btn:disabled  { opacity: 0.55; cursor: not-allowed; }

/* ── BUSCADOR ───────────────────────────── */
.search-bar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end;
  box-shadow: var(--shadow);
}
.search-bar select, .search-bar input {
  flex: 1; min-width: 160px; padding: 0.5rem 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; background: var(--bg);
  color: var(--text);
}
.search-bar select:focus, .search-bar input:focus {
  outline: 2px solid var(--green); outline-offset: 1px;
}

/* ── GRID DE TARJETAS ────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem; margin-top: 1.5rem;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow); transition: box-shadow 0.15s, transform 0.15s;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.card-title  { font-weight: 600; font-size: 1rem; line-height: 1.3; }
.card-meta   { font-size: 0.82rem; color: var(--text-muted); display: flex; gap: 0.5rem; flex-wrap: wrap; }
.card-desc   { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }

/* ── BADGES ─────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.55rem; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.badge-verified { background: var(--green-light); color: var(--green-dark); }
.badge-critico  { background: var(--red-light); color: var(--red); }
.badge-normal   { background: var(--blue-light); color: var(--blue-dark); }
.badge-pendiente{ background: var(--yellow-light); color: var(--yellow); }
.badge-tipo     { background: #F3F0EB; color: var(--text-muted); }
.badge-pre      { background: #EEF4ED; color: var(--green-dark); border: 1px solid var(--green); }

/* ── CHIPS DE NECESIDADES ─────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 0.15rem 0.55rem;
  font-size: 0.75rem; color: var(--text-muted);
}
.chip-more { background: var(--green-light); color: var(--green-dark); border-color: var(--green); }

/* ── FORMULARIOS ─────────────────────────── */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow);
  max-width: 720px; margin: 0 auto;
}
.form-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.25rem; }
.form-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }
.form-section-label {
  font-weight: 600; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); padding-bottom: 0.5rem;
  margin: 1.75rem 0 1rem;
}
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block; font-size: 0.875rem; font-weight: 500;
  margin-bottom: 0.35rem; color: var(--text);
}
.form-group label .req { color: var(--red); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 0.55rem 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; color: var(--text);
  background: var(--bg); transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(125,155,118,0.15);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-error { color: var(--red); font-size: 0.8rem; margin-top: 0.25rem; }
.form-hint  { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.25rem; }
.form-footer { margin-top: 1.75rem; display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* Checkboxes necesidades */
.needs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.35rem;
}
.need-category { margin-bottom: 1rem; }
.need-category-label { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
.need-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.5rem; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.85rem; transition: background 0.1s;
}
.need-item:hover { background: var(--green-light); }
.need-item input[type=checkbox] { accent-color: var(--green); width: 16px; height: 16px; }

/* Radio urgencia */
.urgency-group { display: flex; gap: 1rem; }
.urgency-opt {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem; border: 2px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 0.875rem;
  font-weight: 500; transition: all 0.15s;
}
.urgency-opt:has(input:checked) { border-color: var(--green); background: var(--green-light); }
.urgency-opt.critico:has(input:checked) { border-color: var(--red); background: var(--red-light); }

/* ── PANEL ADMIN ─────────────────────────── */
.panel-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.panel-sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 0.25rem;
}
.panel-sidebar .logo { margin-bottom: 1.5rem; }
.sidebar-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
  font-size: 0.9rem; color: var(--text-muted); cursor: pointer;
  transition: background 0.1s, color 0.1s; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font);
}
.sidebar-link:hover, .sidebar-link.active {
  background: var(--green-light); color: var(--green-dark); text-decoration: none;
}
.sidebar-badge {
  margin-left: auto; background: var(--red); color: #fff;
  border-radius: 10px; padding: 0.1rem 0.45rem; font-size: 0.7rem; font-weight: 700;
}
.panel-main { padding: 2rem; overflow-y: auto; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }

/* Tabla admin */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th {
  text-align: left; padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--border); font-weight: 600;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
}
.admin-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }

/* Análisis agente en panel */
.agent-report {
  background: var(--blue-light); border: 1px solid var(--blue);
  border-radius: var(--radius-sm); padding: 0.75rem 1rem;
  font-size: 0.82rem; margin-top: 0.5rem;
}
.agent-score {
  display: inline-block;
  padding: 0.15rem 0.5rem; border-radius: 20px; font-weight: 700; font-size: 0.8rem;
}
.score-high   { background: var(--green-light); color: var(--green-dark); }
.score-medium { background: var(--yellow-light); color: var(--yellow); }
.score-low    { background: var(--red-light); color: var(--red); }

/* Login admin */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: var(--bg); padding: 1.5rem;
}
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 380px;
  box-shadow: var(--shadow-md);
}

/* ── ALERTAS / TOAST ─────────────────────── */
.alert {
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; display: flex; align-items: flex-start; gap: 0.5rem;
  margin-bottom: 1rem;
}
.alert-success { background: var(--green-light); color: var(--green-dark); border: 1px solid var(--green); }
.alert-error   { background: var(--red-light); color: var(--red); border: 1px solid #f5c6c1; }
.alert-info    { background: var(--blue-light); color: var(--blue-dark); border: 1px solid var(--blue); }
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--text); color: #fff;
  padding: 0.75rem 1.25rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; z-index: 9999; box-shadow: var(--shadow-md);
  transform: translateY(0); transition: opacity 0.3s;
}

/* ── STATS ROW ───────────────────────────── */
.stats-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  flex: 1; min-width: 130px; box-shadow: var(--shadow);
}
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── MODAL / DRAWER ──────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.75rem; max-width: 520px; width: 100%;
  box-shadow: var(--shadow-md); max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; justify-content: flex-end; }
.modal-overlay.hidden, .hidden { display: none !important; }

/* ── EMPTY STATE ─────────────────────────── */
.empty-state {
  text-align: center; padding: 4rem 1rem; color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 1rem; }

/* ── FOOTER ──────────────────────────────── */
.footer {
  border-top: 1px solid var(--border); padding: 2rem 1.25rem;
  text-align: center; color: var(--text-muted); font-size: 0.85rem;
  background: var(--surface); margin-top: auto;
}

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .panel-layout { grid-template-columns: 1fr; }
  .panel-sidebar { display: none; }
  .stats-row .stat-card { min-width: 110px; }
  .search-bar { flex-direction: column; }
  .hero-actions { flex-direction: column; align-items: center; }
  .nav a:not(.btn-nav) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Focus visible para accesibilidad */
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
