/* =========================================================
   Sistema de Registro de Organizaciones Sociales del Paraguay
   Estilos generales - responsive (celular y computadora)
   ========================================================= */

:root {
  --azul-py: #0038a8;
  --rojo-py: #d52b1e;
  --blanco: #ffffff;
  --gris-claro: #f4f6fa;
  --gris-medio: #dfe3e8;
  --gris-oscuro: #4a5568;
  --texto: #1a202c;
  --exito: #1e8e3e;
  --alerta: #e0a800;
  --radio: 10px;
  --sombra: 0 2px 10px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--gris-claro);
  color: var(--texto);
  line-height: 1.5;
}

a { color: var(--azul-py); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ---------- Header ---------- */
.top-header {
  background: linear-gradient(135deg, var(--azul-py), #002878);
  color: var(--blanco);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--sombra);
  flex-wrap: wrap;
  gap: 10px;
}

.top-header .marca {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-header .marca img { height: 46px; width: 46px; border-radius: 8px; background: #fff; padding: 4px; }
.top-header .marca h1 { font-size: 1.05rem; margin: 0; font-weight: 600; }
.top-header .marca small { display:block; opacity: .85; font-weight: 400;}

.top-header nav a {
  color: var(--blanco);
  margin-left: 16px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
}
.top-header nav a:hover, .top-header nav a:focus { background: rgba(255,255,255,.15); text-decoration: none; }

/* ---------- Contenedor ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 24px;
  margin-bottom: 22px;
}

h2.titulo-seccion {
  border-left: 5px solid var(--rojo-py);
  padding-left: 12px;
  margin-top: 0;
}

/* ---------- Formularios ---------- */
label { font-weight: 600; display: block; margin-bottom: 6px; margin-top: 14px; font-size: .92rem; }

input[type=text], input[type=tel], input[type=password], input[type=number],
input[type=email], select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--gris-medio);
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  color: var(--texto);
  transition: border-color .15s, box-shadow .15s;
}

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

/* Foco visible obligatorio para navegación con TAB (accesibilidad) */
input:focus, select:focus, textarea:focus, button:focus, a:focus {
  outline: 3px solid var(--alerta);
  outline-offset: 1px;
  border-color: var(--azul-py);
}

.radio-group { display: flex; gap: 20px; margin-top: 8px; }
.radio-group label { display: flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; }

.campo-ayuda { font-size: .82rem; color: var(--gris-oscuro); margin-top: 4px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}
.btn-primario { background: var(--azul-py); color: #fff; }
.btn-primario:hover { background: #002878; }
.btn-exito { background: var(--exito); color: #fff; }
.btn-peligro { background: var(--rojo-py); color: #fff; }
.btn-secundario { background: var(--gris-medio); color: var(--texto); }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.acciones-form { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Captcha ---------- */
.captcha-box {
  background: var(--gris-claro);
  border: 1px dashed var(--gris-medio);
  border-radius: 8px;
  padding: 14px;
  margin-top: 16px;
}
.captcha-box strong { font-size: 1.1rem; }

/* ---------- Tablas ---------- */
.tabla-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .93rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--gris-medio); }
th { background: var(--azul-py); color: #fff; position: sticky; top: 0; }
tr:hover { background: #f0f4ff; }

.badge { padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.badge-si { background: #d4f4dd; color: var(--exito); }
.badge-no { background: #fde2e1; color: var(--rojo-py); }
.badge-activo { background: #d4f4dd; color: var(--exito); }
.badge-inactivo { background: #eee; color: #666; }

/* ---------- Mensajes ---------- */
.alerta { padding: 14px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.alerta-exito { background: #d4f4dd; color: #14532d; border: 1px solid #86efac; }
.alerta-error { background: #fde2e1; color: #7f1d1d; border: 1px solid #f7a8a5; }
.alerta-info  { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }

.mensaje-gracias {
  text-align: center;
  padding: 40px 20px;
}
.mensaje-gracias h2 { color: var(--exito); font-size: 1.5rem; }

/* ---------- Mapa ---------- */
#mapa { height: 320px; border-radius: 8px; margin-top: 10px; border: 1px solid var(--gris-medio); }

/* ---------- Filtros / Export ---------- */
.filtros { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filtros > div { flex: 1; min-width: 160px; }
.export-botones { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------- Login ---------- */
.login-wrap {
  max-width: 400px;
  margin: 60px auto;
}
.login-wrap .card { text-align: center; }
.login-logo { height: 70px; margin-bottom: 10px; }

/* ---------- Footer ---------- */
footer {
  text-align: center;
  padding: 20px;
  color: var(--gris-oscuro);
  font-size: .85rem;
}

/* ---------- Grid de dos columnas en escritorio ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 20px; }

@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .top-header .marca h1 { font-size: 1.2rem; }
}

/* ---------- Responsive celular ---------- */
@media (max-width: 600px) {
  .top-header { flex-direction: column; align-items: flex-start; }
  .top-header nav { display: flex; flex-wrap: wrap; }
  .top-header nav a { margin-left: 0; margin-right: 8px; }
  .container { padding: 12px; }
  .card { padding: 16px; }
  th, td { padding: 8px; font-size: .85rem; }
  .btn { width: 100%; }
  .acciones-form { flex-direction: column; }
}

.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: var(--radio); padding: 18px; box-shadow: var(--sombra); text-align: center; border-top: 4px solid var(--azul-py); }
.stat-card .numero { font-size: 2rem; font-weight: 700; color: var(--azul-py); }
.stat-card .etiqueta { color: var(--gris-oscuro); font-size: .85rem; }
