/* =====================================================================
   Panel de administración — hoja de estilos propia (sin frameworks)
   ===================================================================== */
:root {
  --fondo: #f3f5f9;
  --tarjeta: #ffffff;
  --texto: #1d2433;
  --tenue: #6b7385;
  --borde: #e2e6ef;
  --lateral: #141b2d;
  --lateral-2: #1d2740;
  --lateral-txt: #b8c1d9;
  --pri: #2563eb;
  --pri-osc: #1d4ed8;
  --pri-suave: #e8effe;
  --ok: #16a34a;
  --ok-suave: #e7f6ec;
  --peligro: #dc2626;
  --peligro-suave: #fdecec;
  --aviso: #d97706;
  --info-suave: #eaf2ff;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(20, 27, 45, .05), 0 6px 20px rgba(20, 27, 45, .06);
  --fuente: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--fuente); color: var(--texto); background: var(--fondo); }
a { color: var(--pri); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: #eef1f6; padding: 1px 6px; border-radius: 6px; }
mark { background: #fff1a8; color: inherit; padding: 0 2px; border-radius: 3px; }
hr { border: 0; border-top: 1px solid var(--borde); margin: 16px 0; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.tenue { color: var(--tenue); }
.peq { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- Estructura ---------- */
.app { display: flex; min-height: 100vh; background: linear-gradient(90deg, var(--lateral) 258px, transparent 258px); }
.lateral { width: 258px; flex: none; background: var(--lateral); color: var(--lateral-txt); position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #33405f transparent; }
.marca { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; color: #fff; font-weight: 800; font-size: 19px; text-decoration: none !important; }
.marca small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #8190b5; }
.marca-ic { width: 36px; height: 36px; padding: 6px; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, #22c1c3); color: #fff; }
.menu { padding: 4px 12px 28px; }
.menu-grupo { margin: 18px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6c7aa0; }
.menu-it { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--lateral-txt); font-size: 14px; text-decoration: none !important; transition: background .15s, color .15s; }
.menu-it .ic { width: 18px; height: 18px; opacity: .85; }
.menu-it:hover { background: var(--lateral-2); color: #fff; }
.menu-it.act { background: var(--pri); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .35); }
.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.barra { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 28px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--borde); }
.barra-titulo { font-size: 18px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-usuario { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--borde); }
.avatar-ini { display: grid; place-items: center; background: var(--pri-suave); color: var(--pri); font-weight: 800; }
.usuario-nom { font-weight: 600; font-size: 14px; }
.form-salir { margin: 0; }
.sesion-reloj { font-size: 12px; color: var(--tenue); background: #f0f2f7; padding: 3px 10px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.sesion-reloj.poco { background: #fff4e0; color: var(--aviso); font-weight: 700; }
.menu-btn { display: none; }
.contenido { padding: 26px 28px 40px; flex: 1; width: 100%; max-width: 1500px; }
.pie { padding: 16px 28px; font-size: 12px; color: var(--tenue); border-top: 1px solid var(--borde); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: 600 14px/1.2 var(--fuente); cursor: pointer; text-decoration: none !important; transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn-pri { background: var(--pri); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .28); }
.btn-pri:hover { background: var(--pri-osc); }
.btn-sec { background: #fff; color: var(--texto); border-color: var(--borde); }
.btn-sec:hover { background: #f6f8fc; border-color: #cfd6e4; }
.btn-fant { background: transparent; color: var(--tenue); }
.btn-fant:hover { background: #eef1f6; }
.btn-peligro { background: var(--peligro); color: #fff; }
.btn-peligro:hover { background: #b91c1c; }
.btn-peligro-sec { background: #fff; color: var(--peligro); border-color: #f5c2c2; }
.btn-peligro-sec:hover { background: var(--peligro-suave); }
.btn-peq { padding: 7px 12px; font-size: 13px; }
.btn-bloque { width: 100%; }
.btn:disabled, .btn.enviando { opacity: .6; cursor: progress; }
.btn-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--borde); background: #fff; color: var(--tenue); cursor: pointer; transition: all .15s; }
.btn-ic .ic { width: 17px; height: 17px; }
.btn-ic:hover { color: var(--texto); border-color: #c9d1e1; background: #f6f8fc; text-decoration: none; }
.btn-ic-pri:hover { color: var(--pri); border-color: #bcd0fb; background: var(--pri-suave); }
.btn-ic-peligro:hover { color: var(--peligro); border-color: #f3bcbc; background: var(--peligro-suave); }

/* ---------- Tarjetas y avisos ---------- */
.tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); padding: 20px 22px; margin-bottom: 22px; }
.tarjeta-tit { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.tarjeta-tit h2 { font-size: 16px; flex: 1; }
.tarjeta-tit > .ic { color: var(--pri); }
.tit-link { font-size: 13px; font-weight: 600; }
.tit-acc { display: flex; gap: 8px; }
.aviso { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 40px 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.aviso .ic { width: 18px; height: 18px; }
.aviso-ok { background: var(--ok-suave); border-color: #bfe5cb; color: #166534; }
.aviso-error { background: var(--peligro-suave); border-color: #f5c2c2; color: #991b1b; }
.aviso-info { background: var(--info-suave); border-color: #c8dafc; color: #1e40af; }
.aviso-x { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 20px; color: inherit; cursor: pointer; opacity: .6; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef1f6; color: #4b5468; white-space: nowrap; }
.chip-ok { background: var(--ok-suave); color: #15803d; }
.chip-no { background: #f3f4f6; color: #6b7280; }

/* ---------- Encabezado de módulo ---------- */
.cabecera-mod { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.cabecera-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, #3b82f6, #22c1c3); color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, .25); flex: none; }
.cabecera-ic .ic { width: 28px; height: 28px; }
.cabecera-txt { flex: 1; min-width: 0; }
.cabecera-txt h2 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.cabecera-txt p { margin: 4px 0 0; color: var(--tenue); font-size: 14px; }
.contador { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--pri-suave); color: var(--pri); }
.migas { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 14px; color: var(--tenue); }
.migas a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.migas .ic { width: 16px; height: 16px; }

/* ---------- Filtros y buscador ---------- */
.filtros { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.buscador { position: relative; flex: 1; min-width: 240px; display: flex; align-items: center; }
.buscador > .ic { position: absolute; left: 14px; color: var(--tenue); pointer-events: none; }
.buscador input { width: 100%; padding: 12px 70px 12px 44px; border: 1px solid var(--borde); border-radius: 12px; font: 15px var(--fuente); background: #f8f9fc; transition: border .15s, box-shadow .15s, background .15s; }
.buscador input:focus { outline: none; background: #fff; border-color: #93b4f8; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.buscador kbd { position: absolute; right: 12px; font: 600 12px var(--fuente); color: var(--tenue); border: 1px solid var(--borde); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; background: #fff; }
.buscando { position: absolute; right: 44px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #c9d6f5; border-top-color: var(--pri); animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.por-pagina { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tenue); }
select, input, textarea { font: 15px var(--fuente); color: var(--texto); }
.por-pagina select { padding: 9px 10px; border: 1px solid var(--borde); border-radius: 10px; background: #fff; }

/* ---------- Tabla ---------- */
.tabla-envoltura { overflow-x: auto; border: 1px solid var(--borde); border-radius: 12px; }
#resultados { transition: opacity .15s; }
#resultados.cargando { opacity: .55; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--tenue); background: #f7f8fb; padding: 0; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla th:not(:has(button)) { padding: 11px 14px; }
.ordenar { display: flex; align-items: center; gap: 6px; width: 100%; padding: 11px 14px; border: 0; background: none; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.ordenar:hover { color: var(--texto); }
.ordenar i { width: 0; height: 0; border: 4px solid transparent; border-top-color: #b4bccc; margin-top: 4px; }
.ordenar.act { color: var(--pri); }
.ordenar.act.asc i { border-top-color: transparent; border-bottom-color: var(--pri); margin-top: -4px; }
.ordenar.act.desc i { border-top-color: var(--pri); }
.tabla td { padding: 10px 14px; border-bottom: 1px solid #eef0f5; vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr { transition: background .12s; }
.tabla tbody tr:hover { background: #f8faff; }
.col-id { color: var(--tenue); font-variant-numeric: tabular-nums; width: 60px; }
.col-textarea, .col-code { max-width: 420px; color: #3e4659; }
.col-acc { width: 1%; white-space: nowrap; text-align: right; }
.acciones { display: flex; gap: 6px; justify-content: flex-end; }
.miniatura { width: 64px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--borde); background: #f1f3f8; display: block; }
.sin-img { display: grid; place-items: center; width: 64px; height: 46px; border-radius: 8px; background: #f1f3f8; color: #b6bdcc; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.archivo { display: inline-flex; align-items: center; gap: 6px; color: #3e4659; }
.archivo .ic { width: 16px; height: 16px; color: var(--tenue); }
.vacio { text-align: center; padding: 48px 16px !important; color: var(--tenue); }
.ic-gr { width: 40px; height: 40px; opacity: .4; }
.paginacion { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.pag-info { font-size: 14px; color: var(--tenue); }
.pag-btns { display: flex; gap: 6px; }
.pag { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--borde); background: #fff; font: 600 14px var(--fuente); color: var(--texto); cursor: pointer; display: inline-grid; place-items: center; text-decoration: none !important; }
.pag:hover:not(:disabled) { border-color: #a9bff3; color: var(--pri); }
.pag.act { background: var(--pri); border-color: var(--pri); color: #fff; }
.pag:disabled { opacity: .4; cursor: default; }

/* ---------- Formularios ---------- */
.form-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.form-lado { position: sticky; top: 84px; }
.rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.rejilla-1 { grid-template-columns: 1fr; }
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo-full, .campo-textarea, .campo-code, .campo-image, .campo-file { grid-column: 1 / -1; }
.campo label { font-size: 13px; font-weight: 700; color: #39425a; }
.req { color: var(--peligro); }
.campo input[type="text"], .campo input[type="tel"], .campo input[type="email"], .campo input[type="url"], .campo input[type="number"], .campo input[type="date"],
.campo input[type="datetime-local"], .campo input[type="password"], .campo select, .campo textarea, .subida-texto {
  width: 100%; padding: 10px 13px; border: 1px solid #d5dbe7; border-radius: 10px; background: #fff; transition: border .15s, box-shadow .15s;
}
.campo textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.campo textarea.mono { font: 13px/1.5 ui-monospace, Consolas, monospace; background: #fbfcfe; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .subida-texto:focus { outline: none; border-color: #93b4f8; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.campo-error input, .campo-error select, .campo-error textarea { border-color: #f09b9b; background: #fffafa; }
.ayuda { font-size: 12px; color: var(--tenue); }
.error-txt { font-size: 12px; font-weight: 600; color: var(--peligro); }
.color-fila { display: flex; align-items: center; gap: 10px; }
.color-fila input[type="color"] { width: 54px; height: 40px; padding: 2px; border: 1px solid #d5dbe7; border-radius: 10px; background: #fff; cursor: pointer; }
.pass-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pass-medidor { height: 5px; border-radius: 3px; background: #eceff5; overflow: hidden; }
.pass-medidor i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .25s, background .25s; }
.pass-medidor[data-nivel="1"] i { width: 25%; background: #ef4444; }
.pass-medidor[data-nivel="2"] i { width: 50%; background: #f59e0b; }
.pass-medidor[data-nivel="3"] i { width: 75%; background: #84cc16; }
.pass-medidor[data-nivel="4"] i { width: 100%; background: #16a34a; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tenue); font-weight: 600; cursor: pointer; }
.pila { display: grid; gap: 10px; }
.subida { display: flex; gap: 16px; align-items: flex-start; padding: 14px; border: 1px dashed #c9d2e3; border-radius: 12px; background: #fafbfe; }
.subida-prev { width: 150px; flex: none; }
.prev-img { width: 150px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--borde); background: #fff; display: block; }
.prev-vacio, .prev-arch { width: 150px; height: 110px; border-radius: 10px; border: 1px solid var(--borde); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--tenue); font-size: 12px; text-align: center; padding: 8px; word-break: break-all; }
.prev-arch { color: var(--pri); font-weight: 600; }
.subida-acc { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; align-items: flex-start; }
.subida-btn { position: relative; overflow: hidden; }
.subida-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.subida-nom { font-size: 13px; font-weight: 600; color: var(--ok); }
.vista-info { width: 100%; height: 360px; border: 1px solid var(--borde); border-radius: 10px; background: #fff; margin-bottom: 10px; }

/* ---------- Detalle ---------- */
.detalle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.det-fila { padding: 12px 0; border-bottom: 1px solid #eef0f5; min-width: 0; }
.det-full { grid-column: 1 / -1; }
.detalle dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tenue); margin-bottom: 4px; }
.detalle dd { margin: 0; word-break: break-word; }
.det-img { max-width: 260px; max-height: 200px; border-radius: 10px; border: 1px solid var(--borde); }
.codigo { max-height: 340px; overflow: auto; background: #0f172a; color: #dbe4ff; padding: 14px; border-radius: 10px; font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.texto-largo { max-height: 420px; overflow: auto; line-height: 1.65; }
.muestra-color { display: inline-block; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--borde); vertical-align: middle; }

/* ---------- Panel ---------- */
.bienvenida { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; padding: 24px 26px; border-radius: var(--radio); color: #fff; background: linear-gradient(120deg, #1e3a8a, #2563eb 55%, #22c1c3); box-shadow: 0 12px 30px rgba(37, 99, 235, .25); }
.bienvenida h2 { font-size: 24px; }
.bienvenida .tenue { color: #dbe6ff; margin: 6px 0 0; }
.bienvenida .btn-pri { background: #fff; color: var(--pri); box-shadow: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 18px; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); color: var(--texto); text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(20, 27, 45, .1); }
.kpi-ic { grid-row: 1 / 3; width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--pri-suave); color: var(--pri); }
.kpi b { font-size: 24px; line-height: 1.1; }
.kpi span { font-size: 13px; color: var(--tenue); }
.kpi-alerta .kpi-ic { background: var(--peligro-suave); color: var(--peligro); }
.kpi-alerta b { color: var(--peligro); }
.dos-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.barras { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.barras li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.barras a { color: var(--texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-fondo { grid-column: 1; height: 8px; border-radius: 4px; background: #eef1f6; overflow: hidden; }
.barra-val { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #3b82f6, #22c1c3); transition: width .8s ease; }
.barras b { grid-column: 2; grid-row: 1 / 3; align-self: center; font-variant-numeric: tabular-nums; }
.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef0f5; }
.lista-simple li:last-child { border-bottom: 0; }
.lista-simple a { display: inline-flex; align-items: center; gap: 8px; color: var(--texto); min-width: 0; }
.lista-simple .ic { color: var(--pri); width: 18px; height: 18px; }
.modulos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.modulo { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--borde); border-radius: 12px; color: var(--texto); font-size: 14px; font-weight: 600; text-decoration: none !important; transition: border .15s, background .15s; }
.modulo:hover { border-color: #b9cdf9; background: #f7faff; }
.modulo .ic { color: var(--pri); width: 18px; height: 18px; }
.modulo span { flex: 1; min-width: 0; }
.modulo b { font-size: 13px; color: var(--tenue); font-variant-numeric: tabular-nums; }
.actividad { list-style: none; margin: 0; padding: 0; }
.actividad li { position: relative; padding: 10px 0 10px 22px; border-bottom: 1px solid #eef0f5; font-size: 14px; }
.actividad li:last-child { border-bottom: 0; }
.act-punto { position: absolute; left: 2px; top: 17px; width: 9px; height: 9px; border-radius: 50%; background: var(--pri); }
.act-ingreso_fallido .act-punto, .act-csrf_rechazado .act-punto, .act-eliminar .act-punto { background: var(--peligro); }
.act-crear .act-punto { background: var(--ok); }
.actividad time { display: block; font-size: 12px; color: var(--tenue); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); animation: aparece .15s ease; }
.modal-caja { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 28px; text-align: center; box-shadow: 0 30px 60px rgba(0, 0, 0, .25); animation: sube .2s ease; }
.modal-ic { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--peligro-suave); color: var(--peligro); }
.modal-ic .ic { width: 28px; height: 28px; }
.modal-caja h2 { font-size: 19px; }
.modal-caja p { color: var(--tenue); margin: 8px 0 22px; }
.modal-acc { display: flex; gap: 10px; justify-content: center; }
body.con-modal { overflow: hidden; }
@keyframes aparece { from { opacity: 0; } }
@keyframes sube { from { transform: translateY(14px); opacity: 0; } }

/* ---------- Login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% 0%, #dbe7ff, transparent), radial-gradient(900px 500px at 100% 100%, #d4f5f2, transparent), var(--fondo); }
.login { width: 100%; max-width: 900px; display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 70px rgba(20, 27, 45, .16); }
.login-arte { background: linear-gradient(150deg, #141b2d, #1e3a8a 60%, #1c9aa3); color: #fff; padding: 46px 40px; display: flex; align-items: center; }
.login-arte h2 { font-size: 30px; margin-top: 18px; }
.login-arte p { color: #c9d6f5; margin: 6px 0 26px; }
.login-escudo { width: 64px; height: 64px; padding: 12px; border-radius: 18px; background: rgba(255, 255, 255, .12); }
.login-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-size: 14px; color: #e3eaff; }
.login-lista li { display: flex; align-items: center; gap: 10px; }
.login-lista .ic { width: 18px; height: 18px; color: #7dd3d8; }
.login-caja { padding: 46px 42px; }
.login-caja h1 { font-size: 26px; }
.login-caja > .tenue { margin: 6px 0 22px; }
.login-form { display: grid; gap: 8px; }
.login-form label { font-size: 13px; font-weight: 700; color: #39425a; margin-top: 8px; }
.input-ic { position: relative; display: flex; align-items: center; }
.input-ic > .ic { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--tenue); }
.input-ic input { width: 100%; padding: 12px 46px 12px 42px; border: 1px solid #d5dbe7; border-radius: 11px; font-size: 15px; transition: border .15s, box-shadow .15s; }
.input-ic input:focus { outline: none; border-color: #93b4f8; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.ver-clave { position: absolute; right: 6px; border: 0; background: none; }
.login-form .btn { margin-top: 16px; padding: 13px; }
.volver-sitio { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; font-size: 14px; font-weight: 600; }
.volver-sitio .ic { width: 16px; height: 16px; }

/* ---------- Adaptable ---------- */
@media (max-width: 1100px) {
  .form-cuerpo { grid-template-columns: 1fr; }
  .form-lado { position: static; }
}
@media (max-width: 900px) {
  .app { background: none; }
  .lateral { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  body.menu-abierto .lateral { transform: none; }
  .menu-btn { display: inline-grid; }
  .usuario-nom, .sesion-reloj, .form-salir .btn span { display: none; }
  .contenido { padding: 18px 16px 30px; }
  .barra { padding: 10px 16px; }
  .dos-col, .detalle { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-arte { display: none; }
  .login-caja { padding: 34px 26px; }
}
@media (max-width: 640px) {
  .rejilla, .pass-fila { grid-template-columns: 1fr; }
  .cabecera-mod { flex-wrap: wrap; }
  .cabecera-mod .btn { width: 100%; }
  .subida { flex-direction: column; }
  .bienvenida { flex-direction: column; align-items: flex-start; }
  /* la tabla se convierte en tarjetas */
  .tabla-envoltura { border: 0; }
  .tabla thead { display: none; }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
  .tabla tbody tr { border: 1px solid var(--borde); border-radius: 12px; margin-bottom: 12px; padding: 8px 12px; background: #fff; }
  .tabla td { border: 0; padding: 6px 0; display: flex; gap: 12px; justify-content: space-between; text-align: right; }
  .tabla td[data-l]::before { content: attr(data-l); font-size: 12px; font-weight: 700; color: var(--tenue); text-align: left; }
  .col-id::before { content: "#"; font-weight: 700; }
  .col-acc { width: 100%; }
  .acciones { justify-content: flex-end; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* =====================================================================
   AMPLIACIÓN oct-2026: IA, análisis con gráficos, ajustes y certificados
   ===================================================================== */
.cabecera-acc { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.dos-col + .dos-col, .dos-col + .tarjeta, .tarjeta + .dos-col { margin-top: 22px; }
.dos-col > .tarjeta { margin: 0; }
.btn-ia { background: linear-gradient(135deg, #6250d6, #2a78d6); color: #fff; box-shadow: 0 4px 14px rgba(98, 80, 214, .3); }
.btn-ia:hover { filter: brightness(1.08); }
.btn-ia[disabled] { opacity: .55; cursor: not-allowed; }
.cabecera-ic-ia { background: linear-gradient(135deg, #6250d6, #2a78d6) !important; color: #fff !important; }
.tarjeta-ia { border-color: #d9d3fb; background: linear-gradient(180deg, #f7f5ff, #fff); }
.campo-sep { grid-column: 1 / -1; margin: 10px 0 -6px; padding-top: 14px; border-top: 1px dashed var(--borde); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--pri); }
.pestanas { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pestana { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 99px; background: #fff; border: 1px solid var(--borde); color: var(--texto); font-weight: 600; font-size: 14px; text-decoration: none !important; }
.pestana .ic { width: 16px; height: 16px; color: #6250d6; }
.pestana.act { background: #6250d6; border-color: #6250d6; color: #fff; }
.pestana.act .ic { color: #fff; }
.ia-espera { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(20, 27, 45, .55); backdrop-filter: blur(3px); }
.ia-espera-caja { display: grid; justify-items: center; gap: 8px; padding: 30px 40px; border-radius: 18px; background: #fff; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); text-align: center; }
.ia-espera-caja b { font-size: 18px; }
.ia-espera-caja small { color: var(--tenue); }
#iaSeg { font-variant-numeric: tabular-nums; color: #6250d6; font-weight: 700; }
.ia-giro { width: 46px; height: 46px; border-radius: 50%; border: 4px solid #e6e2fb; border-top-color: #6250d6; animation: giro 1s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
.barra-guardar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; margin-top: 18px; padding: 14px 0; background: linear-gradient(180deg, rgba(243, 245, 249, 0), var(--fondo) 40%); }
.tarjeta + .barra-guardar { margin-top: 0; }
.filtros-fila { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 14px 18px; margin-bottom: 18px; }
.filtros-fila label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.filtros-fila select { padding: 8px 10px; border: 1px solid var(--borde); border-radius: 8px; font: inherit; background: #fff; }
div.kpi:hover { transform: none; box-shadow: var(--sombra); }

/* gráficos SVG */
.graf { display: block; width: 100%; height: auto; overflow: visible; }
.graf text { font-family: var(--fuente); }
.graf-etq { font-size: 13px; fill: #1d2433; }
.graf-val { font-size: 12.5px; font-weight: 700; fill: #1d2433; }
.graf-eje { font-size: 11.5px; fill: #6b7385; }
.graf-centro { font-size: 21px; font-weight: 800; fill: #1d2433; }
.graf rect[fill], .graf circle { transition: opacity .15s; }
.graf rect:hover, .graf circle:hover { opacity: .82; }
.graf-dona { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.graf-dona-svg { width: 190px; flex: none; }
.graf-leyenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; flex: 1; min-width: 200px; }
.graf-leyenda li { display: flex; align-items: baseline; gap: 6px; }
.graf-leyenda li .graf-punto { align-self: center; }
.graf-punto { width: 12px; height: 12px; flex: none; }
.graf-datos { margin-top: 12px; font-size: 13px; }
.graf-datos summary { cursor: pointer; color: var(--pri); font-weight: 600; }
.tabla-compacta th, .tabla-compacta td { padding: 7px 10px; font-size: 13px; }
.tabla-reac th img { display: block; margin: 0 auto; }
.tabla-reac td.num { text-align: center; }
.analisis { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.55; }
.texto-ia { padding: 16px 18px; border-radius: 12px; background: #f7f5ff; border: 1px solid #e6e2fb; line-height: 1.6; }
.comentarios { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.comentarios li { padding: 12px 16px; border-radius: 12px; background: #f8fafc; border-left: 4px solid #a3aab8; }
.comentarios li.com-pos { border-left-color: #1baf7a; }
.comentarios li.com-neg { border-left-color: #e34948; }
.comentarios p { margin: 6px 0 0; }
.com-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tarjeta-cert { border-color: #f3dfa2; background: linear-gradient(180deg, #fffaf0, #fff); }
.tarjeta-cert form { margin: 0; }
.detalle-compacto { grid-template-columns: 1fr !important; margin-bottom: 14px; }
@media (max-width: 640px) { .cabecera-acc { width: 100%; } .cabecera-acc .btn { flex: 1; } }
.form-lado .subida { flex-direction: column; }

/* Logo de cladera.org en la tarjeta de ingreso */
.login-logo { display: block; width: 150px; max-width: 60%; height: auto; padding: 14px; margin-bottom: 8px; border-radius: 22px; background: #ffffff; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); object-fit: contain; }
.enlace-pub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.enlace-pub-txt { flex: 1; min-width: 240px; padding: 7px 10px; border: 1px solid var(--borde); border-radius: 8px; font: 13px ui-monospace, Consolas, monospace; background: #f8fafc; color: var(--texto); }
.enlace-form { display: block; word-break: break-all; font-family: ui-monospace, Consolas, monospace; }
