/* ==============================================================
   Tequila Cerca de Ti - hoja de estilos
   Paleta: agave (verde profundo) + oro tequila (dorado calido)
   Tipografia: Fraunces (titulos) + Inter (texto)
   ============================================================== */

:root{
  --agave-900:#17301F;
  --agave-700:#28502F;
  --agave-600:#356C3E;
  --agave-500:#3D8B4C;
  --oro-600:#B5852A;
  --oro-500:#C99A2E;
  --tierra-100:#F3F1EA;
  --bg:#F3F5F1;
  --card:#FFFFFF;
  --ink:#1E2A22;
  --ink-soft:#4B5A4F;
  --border:#DCE3D8;
  --rojo:#C0392B;
  --rojo-bg:#FBEAE8;
  --verde-bg:#E7F3E9;
  --oro-bg:#FBF1DD;
  --radius:12px;
  --shadow:0 2px 10px rgba(23,48,31,0.06);
  --shadow-lg:0 8px 28px rgba(23,48,31,0.10);
}

*{ box-sizing:border-box; }

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:'Inter', -apple-system, sans-serif;
  font-size:15px;
  line-height:1.5;
}

h1,h2,h3{
  font-family:'Fraunces', Georgia, serif;
  color:var(--agave-900);
  font-weight:700;
  margin:0 0 .5em;
}

.page-title{
  font-size:28px;
  margin:20px 0 18px;
}
.page-sub{ color:var(--ink-soft); margin-top:-10px; margin-bottom:18px; }

a{ color:var(--agave-600); }

/* ---------- TOPBAR ---------- */
.topbar{
  background:var(--agave-900);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 24px;
  flex-wrap:wrap;
  gap:10px;
  position:sticky;
  top:0;
  z-index:50;
  box-shadow:var(--shadow-lg);
}
.topbar-brand{ display:flex; align-items:center; gap:10px; }
.brand-mark{
  background:var(--oro-500);
  color:var(--agave-900);
  font-family:'Fraunces', serif;
  font-weight:700;
  width:36px; height:36px;
  border-radius:9px;
  display:flex; align-items:center; justify-content:center;
  font-size:15px;
}
.brand-name{ font-family:'Fraunces', serif; font-size:18px; font-weight:600; }
.topbar-nav{ display:flex; gap:18px; flex-wrap:wrap; }
.topbar-nav a{
  color:#DCE9DE;
  text-decoration:none;
  font-size:14px;
  font-weight:500;
  padding:6px 2px;
  border-bottom:2px solid transparent;
}
.topbar-nav a:hover{ color:#fff; border-bottom-color:var(--oro-500); }
.topbar-user{ display:flex; align-items:center; gap:14px; font-size:13px; color:#CFE0D2; }
.btn-logout{
  background:rgba(255,255,255,0.08);
  color:#fff !important;
  padding:6px 14px;
  border-radius:8px;
  text-decoration:none;
  font-size:13px;
}
.btn-logout:hover{ background:rgba(255,255,255,0.18); }

/* ---------- LAYOUT ---------- */
.content{
  max-width:1100px;
  margin:0 auto;
  padding:10px 24px 60px;
}
.footer{
  text-align:center;
  color:var(--ink-soft);
  font-size:12px;
  padding:30px 20px;
}

/* ---------- CARDS / FORMS ---------- */
.form-card, .detalle-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:24px;
  box-shadow:var(--shadow);
  margin-bottom:24px;
}
.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}
.field{ margin-bottom:16px; display:flex; flex-direction:column; }
.field-btn{ align-self:flex-end; }
label{ font-size:13px; font-weight:600; color:var(--agave-700); margin-bottom:6px; }
input[type=text], input[type=date], input[type=password], input[type=file], textarea, select{
  border:1px solid var(--border);
  border-radius:8px;
  padding:10px 12px;
  font-family:inherit;
  font-size:14px;
  background:#fff;
  color:var(--ink);
}
input:focus, textarea:focus, select:focus{
  outline:2px solid var(--oro-500);
  outline-offset:1px;
  border-color:var(--oro-500);
}
textarea{ resize:vertical; }

.btn-primary, .btn-secondary, .btn-danger{
  border:none;
  border-radius:8px;
  padding:11px 22px;
  font-weight:600;
  font-size:14px;
  cursor:pointer;
  font-family:inherit;
}
.btn-primary{ background:var(--agave-600); color:#fff; }
.btn-primary:hover{ background:var(--agave-700); }
.btn-block{ width:100%; }
.btn-secondary{ background:var(--tierra-100); color:var(--agave-800,var(--agave-700)); border:1px solid var(--border); }
.btn-secondary:hover{ background:#e9e6da; }
.btn-danger{ background:var(--rojo-bg); color:var(--rojo); border:1px solid #F1CFC9; }
.btn-danger:hover{ background:#f7dbd7; }
.btn-sm{ padding:6px 12px; font-size:12px; }

/* ---------- ALERTS ---------- */
.alert{ padding:12px 16px; border-radius:8px; margin-bottom:16px; font-size:14px; }
.alert-error{ background:var(--rojo-bg); color:#8A2A1F; border:1px solid #F1CFC9; }
.alert-success{ background:var(--verde-bg); color:var(--agave-800,var(--agave-700)); border:1px solid #BFE0C6; }

/* ---------- ESTATUS PILLS ---------- */
.estatus-options{ display:flex; gap:10px; flex-wrap:wrap; }
.estatus-pill{
  display:flex; align-items:center; gap:8px;
  border:1px solid var(--border);
  border-radius:999px;
  padding:9px 16px;
  font-weight:600;
  font-size:13px;
  cursor:pointer;
  background:#fff;
}
.estatus-pill.a-favor{ color:var(--agave-700); }
.estatus-pill.duda{ color:var(--oro-600); }
.estatus-pill.en-contra{ color:var(--rojo); }
.estatus-pill input{ accent-color:currentColor; }

.badge{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
}
.badge-a_favor{ background:var(--verde-bg); color:var(--agave-700); }
.badge-en_contra{ background:var(--rojo-bg); color:var(--rojo); }
.badge-duda{ background:var(--oro-bg); color:var(--oro-600); }

/* ---------- GEO ---------- */
.geo-status{
  font-size:13px;
  padding:10px 12px;
  border-radius:8px;
  background:var(--tierra-100);
  color:var(--ink-soft);
}
.geo-status.geo-ok{ background:var(--verde-bg); color:var(--agave-700); }
.geo-status.geo-warn{ background:var(--oro-bg); color:var(--oro-600); }

.preview-foto{ max-width:220px; border-radius:8px; margin-top:10px; display:block; }

/* ---------- DICTADO POR VOZ ---------- */
.detalles-tools{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.dictado-status{ font-size:12.5px; color:var(--ink-soft); }
.dictado-status.dictado-warn{ color:var(--oro-600); }
.btn-recording{
  background:var(--rojo-bg) !important;
  color:var(--rojo) !important;
  border-color:#F1CFC9 !important;
  animation:pulso-grabacion 1.4s ease-in-out infinite;
}
@keyframes pulso-grabacion{
  0%,100%{ box-shadow:0 0 0 0 rgba(192,57,43,0.35); }
  50%{ box-shadow:0 0 0 6px rgba(192,57,43,0); }
}

/* ---------- TABLA ---------- */
.filtros-bar{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
  background:var(--card); border:1px solid var(--border);
  padding:14px; border-radius:var(--radius); margin-bottom:18px;
}
.filtros-bar select, .filtros-bar input{ padding:8px 10px; font-size:13px; }

.tabla-wrap{ overflow-x:auto; background:var(--card); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }
.tabla-visitas{ width:100%; border-collapse:collapse; font-size:13.5px; }
.tabla-visitas th{
  text-align:left; background:var(--tierra-100); color:var(--agave-800,var(--agave-700));
  padding:12px 14px; font-size:12px; text-transform:uppercase; letter-spacing:.04em;
  border-bottom:1px solid var(--border);
}
.tabla-visitas td{ padding:12px 14px; border-bottom:1px solid var(--border); }
.tabla-visitas tr:last-child td{ border-bottom:none; }
.empty-row{ text-align:center; color:var(--ink-soft); padding:30px; }

/* ---------- DETALLE ---------- */
.detalle-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:20px; }
.detalle-detalles{ margin-bottom:18px; }
.detalle-foto img{ max-width:320px; border-radius:10px; margin-bottom:18px; }
.mini-mapa{ height:220px; border-radius:10px; margin-bottom:18px; }
.detalle-acciones{ display:flex; gap:10px; }

/* ---------- DASHBOARD ---------- */
.stats-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px; }
.stat-card{
  background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
  padding:18px; text-align:center; box-shadow:var(--shadow);
}
.stat-num{ display:block; font-family:'Fraunces', serif; font-size:30px; font-weight:700; color:var(--agave-800,var(--agave-700)); }
.stat-label{ font-size:12px; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.05em; }
.stat-favor .stat-num{ color:var(--agave-500); }
.stat-duda .stat-num{ color:var(--oro-600); }
.stat-contra .stat-num{ color:var(--rojo); }

.mapa-principal{ height:420px; border-radius:var(--radius); margin-bottom:22px; border:1px solid var(--border); }
.top-list{ margin:0; padding-left:18px; }
.top-list li{ margin-bottom:6px; }

/* ---------- LOGIN ---------- */
.login-body{
  background:linear-gradient(160deg, var(--agave-900), var(--agave-700));
  min-height:100vh;
  display:flex; align-items:center; justify-content:center;
  margin:0;
  font-family:'Inter', sans-serif;
}
.login-card{
  background:#fff;
  padding:36px 32px;
  border-radius:16px;
  width:100%;
  max-width:360px;
  box-shadow:0 20px 60px rgba(0,0,0,0.3);
  text-align:center;
}
.login-mark{
  width:52px; height:52px; margin:0 auto 14px;
  background:var(--oro-500); color:var(--agave-900);
  border-radius:14px; display:flex; align-items:center; justify-content:center;
  font-family:'Fraunces', serif; font-weight:700; font-size:20px;
}
.login-card h1{ font-size:20px; margin-bottom:4px; }
.login-sub{ color:var(--ink-soft); font-size:13px; margin-bottom:22px; }
.login-card form{ display:flex; flex-direction:column; gap:12px; text-align:left; }
.login-note{ font-size:12px; color:var(--ink-soft); margin-top:18px; }

/* ---------- USUARIOS ---------- */
.acciones-usuario{ display:flex; gap:8px; align-items:flex-start; }
.reset-details summary{ list-style:none; cursor:pointer; display:inline-block; }
.reset-details summary::-webkit-details-marker{ display:none; }
.reset-form{ display:flex; gap:6px; margin-top:6px; }
.reset-form input{ width:140px; }
.seccion-form{ display:flex; gap:6px; }
.seccion-form input{ width:80px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 760px){
  .topbar{ flex-direction:column; align-items:flex-start; }
  .form-grid{ grid-template-columns:1fr; }
  .stats-row{ grid-template-columns:1fr 1fr; }
  .detalle-grid{ grid-template-columns:1fr 1fr; }
  .content{ padding:10px 14px 40px; }
}
