/* ===========================================================================
   CONECTAMUNICIPIO — Sistema de diseño v2 «Sabana cálida»
   Evolución de la identidad de la Fase 11, no un reemplazo: se conservan
   verde río, mango, arena y la trenza del vueltiao. Lo que cambia: verde
   más hondo en header y pie, mosaico bento, radios 20/28/34, iconos SVG
   en lugar de emoji y UN SOLO ACENTO por pantalla.
   Regla de oro: el mango marca la acción principal; el caribe solo estados.
   Accesibilidad primero: cuerpo 17px+, objetivos táctiles >=52px, foco
   visible, movimiento reducido respetado.
   Los nombres de clase de la v1 se conservan a propósito: las 49 plantillas
   heredan el rediseño sin tocarlas una por una.
   ======================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,800&family=Figtree:wght@400;500;600;700&display=swap');

:root {
  /* --- Color --------------------------------------------------------- */
  --rio-hondo: #06332C;    /* v2: header, pie, superficies grandes */
  --rio: #0E5E52;          /* primario: botones, enlaces */
  --rio-oscuro: #0A4239;   /* se conserva por compatibilidad con la v1 */
  --caribe: #2FA98C;       /* estados positivos, resuelto */
  --mango: #F09A3E;        /* acento ÚNICO: llamados a la acción */
  --mango-suave: #FCE8CF;
  --arena: #F6F1E6;        /* fondo de página */
  --arena-2: #EFE7D6;      /* bloques secundarios */
  --sabana: var(--arena);  /* alias v1 */
  --noche: #17302A;        /* tinta: texto principal */
  --tenue: #6B857D;        /* texto auxiliar y metadatos */
  --borde: #E3DACA;
  --blanco: #FFFFFF;
  --wa: #25D366;           /* solo el botón de WhatsApp */

  --cm-primary: var(--rio);   /* re-mapea el color del tenant (RN-11) */

  /* --- Radios por jerarquía ------------------------------------------ */
  --r-xl: 34px;   /* bloques grandes y franjas */
  --r-lg: 28px;   /* tarjetas y mosaicos */
  --r-md: 20px;   /* filas internas */
  --r-pill: 999px;
  --radius: var(--r-md);   /* alias v1: no romper plantillas existentes */

  /* --- Sombras -------------------------------------------------------- */
  --sh-1: 0 3px 12px rgba(6,51,44,.07);
  --sh-2: 0 4px 16px rgba(6,51,44,.08);
  --sh-3: 0 4px 18px rgba(6,51,44,.08);
  --sh-hover: 0 16px 34px rgba(6,51,44,.14);
}

/* --- Base tipográfica generosa ------------------------------------------ */
html { font-size: 17px; }
body {
  font-family: 'Figtree', system-ui, 'Segoe UI', sans-serif;
  background: var(--arena);
  color: var(--noche);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, .display-font {
  font-family: 'Bricolage Grotesque', 'Figtree', sans-serif;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--noche);
}
a { color: var(--rio); text-decoration: none; }
a:hover { color: var(--rio-hondo); }
.text-muted, small.text-muted { color: var(--tenue) !important; }

/* --- La firma: trenza del vueltiao (v2: tinta + mango cruzados) --------- */
.trenza {
  height: 14px;
  background:
    repeating-linear-gradient(45deg, rgba(23,48,42,.9) 0 9px, rgba(0,0,0,0) 9px 18px),
    repeating-linear-gradient(-45deg, rgba(240,154,62,.95) 0 9px, rgba(0,0,0,0) 9px 18px),
    var(--arena);
}
.trenza-fina { height: 10px; }

/* --- Header (v2: verde río hondo, plano) -------------------------------- */
.cm-header { background: var(--rio-hondo); color: #fff; }
.cm-header a { color: #fff; }
.cm-header .brand-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  letter-spacing: -0.025em;
  font-size: 1.25rem;
}
.cm-header .container { flex-wrap: wrap; row-gap: .5rem; }

/* Marca en cuadro redondeado mango (sustituye al emoji) */
.cm-brand-mark {
  width: 46px; height: 46px; border-radius: 14px; background: var(--mango);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Buscador del header: píldora translúcida */
.cm-search-pill {
  display: flex; align-items: center; gap: .6rem;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-pill);
  padding: .5rem 1.1rem;
}
.cm-search-pill input {
  background: transparent; border: 0; color: #fff; font-size: 15px;
  width: 100%; outline: none; min-height: 30px;
}
.cm-search-pill input::placeholder { color: rgba(255,255,255,.6); }
.cm-search-pill button { background: transparent; border: 0; padding: 0; line-height: 0; }

/* Botones del header */
.btn-ghost-light {
  color: #fff; font-size: 15px; font-weight: 600;
  padding: .65rem 1.2rem; border: 1px solid rgba(255,255,255,.28);
  border-radius: var(--r-pill); background: transparent; min-height: 46px;
}
.btn-ghost-light:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-solid-light {
  color: var(--rio-hondo); font-size: 15px; font-weight: 700;
  padding: .7rem 1.3rem; background: #fff; border: 0;
  border-radius: var(--r-pill); min-height: 46px;
}
.btn-solid-light:hover { background: var(--arena-2); color: var(--rio-hondo); }

/* --- Botones: grandes, redondos, altura mínima 52px --------------------- */
.btn {
  border-radius: var(--r-pill);
  font-weight: 700;
  padding: .75rem 1.5rem;
  min-height: 52px;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-sm { min-height: 44px; padding: .5rem 1.1rem; font-size: .95rem; }
.btn-lg { min-height: 60px; padding: 1rem 2rem; font-size: 1.1rem; }
.btn-cm-primary { background: var(--cm-primary); border-color: var(--cm-primary); color: #fff; }
.btn-cm-primary:hover, .btn-cm-primary:focus { background: var(--rio-hondo); border-color: var(--rio-hondo); color: #fff; }
.btn-mango {
  background: var(--mango); border-color: var(--mango); color: var(--rio-hondo);
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; letter-spacing: -0.02em;
}
.btn-mango:hover { background: #e18a2f; border-color: #e18a2f; color: var(--rio-hondo); }
.btn-outline-cm { background: #fff; border: 1px solid var(--borde); color: var(--noche); font-weight: 700; }
.btn-outline-cm:hover { background: var(--arena-2); color: var(--noche); }
.btn-success, .bg-success { background-color: var(--wa) !important; border-color: var(--wa) !important; }
.bg-cm-primary, .badge.bg-cm-primary { background-color: var(--cm-primary) !important; }

/* --- Chips de estado (se entienden de un vistazo, sin leer) ------------- */
.badge { border-radius: var(--r-pill); font-weight: 700; padding: .5rem .9rem; }
.cm-chip {
  display: inline-block; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 700; padding: .45rem 1rem;
}
.cm-chip-resuelto   { background: #DFF0E9; color: var(--rio); }
.cm-chip-gestion    { background: #FCE8CF; color: #8A5416; }
.cm-chip-recibido   { background: #E3E8E6; color: #3E534C; }
.cm-chip-verificado { background: var(--rio-hondo); color: #fff; }

/* --- Tarjetas ------------------------------------------------------------ */
.card {
  border: none; border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--sh-hover); }
.card-img-top { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.list-group-item { border-color: rgba(23,48,42,.08); }
.list-group-item:first-child { border-top-left-radius: var(--r-md); border-top-right-radius: var(--r-md); }
.list-group-item:last-child { border-bottom-left-radius: var(--r-md); border-bottom-right-radius: var(--r-md); }

/* --- Héroe: textura tejida sobre verde ---------------------------------- */
.cm-hero-wrap { background: var(--rio-hondo); padding: 0 1.5rem 1.5rem; }
.cm-hero {
  border-radius: 40px;
  color: #fff;
  background-image:
    radial-gradient(880px 360px at 82% -6%, rgba(240,154,62,.32), rgba(0,0,0,0) 62%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 16px, rgba(0,0,0,0) 16px 32px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.04) 0 16px, rgba(0,0,0,0) 16px 32px),
    linear-gradient(158deg, #06332C 0%, #0E5E52 58%, #147A63 100%);
}
.cm-hero h1 { color: #fff; font-size: clamp(2.1rem, 5vw, 4.4rem); text-wrap: pretty; }
.cm-hero .lead { color: #D8EDE5; font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.45; }
.cm-eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  background: rgba(255,255,255,.12); border-radius: var(--r-pill);
  padding: .45rem 1.1rem; color: #CFE8DE; font-size: 14px; font-weight: 600;
}
.cm-eyebrow .dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--caribe); }

/* Buscador protagonista: píldora blanca con botón mango */
.cm-hero .cm-searchbox {
  display: flex; align-items: center; background: #fff;
  border-radius: var(--r-pill); padding: .45rem .45rem .45rem 1.6rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
}
.cm-hero .cm-searchbox .form-control {
  border: 0; box-shadow: none; font-size: 1.15rem; padding-left: .9rem;
  background: transparent; min-height: 52px;
}
.cm-hero .cm-searchbox .form-control::placeholder { color: var(--tenue); }
.cm-hero .btn-buscar {
  background: var(--mango); border: 0; color: var(--rio-hondo);
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: 1.15rem; border-radius: var(--r-pill);
  padding: .95rem 2.2rem; min-height: 56px; flex-shrink: 0;
}
.cm-hero .btn-buscar:hover { background: #e18a2f; color: var(--rio-hondo); }

/* Sugerencias bajo el buscador */
.cm-suggest {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: #EAF6F1; font-size: 15px; font-weight: 600;
  padding: .55rem 1.15rem; border-radius: var(--r-pill);
}
.cm-suggest:hover { background: rgba(255,255,255,.2); color: #fff; }

/* Cifras del héroe */
.cm-stat .n {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  letter-spacing: -0.025em; color: var(--mango); font-size: 2.35rem; line-height: 1;
}
.cm-stat .t { color: #CFE8DE; font-size: 15px; margin-top: .25rem; }

/* --- Mosaico bento: las puertas del municipio --------------------------- */
.cm-bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.15rem; }
.cm-tile {
  border-radius: var(--r-lg); padding: 1.6rem;
  display: flex; flex-direction: column; gap: .7rem; justify-content: flex-end;
  min-height: 190px; background: #fff; color: var(--noche);
  box-shadow: var(--sh-2);
  transition: transform .18s ease, box-shadow .18s ease;
}
.cm-tile:hover { transform: translateY(-3px); box-shadow: var(--sh-hover); }
.cm-tile .cm-tile-title {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  letter-spacing: -0.025em; font-size: 1.35rem; line-height: 1.1;
}
.cm-tile .cm-tile-sub { font-size: 1rem; margin-top: .35rem; color: var(--tenue); }
.cm-tile svg { stroke: var(--rio); }

/* Variantes: solo dos destacadas por pantalla (regla del acento único) */
.cm-tile-wide { grid-column: span 2; }
.cm-tile-rio { background: var(--rio); color: #fff; }
.cm-tile-rio .cm-tile-title { color: #fff; font-size: 1.75rem; }
.cm-tile-rio .cm-tile-sub { color: #B6DCD0; }
.cm-tile-rio svg { stroke: #fff; }
.cm-tile-mango { background: var(--mango); color: var(--rio-hondo); }
.cm-tile-mango .cm-tile-title { color: var(--rio-hondo); font-size: 1.75rem; }
.cm-tile-mango .cm-tile-sub { color: #5C3F17; }
.cm-tile-mango svg { stroke: var(--rio-hondo); }
.cm-tile-dashed {
  background: var(--arena-2); border: 2px dashed #C9BBA0; box-shadow: none;
  flex-direction: row; align-items: center; justify-content: space-between;
}
.cm-tile-dashed:hover { box-shadow: none; }
.cm-tile-dashed .cm-tile-sub { color: #5E6E68; }

/* --- Chips de módulo (compatibilidad v1, restilizados a v2) ------------- */
.module-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; background: var(--blanco); border-radius: var(--r-lg);
  padding: 1.1rem .6rem; min-height: 112px;
  color: var(--noche); font-weight: 700; font-size: 1rem; text-align: center;
  box-shadow: var(--sh-2);
  transition: transform .18s ease, box-shadow .18s ease;
}
.module-chip:hover { transform: translateY(-3px); color: var(--rio); box-shadow: var(--sh-hover); }
.module-chip .icon { font-size: 1.9rem; line-height: 1; }
.module-chip svg { stroke: var(--rio); }

/* --- Título de sección con regla degradada ------------------------------ */
.section-title {
  display: flex; align-items: center; gap: 1rem;
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  letter-spacing: -0.025em;
}
.section-title::after {
  content: ""; flex: 1; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, var(--mango), rgba(240,154,62,0) 78%);
}

/* --- Filas internas (listas de reportes, etc.) -------------------------- */
.cm-row {
  display: flex; align-items: center; gap: .9rem;
  padding: 1rem 1.1rem; background: var(--arena); border-radius: 18px;
}
.cm-row .t { flex-grow: 1; font-size: 1rem; }
.cm-row .m { color: var(--tenue); font-size: 14px; flex-shrink: 0; }

/* --- Franja de llamado a la acción -------------------------------------- */
.cm-cta { background: var(--mango); border-radius: var(--r-xl); padding: 2.6rem 3rem; color: var(--rio-hondo); }
.cm-cta h2, .cm-cta h5 { color: var(--rio-hondo); }
.cm-cta p { color: #5C3F17; }

/* --- Pie (v2: tinta, no verde) ------------------------------------------ */
.cm-footer { background: var(--noche); color: #A9C4BB; }
.cm-footer h5, .cm-footer h6, .cm-footer .h5, .cm-footer .h6 { color: #fff; }
.cm-footer a { color: #D6E7E0; }
.cm-footer a:hover { color: #fff; text-decoration: underline; }
.cm-footer .cm-legal { color: #8FAAA1; font-size: 14px; }

/* --- Accesibilidad ------------------------------------------------------- */
:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  .card, .module-chip, .cm-tile { transition: none; }
  .card:hover, .module-chip:hover, .cm-tile:hover { transform: none; }
}

/* --- Móvil: cambia el orden, no solo el tamaño -------------------------- */
@media (max-width: 991px) {
  .cm-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-tile-wide { grid-column: span 2; }
  .cm-hero-wrap { padding: 0 .75rem .75rem; }
  .cm-hero { border-radius: var(--r-xl); }
}
@media (max-width: 576px) {
  .cm-header .brand-title { font-size: 1.05rem; }
  .cm-tile { min-height: 150px; padding: 1.2rem; }
  .cm-tile .cm-tile-title { font-size: 1.15rem; }
  .cm-tile-rio .cm-tile-title, .cm-tile-mango .cm-tile-title { font-size: 1.35rem; }
  .module-chip { min-height: 96px; font-size: .9rem; }
  .cm-hero .cm-searchbox { flex-direction: column; gap: .6rem; padding: .8rem; border-radius: var(--r-xl); }
  .cm-hero .cm-searchbox .form-control { text-align: center; padding-left: 0; }
  .cm-hero .btn-buscar { width: 100%; }
  .cm-cta { padding: 1.8rem 1.5rem; }
}
