/* ==========================================================================
   RINCONADA LA JOYA · RONDINES — sistema visual (panel, acceso, transparencia)
   Base 13px, densidad real, un solo color de acción.
   ========================================================================== */
:root {
  --navy: #08131f;
  --navy-2: #0d1e2f;
  --navy-3: #14293d;
  --tinta: #0f1b2a;
  --tinta-2: #344054;
  --muted: #667085;
  --linea: #e4e9f0;
  --linea-2: #eef1f5;
  --fondo: #f3f5f8;
  --card: #ffffff;
  --accion: #0a6cff;
  --accion-oscuro: #0857cc;
  --oro: #dcb34a;
  --verde: #1f9d55;
  --ambar: #d98511;
  --rojo: #d92d20;
  --morado: #7a5af8;
  --radio: 14px;
  --radio-sm: 9px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .14);
  --sombra-alta: 0 24px 60px -20px rgba(8, 19, 31, .35);
  --fuente: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--fuente); font-size: 13px; line-height: 1.5;
  color: var(--tinta); background: var(--fondo);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accion); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; color: var(--tinta); }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }
::selection { background: rgba(10, 108, 255, .16); }
:focus-visible { outline: 2px solid var(--accion); outline-offset: 2px; }

/* ---------- Utilidades ---------------------------------------------------- */
.ico { width: 18px; height: 18px; flex: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.eyebrow { font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ahorarap { white-space: nowrap; }
.fila { display: flex; align-items: center; gap: 10px; }
.entre { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.crecer { flex: 1; }
.derecha { text-align: right; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.oculto { display: none !important; }

/* ---------- Marca --------------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand img { border-radius: 9px; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 13px; letter-spacing: .14em; color: #fff; font-weight: 700; }
.brand em { font-style: normal; font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.55); margin-top: 3px; }
.brand--pub strong { color: var(--navy); }
.brand--pub em { color: var(--muted); }

/* ---------- Estructura ---------------------------------------------------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 22px 16px 16px; color: #fff; overflow-y: auto;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(220,179,74,.10), transparent 60%),
    linear-gradient(180deg, #0a1a2a 0%, #07111c 100%);
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-comunidad { display: flex; gap: 9px; align-items: flex-start; padding: 11px 11px; border-radius: 11px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); }
.sidebar-comunidad .dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--oro); box-shadow: 0 0 0 4px rgba(220,179,74,.13); flex: none; }
.sidebar-comunidad strong { display: block; font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,.92); line-height: 1.35; }
.sidebar-comunidad small { font-size: 10.5px; color: rgba(255,255,255,.45); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px;
  color: rgba(255,255,255,.62); font-size: 12.5px; font-weight: 500; position: relative; transition: .14s;
}
.nav-item .ico { width: 17px; height: 17px; opacity: .8; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-item.is-on { background: rgba(255,255,255,.09); color: #fff; }
.nav-item.is-on::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--oro); }
.nav-item.is-on .ico { color: var(--oro); opacity: 1; }
.sidebar-pie { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.guardia-box { display: flex; align-items: center; gap: 9px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.guardia-box > div { min-width: 0; flex: 1; }
.guardia-box strong { display: block; font-size: 11.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guardia-box small { font-size: 10px; color: rgba(255,255,255,.42); }
.guardia-box form { margin: 0; }
.guardia-box .icon-btn { color: rgba(255,255,255,.55); }
.version { font-size: 9.5px; color: rgba(255,255,255,.3); letter-spacing: .02em; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #e6c369, #b98a22); color: #17202b;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 24px 30px 18px; }
.topbar h1 { font-size: 25px; font-weight: 680; letter-spacing: -.03em; margin-top: 4px; }
.topbar .sub { color: var(--muted); font-size: 12px; margin-top: 5px; max-width: 620px; }
.topbar-acciones { display: flex; align-items: center; gap: 10px; }
.conexion { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.conexion i { width: 6px; height: 6px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 3px rgba(31,157,85,.12); }
.conexion.off i { background: var(--rojo); box-shadow: 0 0 0 3px rgba(217,45,32,.12); }
.contenido { padding: 0 30px 40px; flex: 1; }

/* ---------- Botones ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid var(--linea);
  background: #fff; color: var(--tinta-2); font-size: 12.5px; font-weight: 600;
  transition: .14s; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: #cfd6e0; background: #fbfcfd; }
.btn .ico { width: 16px; height: 16px; }
.btn--primario { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn--primario:hover { background: #12263a; border-color: #12263a; }
.btn--accion { background: var(--accion); border-color: var(--accion); color: #fff; }
.btn--accion:hover { background: var(--accion-oscuro); border-color: var(--accion-oscuro); }
.btn--peligro { color: var(--rojo); border-color: #f2c8c4; background: #fef4f3; }
.btn--peligro:hover { background: #fde9e7; }
.btn--fantasma { border-color: transparent; background: transparent; color: var(--muted); }
.btn--fantasma:hover { background: #eef1f5; color: var(--tinta); }
.btn--sm { height: 31px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; }
.btn--sm .ico { width: 14px; height: 14px; }
.btn--bloque { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { border: 0; background: transparent; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; padding: 0; }
.icon-btn:hover { background: #eef1f5; color: var(--tinta); }
.icon-btn .ico { width: 17px; height: 17px; }

/* ---------- Tarjetas ------------------------------------------------------ */
.card { background: var(--card); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); }
.card + .card { margin-top: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--linea-2); }
.card-h h2 { font-size: 13.5px; font-weight: 650; }
.card-h p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-b { padding: 18px; }
.card-b--flush { padding: 0; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--linea-2); background: #fbfcfd; border-radius: 0 0 var(--radio) var(--radio); }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); padding: 15px 16px; box-shadow: var(--sombra); position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.kpi-label { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 650; }
.kpi-valor { font-size: 27px; font-weight: 680; letter-spacing: -.04em; margin-top: 9px; font-variant-numeric: tabular-nums; }
.kpi-valor small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.kpi-pie { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.kpi .ico { width: 18px; height: 18px; color: #98a2b3; }
.kpi--destacado { background: linear-gradient(150deg, #0c1e30, #07121d); border-color: #0c1e30; color: #fff; }
.kpi--destacado .kpi-label, .kpi--destacado .kpi-pie { color: rgba(255,255,255,.55); }
.kpi--destacado .kpi-valor { color: #fff; }
.kpi--destacado .ico { color: var(--oro); }
.tendencia { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.tendencia--up { color: var(--verde); }
.tendencia--down { color: var(--rojo); }

/* ---------- Badges y pastillas ------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge--success { background: #e8f7ee; color: #157347; }
.badge--warning { background: #fdf3e1; color: #9a5b00; }
.badge--danger { background: #fdeceb; color: #b42318; }
.badge--info { background: #e9f1ff; color: #0b5cd5; }
.badge--neutral { background: #eff2f6; color: #566274; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #eff2f6; font-size: 11px; color: var(--tinta-2); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 25px; padding: 0 10px; border-radius: 7px; background: #f2f4f7; color: var(--tinta-2); font-size: 11px; font-weight: 550; border: 1px solid transparent; }
.chip .ico { width: 13px; height: 13px; }
.chip--ok { background: #e8f7ee; color: #157347; }
.chip--warn { background: #fdf3e1; color: #9a5b00; }

/* ---------- Tablas -------------------------------------------------------- */
.tabla-wrap { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tabla th {
  text-align: left; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  font-weight: 650; padding: 10px 14px; background: #f9fafb; border-bottom: 1px solid var(--linea);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.tabla td { padding: 11px 14px; border-bottom: 1px solid var(--linea-2); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover { background: #fbfcfe; }
.tabla .fila-principal { font-weight: 600; color: var(--tinta); }
.tabla .sec { color: var(--muted); font-size: 11px; margin-top: 2px; }
.tabla .acciones { text-align: right; white-space: nowrap; }
.tabla--compacta td { padding: 8px 12px; }
.tabla--sin-hover tbody tr:hover { background: transparent; }

/* ---------- Formularios --------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .ancho { grid-column: 1 / -1; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 11.5px; font-weight: 600; color: var(--tinta-2); display: flex; align-items: center; gap: 4px; }
.campo label .req { color: var(--rojo); font-weight: 700; }
.campo .hint { font-size: 11px; color: var(--muted); line-height: 1.45; }
.campo .error { font-size: 11px; color: var(--rojo); font-weight: 550; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=time], input[type=number], input[type=tel], select, textarea {
  width: 100%; height: 39px; padding: 0 11px; border: 1px solid #d4dae3; border-radius: 9px;
  background: #fff; font-family: inherit; font-size: 12.5px; color: var(--tinta); transition: .12s;
}
textarea { height: auto; min-height: 88px; padding: 10px 11px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accion); box-shadow: 0 0 0 3px rgba(10,108,255,.12); }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border-color: #e2a19a; box-shadow: 0 0 0 3px rgba(217,45,32,.08); }
.campo--error input, .campo--error select, .campo--error textarea { border-color: #e2a19a; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--tinta-2); }
.check input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--accion); }
.form-pie { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.seccion-form { border-top: 1px solid var(--linea-2); padding-top: 16px; }
.seccion-form:first-child { border-top: 0; padding-top: 0; }
.seccion-form h3 { font-size: 12px; margin-bottom: 12px; color: var(--tinta); }
.ayuda-caja { background: #f7f9fc; border: 1px solid var(--linea-2); border-radius: 10px; padding: 11px 13px; font-size: 11.5px; color: var(--muted); display: flex; gap: 9px; }
.ayuda-caja .ico { color: var(--accion); margin-top: 1px; }

/* ---------- Flash / avisos ------------------------------------------------ */
.flash { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: 10px; margin-bottom: 16px; font-size: 12.5px; border: 1px solid; }
.flash .ico { width: 16px; height: 16px; margin-top: 1px; flex: none; }
.flash--ok { background: #effaf3; border-color: #c8ead5; color: #146c43; }
.flash--error { background: #fef4f3; border-color: #f4cdc9; color: #a41d14; }
.flash--aviso { background: #fffaeb; border-color: #f3e0ae; color: #8a5a00; }
.flash-x { margin-left: auto; border: 0; background: transparent; color: inherit; opacity: .55; padding: 0; }
.flash-x .ico { width: 14px; height: 14px; }

/* ---------- Estado vacío / carga ----------------------------------------- */
.vacio { text-align: center; padding: 46px 24px; }
.vacio .vacio-ico { width: 50px; height: 50px; margin: 0 auto 12px; border-radius: 14px; background: #f1f4f8; display: grid; place-items: center; color: #8b97a8; }
.vacio .vacio-ico .ico { width: 24px; height: 24px; }
.vacio h3 { font-size: 14px; margin-bottom: 5px; }
.vacio p { color: var(--muted); font-size: 12px; max-width: 380px; margin: 0 auto 14px; }

/* ---------- Auth ---------------------------------------------------------- */
body.auth { background: var(--navy); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.02fr .98fr; }
.auth-marca {
  position: relative; padding: 54px 56px; color: #fff; display: flex; flex-direction: column; justify-content: center; overflow: hidden;
  background: radial-gradient(70% 50% at 20% 100%, rgba(220,179,74,.12), transparent 70%), linear-gradient(160deg, #0b1e30 0%, #060f19 100%);
}
.auth-marca::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(200deg, #000, transparent 65%); pointer-events: none; }
.auth-marca > * { position: relative; z-index: 1; }
.auth-logo { margin-bottom: 34px; }
.auth-logo img { border-radius: 18px; box-shadow: 0 20px 50px -14px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08); }
.auth-kicker { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--oro); font-weight: 650; margin-bottom: 14px; }
.auth-marca h1 { font-size: 38px; line-height: 1.1; letter-spacing: -.035em; font-weight: 620; color: #fff; }
.auth-marca h1 em { font-style: normal; color: var(--oro); }
.auth-baja { margin-top: 16px; color: rgba(255,255,255,.6); font-size: 13px; line-height: 1.65; max-width: 390px; }
.auth-lista { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.auth-lista li { display: flex; align-items: center; gap: 9px; font-size: 12px; color: rgba(255,255,255,.78); }
.auth-lista .ico { width: 15px; height: 15px; color: var(--oro); }
.auth-pie { margin-top: 40px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.3); }
.auth-panel { background: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 7vw, 92px); }
.auth-panel h2 { font-size: 24px; letter-spacing: -.03em; }
.auth-panel .sub { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.auth-form { margin-top: 26px; display: flex; flex-direction: column; gap: 14px; }
.auth-form .campo label { font-size: 11.5px; }
.auth-form input { height: 44px; }
.auth-legal { margin-top: 26px; font-size: 10.5px; color: #98a2b3; line-height: 1.5; }
.auth-demo { margin-top: 20px; border: 1px dashed #d6dde7; border-radius: 10px; padding: 10px 12px; background: #fafbfc; font-size: 11px; color: var(--muted); }
.auth-demo strong { color: var(--tinta-2); }
.auth-shell--error { grid-template-columns: 1fr; }
.error-pagina { text-align: center; max-width: 420px; margin: 0 auto; }
.error-codigo { font-size: 12px; font-weight: 700; letter-spacing: .18em; color: var(--accion); }
.error-pagina h1 { font-size: 26px; margin: 8px 0 8px; }
.error-pagina p { color: var(--muted); margin-bottom: 18px; }

/* ---------- Estado del servicio (/salud) --------------------------------- */
.salud-panel { max-width: 720px; margin: 0 auto; width: 100%; }
.salud-cabecera { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 28px; flex-wrap: wrap; }
.salud-cabecera img { border-radius: 10px; }
.salud-kicker { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accion); }
.salud-cabecera h1 { font-size: 26px; letter-spacing: -.03em; margin: 2px 0 4px; }
.salud-global { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.salud-global .ico { width: 14px; height: 14px; }
.salud-global--ok { background: #e8f7ee; color: #157347; }
.salud-global--error { background: #fdeceb; color: #b42318; }
.salud-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.salud-card { border: 1px solid var(--linea); border-radius: 14px; background: #fff; overflow: hidden; }
.salud-card header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--linea); background: #fafbfc; }
.salud-card header h2 { font-size: 15px; margin: 0 0 4px; }
.salud-card__ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #eef2f7; color: var(--navy, #0A1622); flex-shrink: 0; }
.salud-card__ico .ico { width: 18px; height: 18px; }
.salud-card--ok .salud-card__ico { background: #e8f7ee; color: #157347; }
.salud-card--error .salud-card__ico { background: #fdeceb; color: #b42318; }
.salud-card__cuerpo { padding: 8px 16px 14px; }
.salud-fila { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #eef1f5; font-size: 12.5px; }
.salud-fila:last-child { border-bottom: 0; }
.salud-fila span { color: var(--muted); }
.salud-fila b { font-weight: 600; text-align: right; color: var(--tinta-2, #1a2332); word-break: break-word; }
.salud-error { margin: 8px 0 0; font-size: 12px; color: #b42318; }
.salud-meta { margin-top: 22px; font-size: 11px; color: #98a2b3; line-height: 1.55; }
.salud-meta a { color: var(--accion); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 720px) {
  .salud-grid { grid-template-columns: 1fr; }
  .salud-global { margin-left: 0; }
}

/* ---------- Transparencia pública ---------------------------------------- */
body.publico { background: #f6f7f9; }
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 34px; background: #fff; border-bottom: 1px solid var(--linea); position: sticky; top: 0; z-index: 5; }
.pub-head-der { display: flex; align-items: center; gap: 12px; }
.pub-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: var(--muted); background: #f2f4f7; border-radius: 999px; padding: 5px 10px; }
.pub-chip .ico { width: 13px; height: 13px; }
.pub-com { font-size: 11.5px; color: var(--muted); }
.pub-main { max-width: 1080px; margin: 0 auto; padding: 30px 24px 50px; }
.pub-pie { max-width: 1080px; margin: 0 auto; padding: 20px 24px 40px; display: flex; justify-content: space-between; font-size: 10.5px; color: #98a2b3; border-top: 1px solid var(--linea); }

/* ---------- Progreso ------------------------------------------------------ */
.barra { height: 7px; border-radius: 99px; background: #e9edf3; overflow: hidden; }
.barra > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #1f9d55, #43c47a); transition: width .4s; }
.barra--azul > span { background: linear-gradient(90deg, #0a6cff, #5b9bff); }
.barra--ambar > span { background: linear-gradient(90deg, #d98511, #efb54a); }
.barra-fila { display: flex; align-items: center; gap: 10px; }
.barra-fila .barra { flex: 1; }
.barra-fila b { font-size: 11px; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* ---------- Lista de rinconadas ----------------------------------------- */
.lista-check { display: flex; flex-direction: column; }
.fila-check { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--linea-2); }
.fila-check:last-child { border-bottom: 0; }
.fila-check .num { width: 26px; height: 26px; border-radius: 8px; background: #f1f4f8; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: var(--muted); flex: none; }
.fila-check .nom { flex: 1; min-width: 0; }
.fila-check .nom strong { font-size: 12.5px; display: block; }
.fila-check .nom small { color: var(--muted); font-size: 11px; }
.fila-check .estado { display: flex; align-items: center; gap: 8px; }
.fila-check.is-hecho .num { background: #e8f7ee; color: #157347; }
.fila-check.is-obs .num { background: #fdf3e1; color: #9a5b00; }

/* ---------- Evidencias --------------------------------------------------- */
.galeria { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.galeria--4 { grid-template-columns: repeat(4, 1fr); }
.foto { position: relative; border-radius: 10px; overflow: hidden; background: #dde3ea; aspect-ratio: 4 / 3; border: 1px solid var(--linea); }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto .pie { position: absolute; inset: auto 0 0 0; padding: 6px 8px; background: linear-gradient(transparent, rgba(5,12,20,.85)); color: #fff; font-size: 9.5px; display: flex; justify-content: space-between; align-items: center; }
.foto .angulo { position: absolute; top: 7px; left: 7px; background: rgba(5,12,20,.62); backdrop-filter: blur(4px); color: #fff; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; padding: 3px 6px; border-radius: 5px; font-weight: 600; }
.foto--vacia { display: grid; place-items: center; color: #98a2b3; background: #f7f9fb; border-style: dashed; }
.foto--vacia .ico { width: 22px; height: 22px; }
.foto--chica { aspect-ratio: 1; }

/* ---------- Timeline ----------------------------------------------------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 1.5px; background: var(--linea); }
.tl-item { position: relative; padding: 0 0 18px 8px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -20px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid #c3ccd8; }
.tl-item--ok::before { border-color: var(--verde); background: var(--verde); }
.tl-item--warn::before { border-color: var(--ambar); background: var(--ambar); }
.tl-item--bad::before { border-color: var(--rojo); background: var(--rojo); }
.tl-item h4 { font-size: 12.5px; font-weight: 600; }
.tl-item p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tl-item time { font-size: 10.5px; color: #98a2b3; font-variant-numeric: tabular-nums; }

/* ---------- Mapa --------------------------------------------------------- */
.mapa-plano { position: relative; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--linea); }
.mapa-plano svg { display: block; width: 100%; height: auto; }
.mapa-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
.mapa-scroll .mapa-plano { min-width: 780px; }
.mapa-leyenda { display: flex; flex-wrap: wrap; gap: 12px 18px; padding: 10px 2px 0; font-size: 10.5px; color: var(--muted); }
.mapa-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.mapa-leyenda i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.mapa-nota { font-size: 10.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.45; }
.mapa-picker { position: relative; border: 1px solid var(--linea); border-radius: 10px; overflow: hidden; cursor: crosshair; background: #fff; }
.mapa-picker img { display: block; width: 100%; height: auto; opacity: .92; }
.mapa-pin { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #D63384; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(214,51,132,.45); display: none; pointer-events: none; }
.trazo-ruta { mix-blend-mode: multiply; }
.mapa-caja { position: relative; border-radius: var(--radio); overflow: hidden; background: #eef2f6; border: 1px solid var(--linea); min-height: 260px; }
.mapa-caja svg { display: block; width: 100%; height: auto; }
.mapa-pin { cursor: pointer; }
.mapa-leyenda { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 14px; background: #fff; border-top: 1px solid var(--linea); font-size: 10.5px; color: var(--muted); }
.mapa-leyenda i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* ---------- Dos columnas panel ------------------------------------------ */
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 16px; align-items: start; }
.cols--igual { grid-template-columns: 1fr 1fr; }
.pila { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Varios ------------------------------------------------------- */
.link-fila { display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-bottom: 1px solid var(--linea-2); color: var(--tinta); font-size: 12.5px; }
.link-fila:last-child { border-bottom: 0; }
.link-fila:hover { background: #fbfcfe; }
.link-fila .ico { color: #98a2b3; width: 16px; height: 16px; }
.link-fila strong { font-weight: 600; }
.link-fila small { color: var(--muted); }
.dato-lista { display: grid; grid-template-columns: 118px 1fr; gap: 8px 12px; font-size: 12px; }
.dato-lista dt { color: var(--muted); font-size: 11px; }
.dato-lista dd { margin: 0; font-weight: 500; }
.codigo { font-family: var(--mono); font-size: 10.5px; background: #f4f6f9; border: 1px solid var(--linea-2); border-radius: 6px; padding: 2px 6px; color: var(--tinta-2); word-break: break-all; }
.alerta-bloque { display: flex; gap: 10px; padding: 13px 15px; border-radius: 11px; background: #fffaeb; border: 1px solid #f3e0ae; color: #7a4f00; font-size: 12px; }
.alerta-bloque .ico { color: #b7791f; margin-top: 1px; }
.alerta-bloque--rojo { background: #fef4f3; border-color: #f4cdc9; color: #a41d14; }
.alerta-bloque--rojo .ico { color: var(--rojo); }
.sep { height: 1px; background: var(--linea-2); margin: 14px 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 6px 0; }
.kv + .kv { border-top: 1px solid var(--linea-2); }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; font-variant-numeric: tabular-nums; }

.filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--linea-2); }
.filtros .campo { min-width: 135px; }
.filtros .campo label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.filtros input, .filtros select { height: 34px; font-size: 12px; }
.filtros .btn { height: 34px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--linea); padding: 0 14px; }
.tab-link { padding: 11px 12px; font-size: 12px; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-link.is-on { color: var(--tinta); border-bottom-color: var(--navy); }
.tab-link:hover { color: var(--tinta); }

/* ---------- Print -------------------------------------------------------- */
@media print {
  .sidebar, .topbar-acciones, .no-print, .flash { display: none !important; }
  .shell { display: block; }
  .topbar { padding: 0 0 12px; }
  .contenido { padding: 0; }
  body { background: #fff; font-size: 11px; }
  .card { box-shadow: none; border-color: #d9dee6; break-inside: avoid; }
  .galeria { grid-template-columns: repeat(4, 1fr); }
  a { color: inherit; }
}

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 18px 18px 14px; }
  .contenido { padding: 0 18px 30px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-marca { display: none; }
  .form-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
}


/* ==========================================================================
   Acceso: encabezado del formulario
   ========================================================================== */
.auth-head .eyebrow { margin-bottom: 8px; }
.auth-head h2 { font-size: 24px; letter-spacing: -.03em; }
.auth-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

/* ==========================================================================
   Portal público de transparencia
   ========================================================================== */
.pub-hero {
  display: flex; justify-content: space-between; gap: 30px; align-items: center;
  background: radial-gradient(90% 90% at 100% 0%, rgba(220,179,74,.16), transparent 60%), linear-gradient(150deg, #0c2033, #07121d);
  color: #fff; border-radius: 20px; padding: 38px 40px; margin-bottom: 16px; position: relative; overflow: hidden;
}
.pub-hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 20px 20px; mask-image: linear-gradient(120deg, #000, transparent 70%); pointer-events: none; }
.pub-hero > * { position: relative; z-index: 1; }
.pub-hero .eyebrow { color: var(--oro); }
.pub-hero h1 { color: #fff; font-size: 33px; line-height: 1.12; letter-spacing: -.04em; margin: 10px 0 10px; font-weight: 620; }
.pub-hero h1 em { font-style: normal; color: var(--oro); }
.pub-hero p { color: rgba(255,255,255,.6); font-size: 13px; max-width: 520px; line-height: 1.6; }
.pub-hero-marca { text-align: center; flex: none; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.pub-hero-marca img { width: 62px; height: 62px; border-radius: 14px; box-shadow: 0 14px 30px -12px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.1); }
.pub-hero-marca strong { font-size: 11.5px; letter-spacing: .04em; color: rgba(255,255,255,.9); font-weight: 600; max-width: 170px; }
.pub-hero-marca span { font-size: 10px; color: rgba(255,255,255,.4); }

.pub-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.pub-kpi { background: #fff; border: 1px solid var(--linea); border-radius: 14px; padding: 14px 16px; box-shadow: var(--sombra); }
.pub-kpi span { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 650; }
.pub-kpi b { display: block; font-size: 25px; letter-spacing: -.04em; margin-top: 5px; font-variant-numeric: tabular-nums; }
.pub-kpi small { font-size: 10.5px; color: var(--muted); }

.pub-lista { display: flex; flex-direction: column; gap: 12px; }
.pub-ronda { background: #fff; border: 1px solid var(--linea); border-radius: 16px; box-shadow: var(--sombra); overflow: hidden; }
.pub-ronda > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--linea-2); }
.pub-ronda h2 { font-size: 14px; margin-top: 3px; letter-spacing: -.01em; }
.pub-ronda-estado { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.pub-ronda-cuerpo { display: grid; grid-template-columns: 1.1fr 1.4fr auto; gap: 20px; align-items: center; padding: 16px 20px; }
.pub-progreso p { font-size: 10.5px; color: var(--muted); margin-top: 8px; }
.pub-fotos { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.pub-fotos a, .pub-fotos img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: #eef1f5; }
.pub-foto-vacia { display: block; aspect-ratio: 1; border-radius: 6px; background: #f2f4f7; border: 1px dashed #e0e5ec; }
.pub-nota { display: flex; gap: 8px; align-items: flex-start; margin-top: 18px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.pub-nota .ico { width: 15px; height: 15px; flex: none; margin-top: 1px; color: #98a2b3; }
.pub-volver { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.pub-volver .ico { width: 15px; height: 15px; }
.pub-detalle-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.pub-detalle-h h1 { font-size: 26px; letter-spacing: -.03em; margin: 4px 0; }
.pub-detalle-h p { font-size: 12px; color: var(--muted); }
.pub-punto { background: #fff; border: 1px solid var(--linea); border-radius: 14px; padding: 16px 18px; margin-bottom: 10px; box-shadow: var(--sombra); }
.pub-punto > header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pub-punto-num { width: 34px; height: 26px; border-radius: 7px; background: #0d1e2f; color: #fff; display: grid; place-items: center; font-family: var(--mono); font-size: 10.5px; font-weight: 700; flex: none; }
.pub-punto h3 { font-size: 13px; }
.pub-punto p { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.pub-punto > header > .badge { margin-left: auto; }
.pub-fotos--3 { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pub-fotos--3 figure { margin: 0; }
.pub-fotos--3 img { aspect-ratio: 4 / 3; border-radius: 8px; }
.pub-fotos--3 figcaption { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.pub-fotos--3 .pub-sin { display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border: 1px dashed #d9dfe7; border-radius: 8px; background: #fafbfc; color: #b0b9c4; gap: 6px; }
.pub-fotos--3 .pub-sin .ico { width: 20px; height: 20px; }
@media (max-width: 900px) {
  .pub-hero { flex-direction: column; text-align: center; padding: 28px 22px; }
  .pub-hero h1 { font-size: 25px; }
  .pub-kpis { grid-template-columns: 1fr 1fr; }
  .pub-ronda-cuerpo { grid-template-columns: 1fr; }
  .pub-fotos { grid-template-columns: repeat(3, 1fr); }
  .pub-head { padding: 14px 18px; }
  .pub-com { display: none; }
}
@media print {
  .pub-head, .pub-pie, .pub-volver, .btn { display: none !important; }
  body.publico { background: #fff; }
  .pub-hero { background: #0c2033 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pub-punto { break-inside: avoid; page-break-inside: avoid; }
}

