:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #ccfbf1;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --danger-bg: #fef2f2;
  --danger-text: #b91c1c;
  --danger-border: #fecaca;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.09);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* --- Encabezado --- */
.encabezado {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 28px 16px;
  color: white;
}

.encabezado-contenido {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.encabezado h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.subtitulo {
  color: rgba(255, 255, 255, 0.78);
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 500;
}

/* --- Layout --- */
.contenedor {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 16px 100px;
}

/* --- Tarjetas --- */
.tarjeta {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 18px;
}

.tarjeta-destacada {
  border-color: var(--primary-light);
  background: linear-gradient(180deg, #f0fdfa 0%, var(--card-bg) 60px);
}

.titulo-seccion {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tarjeta h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.titulo-simple {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.descripcion {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 4px 0 16px;
}

/* --- Inputs --- */
.fila-input { display: flex; gap: 8px; }
.fila-input input[type="text"] { flex: 1; }

input[type="text"], select {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: white;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

/* --- Botones --- */
.boton-primario, .boton-secundario, .boton-dropdown, .boton-texto {
  cursor: pointer;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  font-family: inherit;
  transition: all 0.15s ease;
}

.boton-primario {
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 12px 22px;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.28);
}
.boton-primario:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13, 148, 136, 0.36); }
.boton-primario:disabled { background: #cbd5e1; cursor: not-allowed; box-shadow: none; }

.boton-secundario {
  background: #f1f5f9;
  color: var(--text);
  padding: 10px 18px;
  border: 1.5px solid var(--border);
}
.boton-secundario:hover { background: #e2e8f0; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  background: var(--primary-light);
  border: 1px solid #99f0e3;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip button {
  border: none;
  background: rgba(15, 118, 110, 0.12);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.chip button:hover { background: rgba(15, 118, 110, 0.22); }

/* --- Dropdown de municipios --- */
.dropdown { position: relative; }

.boton-dropdown {
  background: white;
  border: 1.5px solid var(--border);
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
}
.boton-dropdown:hover { border-color: #cbd5e1; }

.icono-chevron { color: var(--text-muted); flex-shrink: 0; }

.panel-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  padding: 14px;
  z-index: 10;
}

.panel-dropdown input[type="text"] { width: 100%; margin-bottom: 10px; }

.acciones-dropdown { display: flex; gap: 16px; margin-bottom: 10px; }
.boton-texto { background: none; color: var(--primary-dark); padding: 2px 0; font-size: 13px; }
.boton-texto:hover { text-decoration: underline; }

.lista-checkboxes {
  max-height: 260px;
  overflow-y: auto;
  columns: 2;
  column-gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14px;
  padding: 6px 0;
  break-inside: avoid;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-item em { color: var(--text-muted); font-style: normal; font-size: 12.5px; }

.oculto { display: none !important; }

.opcion-limite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.opcion-limite label { font-size: 14px; font-weight: 600; }
.opcion-limite select { min-width: 200px; }

.separador { height: 1px; background: var(--border); margin: 18px 0; }

.nota { font-size: 12.5px; color: var(--text-muted); margin: 6px 0 16px; line-height: 1.5; }

.estimado {
  background: white;
  border: 1px solid var(--primary-light);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 16px;
  white-space: pre-line;
  color: var(--text);
}

.mensaje-error {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 14px;
  font-size: 13.5px;
  font-weight: 500;
}

.barra-progreso {
  background: #eef2f1;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.barra-relleno {
  background: linear-gradient(90deg, var(--primary), #34d399);
  height: 100%;
  transition: width 0.35s ease;
}

.texto-progreso { font-size: 13.5px; color: var(--text-muted); margin-bottom: 12px; font-weight: 500; }

.log {
  background: #0b1720;
  color: #7dd3ae;
  border-radius: 10px;
  padding: 14px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin: 0 0 16px;
}

@media (max-width: 480px) {
  .lista-checkboxes { columns: 1; }
  .opcion-limite { flex-direction: column; align-items: flex-start; }
}
