/* ============================================
   SOLUCIONES CIUDADANAS — Design System
   Mobile-first, civic & bold
   ============================================ */

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

:root {
  --primary:    #1A2F5E;
  --primary-l:  #233A74;
  --accent:     #E63946;
  --accent-l:   #FF4D5A;
  --green:      #1B8C4E;
  --green-l:    #22A85E;
  --amber:      #D4840A;
  --amber-l:    #F59E0B;
  --blue:       #1D6FA4;
  --bg:         #F4F5F9;
  --card:       #FFFFFF;
  --border:     #E2E5EE;
  --text:       #0D1B2A;
  --muted:      #6B7A90;
  --muted-l:    #9AAABB;

  --confirma:   #1B8C4E;
  --afecta:     #E63946;

  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  20px;

  --shadow-sm:  0 1px 3px rgba(13,27,42,0.08);
  --shadow:     0 4px 16px rgba(13,27,42,0.10);
  --shadow-lg:  0 8px 32px rgba(13,27,42,0.14);

  --font-head:  'Outfit', sans-serif;
  --font-body:  'DM Sans', sans-serif;

  --nav-h:      60px;
}

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

html { font-size: 16px; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

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

/* ─── NAVBAR ─────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--primary);
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.navbar-logo {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.navbar-title {
  font-family: var(--font-head);
  font-weight: 800; font-size: 17px; color: #fff;
  letter-spacing: -0.3px; line-height: 1;
}
.navbar-sub {
  font-size: 10px; color: rgba(255,255,255,0.55);
  font-weight: 400; margin-top: 1px;
}
.navbar-cta {
  background: var(--accent); color: #fff;
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
  padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer;
  text-decoration: none; display: flex; align-items: center; gap: 6px;
  transition: background 0.15s;
}
.navbar-cta:hover { background: var(--accent-l); }

/* ─── STATS BAR ──────────────────────────────── */
.stats-bar {
  background: var(--primary-l);
  padding: 10px 16px;
  display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;
}
.stat-item {
  display: flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.85); font-size: 12px;
}
.stat-num {
  font-family: var(--font-head); font-weight: 800; font-size: 16px; color: #fff;
}

/* ─── CONTAINER ──────────────────────────────── */
.container { max-width: 680px; margin: 0 auto; padding: 0 12px; }

/* ─── FILTROS ────────────────────────────────── */
.filtros {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex; gap: 8px; overflow-x: auto;
  scrollbar-width: none;
}
.filtros::-webkit-scrollbar { display: none; }
.filtro-btn {
  flex-shrink: 0; padding: 6px 14px;
  border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--card); color: var(--muted);
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.filtro-btn.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

/* ─── CARD DE REPORTE ────────────────────────── */
.feed {
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 14px;
  max-width: 680px;          /* mobile-like feed centrado en desktop */
  margin: 0 auto;
}

/* En pantallas grandes: grid de 2 columnas */
@media (min-width: 900px) {
  .feed {
    max-width: 1100px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    padding: 20px;
  }
}
@media (min-width: 1300px) {
  .feed {
    max-width: 1280px;
    grid-template-columns: repeat(3, 1fr);
  }
}

.report-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  overflow: hidden; transition: box-shadow 0.2s, transform 0.15s;
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
}
.report-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.report-foto {
  width: 100% !important;
  height: 180px !important;        /* altura fija — NO se sobreescribe */
  max-height: 180px !important;
  object-fit: cover !important;    /* recorta sin deformar */
  display: block !important;
  background: var(--bg);
}
@media (min-width: 900px) {
  .report-foto { height: 200px !important; max-height: 200px !important; }
}
.report-foto-placeholder {
  width: 100%; height: 140px;
  background: linear-gradient(135deg, #E8EAEE 0%, #D4D8E2 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}

/* También centramos las barras superiores en desktop */
.filtros, .stats-bar { max-width: 100%; }

.report-body { padding: 14px 16px; }

.report-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.report-cat {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  padding: 3px 10px; border-radius: 12px;
  background: var(--bg); color: var(--muted);
  text-transform: uppercase;
}
.report-estado {
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 12px; white-space: nowrap;
}
.estado-abierto   { background: #FEF2F2; color: var(--accent); }
.estado-en_proceso { background: #FFFBEB; color: var(--amber); }
.estado-resuelto  { background: #F0FDF4; color: var(--green); }

.report-dir {
  font-family: var(--font-head); font-weight: 700; font-size: 16px;
  margin-bottom: 4px; line-height: 1.3;
}
.report-desc { color: var(--muted); font-size: 13px; margin-bottom: 10px; line-height: 1.4; }

.report-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--muted-l);
}
.report-codigo { font-family: monospace; font-size: 11px; }

/* ─── BOTONES DE VOTO ────────────────────────── */
.votos-bar {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
}
.voto-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 16px; border: none; background: transparent;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.voto-btn:first-child { border-right: 1px solid var(--border); }

.voto-btn.confirma { color: var(--confirma); }
.voto-btn.afecta   { color: var(--afecta); }
.voto-btn.confirma:hover { background: #F0FDF4; }
.voto-btn.afecta:hover   { background: #FEF2F2; }

.voto-btn.voted.confirma { background: #F0FDF4; }
.voto-btn.voted.afecta   { background: #FEF2F2; }

.voto-num {
  font-family: var(--font-head); font-weight: 800; font-size: 18px;
}
.voto-label { font-size: 12px; font-weight: 500; }

/* ─── FORMULARIO DE REPORTE ──────────────────── */
.form-page { min-height: 100vh; background: var(--bg); }

.form-header {
  background: var(--primary); color: #fff; padding: 20px 16px;
  text-align: center;
}
.form-header h1 { font-family: var(--font-head); font-size: 22px; font-weight: 800; }
.form-header p { font-size: 13px; opacity: 0.7; margin-top: 4px; }

.form-body { padding: 20px 16px; max-width: 480px; margin: 0 auto; }

.form-section { margin-bottom: 24px; }
.form-label {
  font-family: var(--font-head); font-weight: 700; font-size: 14px;
  letter-spacing: 0.3px; margin-bottom: 10px; display: block;
  color: var(--text);
}
.form-label span { color: var(--accent); }

/* Foto uploader */
.foto-upload {
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--card); text-align: center; padding: 30px 20px;
  cursor: pointer; transition: all 0.2s; position: relative;
}
.foto-upload:hover, .foto-upload.drag { border-color: var(--accent); background: #FEF2F2; }
.foto-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.foto-upload-icon { font-size: 48px; margin-bottom: 8px; }
.foto-upload-text { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.foto-upload-sub { font-size: 12px; color: var(--muted); }

.foto-preview {
  border-radius: var(--radius); overflow: hidden; position: relative;
}
.foto-preview img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.foto-preview-remove {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.6); color: #fff; border: none;
  border-radius: 50%; width: 32px; height: 32px; font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* Categorías grid */
.cats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.cat-option { display: none; }
.cat-label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 14px 8px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer; transition: all 0.15s;
  font-size: 11px; font-weight: 600; text-align: center; color: var(--muted);
}
.cat-label .cat-emoji { font-size: 28px; }
.cat-option:checked + .cat-label {
  border-color: var(--primary); background: #EDF1F9; color: var(--primary);
}

/* GPS */
.gps-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
}
.gps-status {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted);
}
.gps-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted-l); flex-shrink: 0;
  transition: background 0.3s;
}
.gps-dot.ok { background: var(--green); }
.gps-dot.loading { background: var(--amber); animation: pulse 1s infinite; }
.gps-dot.error { background: var(--accent); }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.form-input, .form-textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); font-family: var(--font-body); font-size: 15px;
  color: var(--text); transition: border-color 0.15s;
  outline: none;
}
.form-input:focus, .form-textarea:focus { border-color: var(--primary); }
.form-textarea { resize: vertical; min-height: 90px; }

/* Botón submit */
.btn-submit {
  width: 100%; padding: 18px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  font-family: var(--font-head); font-weight: 800; font-size: 18px;
  cursor: pointer; transition: background 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-submit:hover:not(:disabled) { background: var(--accent-l); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── ÉXITO POST-ENVÍO ───────────────────────── */
.success-screen {
  text-align: center; padding: 40px 24px;
  background: var(--card); border-radius: var(--radius-lg);
  margin: 20px; box-shadow: var(--shadow);
}
.success-icon { font-size: 64px; margin-bottom: 16px; }
.success-code {
  font-family: monospace; font-size: 20px; font-weight: 700;
  color: var(--primary); background: var(--bg);
  padding: 10px 20px; border-radius: var(--radius-sm);
  display: inline-block; margin: 12px 0;
}
.btn-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px; margin-top: 20px;
  background: #25D366; color: #fff; border: none;
  border-radius: var(--radius); font-family: var(--font-head);
  font-weight: 800; font-size: 16px; cursor: pointer;
  text-decoration: none; transition: opacity 0.15s;
}
.btn-whatsapp:hover { opacity: 0.9; }

/* ─── REPORTE INDIVIDUAL ─────────────────────── */
.reporte-page { max-width: 600px; margin: 0 auto; padding: 16px 12px 40px; }
.reporte-card { background: var(--card); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.reporte-foto-lg { width: 100%; max-height: 360px; object-fit: cover; }
.reporte-content { padding: 20px; }
.reporte-titulo {
  font-family: var(--font-head); font-weight: 800; font-size: 22px;
  margin-bottom: 12px; line-height: 1.2;
}
.reporte-info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px;
}
.reporte-info-item { background: var(--bg); border-radius: var(--radius-sm); padding: 10px; }
.reporte-info-label { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; }
.reporte-info-value { font-size: 14px; font-weight: 600; margin-top: 2px; }

.votos-grande {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 20px; border-top: 1px solid var(--border);
}
.voto-grande {
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 16px; text-align: center; cursor: pointer;
  background: var(--card); transition: all 0.2s;
  font-family: var(--font-body);
}
.voto-grande.confirma:hover, .voto-grande.confirma.voted { border-color: var(--confirma); background: #F0FDF4; }
.voto-grande.afecta:hover, .voto-grande.afecta.voted { border-color: var(--afecta); background: #FEF2F2; }
.voto-grande-icon { font-size: 32px; margin-bottom: 6px; }
.voto-grande-num { font-family: var(--font-head); font-weight: 900; font-size: 28px; }
.voto-grande-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.voto-grande.confirma .voto-grande-num { color: var(--confirma); }
.voto-grande.afecta .voto-grande-num { color: var(--afecta); }

/* ─── ADMIN ──────────────────────────────────── */
.admin-wrap { max-width: 900px; margin: 0 auto; padding: 24px 16px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left; padding: 10px 12px;
  background: var(--primary); color: #fff;
  font-family: var(--font-head); font-weight: 700;
}
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: var(--bg); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700;
}

/* ─── UTILITIES ──────────────────────────────── */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.hidden { display: none !important; }

/* ─── VACÍO ──────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state-icon { font-size: 56px; margin-bottom: 12px; }
.empty-state h3 { font-family: var(--font-head); font-size: 18px; margin-bottom: 6px; color: var(--text); }

/* ─── TOAST ──────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--text); color: #fff; padding: 12px 24px;
  border-radius: 24px; font-size: 14px; font-weight: 600;
  z-index: 999; transition: transform 0.3s; white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--green); }
.toast.error { background: var(--accent); }
.toast.info { background: var(--primary); }
