/* MINEXCHANGE · tema corporativo claro (gris nube, azul petróleo, teal de la marca y amarillo oro).
   Todos los colores salen de estos tokens. Los colores semánticos tienen dos tonos: el base (rellenos, iconos,
   bordes y gráficos) y uno «-ink» algo más oscuro para el texto sobre blanco, que cumple contraste AA (≥ 4,5:1). */
:root {
  /* superficies */
  --bg: #F3F6FA;            /* gris nube: fondo de la aplicación */
  --surface: #FFFFFF;       /* tarjetas, tablas, formularios */
  --surface-2: #F8FAFC;     /* cabeceras de tabla, hover, zonas secundarias */
  --line: #E2E8F0;          /* bordes y separadores */
  --line-2: #CBD5E1;        /* bordes de campos */
  /* texto */
  --ink: #0F1E33;           /* azul marino oscuro: texto principal y títulos */
  --ink-2: #334155;         /* texto de tabla */
  --slate: #64748B;         /* gris pizarra: información secundaria */
  /* marca */
  --navy: #142D4E;          /* azul petróleo: menú lateral */
  --navy-2: #0E2240;
  --navy-3: #1D3A61;
  --teal: #16A085;          /* «XCHANGE» y acento */
  --teal-ink: #0E7A65;      /* teal para texto y enlaces sobre blanco */
  --teal-light: #3CCFAE;    /* teal sobre azul petróleo */
  --teal-soft: #E6F6F2;
  --gold: #F5B414;          /* amarillo oro: botón principal */
  --gold-2: #F7C948;
  --gold-soft: #FEF6DC;
  /* semánticos */
  --pos: #16A085;  --pos-ink: #0E7A65;  --pos-soft: #E8F6F2;
  --warn: #D97706; --warn-ink: #B45309; --warn-soft: #FEF5E7;
  --neg: #DC5252;  --neg-ink: #C03A3A;  --neg-soft: #FDEEEE;
  /* forma */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 30, 51, .05), 0 4px 14px rgba(15, 30, 51, .05);
  --shadow-lg: 0 24px 60px rgba(15, 30, 51, .12), 0 4px 14px rgba(15, 30, 51, .06);
  --font: "Segoe UI", Inter, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* nombres heredados que usan algunas plantillas en atributos style="" y procesos antiguos */
  --panel: var(--surface); --panel-2: var(--surface-2); --text: var(--ink); --muted: var(--slate);
  --yellow: var(--gold); --ok: var(--pos-ink); --bad: var(--neg-ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 14.5px/1.5 var(--font);
  display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-auto-rows: auto; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* la columna del menú se pinta en el fondo para que llegue hasta abajo aunque la página sea más alta que la ventana */
body:not(.login-body) { background: linear-gradient(90deg, var(--navy-2) 0 248px, var(--bg) 248px); }
a { color: var(--teal-ink); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
::selection { background: rgba(22, 160, 133, .18); }

/* ---------------------------------------------------------------- menú lateral */
.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #E6ECF5;
  padding: 22px 14px 18px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand .mark {
  width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 22px; color: #fff; background: var(--navy); letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.brand .sep { width: 1.5px; align-self: stretch; background: currentColor; opacity: .55; margin: 2px 0; }
.brand b { display: block; font-size: 17px; font-weight: 800; letter-spacing: .01em; line-height: 1.1; color: var(--ink); }
.brand b span { color: var(--teal); }
.brand small { display: block; margin-top: 3px; color: var(--ink); font-size: 12px; letter-spacing: .1em; font-weight: 500; }
.sidebar .brand { padding: 0 6px; color: #fff; }
.sidebar .brand .mark { background: #fff; color: var(--navy); }
.sidebar .brand b { color: #fff; }
.sidebar .brand b span { color: var(--teal-light); }
.sidebar .brand small { color: #B9C6D8; font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #D5DEEA; font-weight: 500; font-size: 14px; text-decoration: none;
}
.nav a svg, .btn-salir svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active, .nav a[aria-current="page"] { background: var(--teal); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(22, 160, 133, .28); }
.nav a.active svg { opacity: 1; }

.usuario-sesion { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 12px; color: #B9C6D8; line-height: 1.4; }
.usuario-sesion b { font-size: 13px; color: #fff; font-weight: 600; word-break: break-all; }
.usuario-sesion form { margin: 10px 0 0; }
.btn-salir, button.btn-salir {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 10px;
  background: transparent; border: 1px solid rgba(255, 255, 255, .16); color: #E6ECF5; font-weight: 500;
  font-size: 13.5px; box-shadow: none;
}
.btn-salir:hover, button.btn-salir:hover { background: rgba(255, 255, 255, .08); color: #fff; filter: none; }
.versionapp { margin-top: 12px; padding: 0 10px; font-size: 12px; color: #8FA1B9; line-height: 1.4; }

/* ---------------------------------------------------------------- contenido */
main { min-width: 0; width: 100%; padding: 0 0 60px; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center;
  gap: 14px; padding: 12px 36px; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.topbar-usuario { display: flex; align-items: center; gap: 10px; line-height: 1.2; text-align: right; }
.topbar-usuario b { display: block; font-size: 13.5px; color: var(--ink); font-weight: 600; }
.topbar-usuario small { display: block; font-size: 12px; color: var(--slate); }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 14px; }
.contenido { padding: 26px 36px 0; max-width: 1360px; overflow-x: auto; }  /* una tabla muy ancha se desplaza dentro del contenido, nunca la página */

h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; color: var(--ink); letter-spacing: -.005em; }
h1 span { color: inherit; font-weight: inherit; }
.sub { color: var(--slate); margin: 0 0 22px; }
h2 { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: 0; margin: 28px 0 12px; }
h3 { font-size: 14px; color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code, pre { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; color: var(--ink-2); }
pre { padding: 10px 12px; overflow-x: auto; }
code:empty { display: none; }
details > summary { cursor: pointer; color: var(--teal-ink); font-weight: 600; }
strong, b { font-weight: 650; }

/* ---------------------------------------------------------------- tarjetas */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 10px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); min-width: 0;
}
.card .k { color: var(--slate); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.card .v { font-size: 24px; font-weight: 700; margin-top: 4px; color: var(--ink); font-variant-numeric: tabular-nums;
  letter-spacing: -.01em; }
.card .v small { font-size: 12px; color: var(--slate); font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.card .s { font-size: 12px; color: var(--slate); margin-top: 2px; }
a.card { color: var(--ink); display: block; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.card:hover { border-color: var(--teal); box-shadow: 0 6px 20px rgba(15, 30, 51, .08); color: var(--ink); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); }
.panel > h2:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- panel de control (dashboard.html) */
.panel-titulo h1 { margin-bottom: 0; }
.panel-titulo .sub { margin-bottom: 16px; }
.filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end;
  margin-bottom: 18px; padding: 14px 16px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpis .card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center;
  padding: 16px 18px; border-top: 3px solid var(--line); }
.kpis .card > * { grid-column: 2; }
.kpis .card > .kpi-ico { grid-column: 1; grid-row: 1 / span 4; align-self: center; }
.kpis .card .k { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis .card .v { font-size: 22px; margin-top: 2px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis .card .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis .card .v .badge { font-size: 12px; vertical-align: middle; }
.kpis .card.navy { border-top-color: var(--navy); }
.kpis .card.teal { border-top-color: var(--teal); }
.kpis .card.gold { border-top-color: var(--gold); }
.kpis .card.warn { border-top-color: var(--warn); }
.kpi-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; }
.kpi-ico svg { width: 22px; height: 22px; }
.kpi-ico.navy { background: #E7EDF6; color: var(--navy); }
.kpi-ico.teal { background: var(--teal-soft); color: var(--teal-ink); }
.kpi-ico.gold { background: var(--gold-soft); color: #9A6B00; }
.kpi-ico.warn { background: var(--warn-soft); color: var(--warn-ink); }
.kpi-ico.slate { background: #EEF2F7; color: var(--slate); }

.graficos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
.graficos .panel { padding: 16px 18px 14px; }
.graficos h2 { margin: 0 0 10px; font-size: 14.5px; }
.graficos h2 .nota { color: var(--slate); font-size: 12px; font-weight: 400; }
.graficos canvas { max-height: 230px; }
.titulo-seccion { margin: 24px 0 10px; }

.alertas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.alertas .card { display: flex; flex-direction: column; padding: 12px 14px 12px 16px; border-left: 4px solid var(--pos); }
.alertas .card:has(.v.neg) { border-left-color: var(--warn); }
.alertas .card .k { order: 2; font-size: 12.5px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-2); }
.alertas .card .v { order: 1; font-size: 22px; margin: 0; color: var(--pos-ink); }
.alertas .card .v.neg { color: var(--warn-ink); }
.alertas .card .s { order: 3; }
/* tarjetas con varios enlaces: el principal (.cubre) lleva número y texto; los secundarios van en .s */
.alertas .card > a.cubre { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.alertas .card:has(a.cubre) { transition: border-color .15s, box-shadow .15s; }
.alertas .card:has(a.cubre:hover) { box-shadow: 0 6px 20px rgba(15, 30, 51, .08); }

@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .kpis, .graficos { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- tablas financieras */
/* Toda tabla va dentro de <div class="tabla">: si no cabe, se desplaza a lo ancho dentro de su caja, nunca la página. */
.tabla { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.tabla + .tabla { margin-top: 12px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; font-weight: 700; color: var(--slate); text-transform: uppercase;
  letter-spacing: .05em; background: var(--surface-2); padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: bottom; }
td { padding: 9px 12px; border-bottom: 1px solid #EEF2F6; color: var(--ink-2); vertical-align: middle; font-size: 13.5px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #F6F9FC; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td b, td strong { color: var(--ink); }
tfoot td { background: var(--surface-2); font-weight: 600; color: var(--ink); }
.panel table { box-shadow: none; }
.pos { color: var(--pos-ink); } .neg { color: var(--neg-ink); }
.card .v.pos { color: var(--pos-ink); } .card .v.neg { color: var(--neg-ink); }

/* ---------------------------------------------------------------- botones */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 9px 18px; font: inherit; font-weight: 650; font-size: 14px; line-height: 1.35;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--ink); text-decoration: none;
  box-shadow: 0 2px 6px rgba(245, 180, 20, .28);
}
.btn:hover, button:hover { filter: brightness(1.04); color: var(--ink); text-decoration: none;
  box-shadow: 0 4px 12px rgba(245, 180, 20, .36); }
.btn:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid rgba(22, 160, 133, .45); outline-offset: 2px; }
.btn.ghost, button.ghost { background: var(--surface); color: var(--navy); border-color: var(--navy); box-shadow: none; }
.btn.ghost:hover, button.ghost:hover { background: #EEF3F9; color: var(--navy); filter: none; box-shadow: none; }
.btn.sm, button.sm { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }
.btn.danger, button.danger { background: var(--surface); color: var(--neg-ink); border-color: var(--neg); box-shadow: none; }
.btn.danger:hover, button.danger:hover { background: var(--neg); border-color: var(--neg); color: #fff; filter: none; }
/* botón apagado: mientras se envía un formulario (comun.js) o cuando no hay nada que cargar (cambiario) */
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; filter: none; box-shadow: none; }

/* ---------------------------------------------------------------- formularios */
form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--slate); text-transform: uppercase; letter-spacing: .04em; }
input, select, textarea {
  width: 100%; margin-top: 6px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 9px 12px; font: inherit; font-size: 14px; text-transform: none; letter-spacing: 0;
  font-weight: 400; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #94A3B8; }
input:hover, select:hover, textarea:hover { border-color: #94A3B8; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22, 160, 133, .18); }
input[type=checkbox], input[type=radio] { width: auto; margin: 0 6px 0 0; accent-color: var(--teal); box-shadow: none;
  vertical-align: -2px; }
input[type=file] { padding: 7px 10px; background: var(--surface-2); }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--slate); }
.full { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; margin-top: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- avisos */
.flash { padding: 11px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; border-left-width: 4px;
  background: var(--surface); }
.flash.ok, .flash.success { border-color: #BDE5DA; border-left-color: var(--pos); background: var(--pos-soft); color: #0B5E4E; }
.flash.error, .flash.danger { border-color: #F3C9C9; border-left-color: var(--neg); background: var(--neg-soft); color: #9F2D2D; }
.flash.warning, .flash.aviso { border-color: #F6D9AE; border-left-color: var(--warn); background: var(--warn-soft); color: #8A4106; }
.flash.info, .flash.message { border-color: var(--line); border-left-color: var(--navy); color: var(--ink-2); }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 8px; border: 1px solid #F6D9AE;
  border-left: 4px solid var(--warn); background: var(--warn-soft); color: #7C3A05; }
.alert a { color: #7C3A05; text-decoration: underline; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .03em;
  border: 1px solid var(--line-2); color: var(--slate); background: var(--surface-2); white-space: nowrap; line-height: 1.6; }
.badge.ingreso, .badge.ok { color: var(--pos-ink); border-color: #BDE5DA; background: var(--pos-soft); }
.badge.gasto, .badge.error { color: var(--neg-ink); border-color: #F3C9C9; background: var(--neg-soft); }
.badge.nc { color: var(--warn-ink); border-color: #F6D9AE; background: var(--warn-soft); }
.badge.nd { color: var(--navy); border-color: #C9D6E8; background: #EEF3F9; }

/* zona para soltar archivos y lecturas en segundo plano */
.dropzone { border: 2px dashed #A9C3DC; border-radius: var(--radius); padding: 26px 20px; text-align: center;
  background: #F7FAFD; color: var(--ink-2); transition: background .15s, border-color .15s; }
.dropzone.over { border-color: var(--teal); background: var(--teal-soft); }
.dropzone.cargando { opacity: .9; }
.dropzone.cargando > :not(.procesando) { opacity: .45; pointer-events: none; }
/* indicador «Procesando…» de las lecturas en segundo plano (SWIFT, cartas, lote de documentos) */
.procesando { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid #BDE5DA;
  background: var(--teal-soft); color: #0B5E4E; font-weight: 600; text-align: center; }
.procesando.error { border-color: #F3C9C9; background: var(--neg-soft); color: #9F2D2D; font-weight: 400; }
/* variante en línea que comun.js pone junto al botón de un formulario POST recién enviado */
.procesando.envio { display: inline-block; margin: 0; padding: 7px 14px; white-space: nowrap; }
.spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid #A7DCCF; border-top-color: var(--teal);
  border-radius: 50%; vertical-align: -2px; animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.dropzone input[type=file] { display: none; }
.chip { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: end; flex-wrap: wrap; }
.toolbar input, .toolbar select { margin-top: 0; width: auto; min-width: 220px; }
.toolbar label { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink-2); }
.toolbar label > input:not([type=checkbox]):not([type=radio]), .toolbar label > select { display: block; margin-top: 4px; }
.toolbar input[type=checkbox], .toolbar input[type=radio] { min-width: 0; width: auto; }
.toolbar > label:has(> input[type=checkbox]) { align-self: center; }
.empty { color: var(--slate); text-align: center; padding: 34px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }

/* valor interpretado junto a un campo numérico (numeros.js): «= 3.218,36» o «No se entiende el valor» */
.interpretado { display: inline-block; margin: 4px 0 0 8px; font-size: 12px; color: var(--teal-ink); font-weight: 600;
  text-transform: none; letter-spacing: 0; white-space: nowrap; }
.interpretado.error { color: var(--neg-ink); }
.interpretado[hidden] { display: none; }

/* Inicio de sesión simulado (solo desarrollo): banda fina amarilla/naranja arriba */
.franja-simulada { background: linear-gradient(90deg, var(--gold), var(--warn)); color: var(--ink); text-align: center;
  font-size: 12px; font-weight: 700; padding: 3px 8px; letter-spacing: .04em; grid-column: 1 / -1; }  /* en la cuadrícula de base.html ocupa toda la fila superior, no una columna */
.cuentas-sim { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.cuentas-sim form { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.cuentas-sim form:hover { border-color: var(--teal); }
.cuentas-sim small { color: var(--slate); }

@media (max-width: 900px) {
  body { grid-template-columns: minmax(0, 1fr); }
  body:not(.login-body) { background: var(--bg); }
  .sidebar { position: static; height: auto; padding: 16px 14px; }
  .sidebar .brand { margin-bottom: 14px; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .nav a { padding: 7px 10px; font-size: 13px; gap: 8px; }
  .usuario-sesion { margin-top: 14px; }
  .topbar { position: static; padding: 10px 16px; }
  .contenido { padding: 18px 16px 0; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .toolbar input, .toolbar select { min-width: 0; width: 100%; }
}

/* ---------------------------------------------------------------- Login (auth/_base_login.html, entrar.html, simulado.html)
   Fondo gris nube con franjas diagonales suaves en gris pizarra y, en las esquinas, bandas azul marino / teal /
   amarillo oro (solo CSS). Columna de bienvenida a la izquierda y tarjeta blanca a la derecha. Sin estilos en línea. */
body.login-body { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
main.login-main {
  position: relative; overflow: hidden; flex: 1; display: flex; flex-direction: column; padding: 0; max-width: none; min-width: 0;
  background:
    linear-gradient(118deg, transparent 0 18%, rgba(100, 116, 139, .06) 18% 30%, transparent 30% 46%,
      rgba(255, 255, 255, .7) 46% 52%, transparent 52% 64%, rgba(100, 116, 139, .07) 64% 78%, transparent 78%),
    linear-gradient(160deg, #F7F9FC 0%, #EEF2F7 55%, #E6EBF2 100%);
}
main.login-main::before, main.login-main::after { content: ""; position: absolute; pointer-events: none; z-index: 0; }
main.login-main::before {   /* esquina superior derecha */
  top: 0; right: 0; width: 300px; height: 260px;
  background: linear-gradient(225deg, var(--navy-3) 0 22%, var(--teal) 22% 36%, transparent 36% 39%,
    var(--gold) 39% 44%, transparent 44%);
  opacity: .95;
}
main.login-main::after {    /* esquina inferior izquierda */
  left: 0; bottom: 0; width: 620px; height: 230px;
  background: linear-gradient(20deg, var(--navy-2) 0 18%, var(--teal) 18% 25%, transparent 25% 26%,
    var(--warn) 26% 30%, var(--gold) 30% 33%, transparent 33%);
}
.login-avisos { position: relative; z-index: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px; }
.login-avisos .flash { margin: 16px 0 0; }

.login { position: relative; z-index: 1; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center; gap: 40px; max-width: 1280px; width: 100%; margin: 0 auto; padding: 40px 56px; }

/* marca de las pantallas de acceso: cuadrado azul marino «M» + línea + MINE/XCHANGE */
.login-brand { margin-bottom: 0; color: var(--ink); }
.login-brand .mark { width: 54px; height: 54px; border-radius: 12px; font-size: 30px; }
.login-brand b { font-size: 26px; }
.login-brand small { font-size: 13.5px; letter-spacing: .08em; }
.login-hero .login-brand .mark { width: 76px; height: 76px; border-radius: 16px; font-size: 42px; }
.login-hero .login-brand { gap: 18px; }
.login-hero .login-brand b { font-size: 36px; }
.login-hero .login-brand small { font-size: 17px; }
.tricolor { height: 3px; border-radius: 3px; border: 0; margin: 0;
  background: linear-gradient(90deg, var(--navy) 0 30%, var(--teal) 30% 65%, var(--gold) 65% 100%); }

/* columna izquierda */
.login-hero { display: flex; flex-direction: column; gap: 70px; padding: 20px 0; }
.login-bienvenida p { margin: 0; }
.login-hola { font-size: 44px; color: var(--ink); font-weight: 400; letter-spacing: -.01em; line-height: 1.1; }
.login-nombre { font-size: 58px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; line-height: 1.1; margin-top: 4px !important; }
.login-nombre span { color: var(--teal); }
.login-bienvenida .login-lema { margin-top: 16px; max-width: 420px; color: var(--slate); font-size: 21px; line-height: 1.4; }
.login-bienvenida .tricolor { width: 230px; margin-top: 30px; }
.login-institucional { display: flex; align-items: center; gap: 10px; margin-top: 26px !important; color: var(--slate);
  font-size: 12px; letter-spacing: .1em; font-weight: 600; }
.login-institucional img { width: 34px; height: 34px; }

/* columna derecha y tarjeta */
.login-lado { display: grid; place-items: center; }
.login-solo { position: relative; z-index: 1; flex: 1; display: grid; place-items: center; padding: 36px 16px; }
.login-tarjeta {
  width: 100%; max-width: 520px; background: var(--surface); border: 1px solid rgba(226, 232, 240, .9); border-radius: 24px;
  padding: 40px 44px 24px; box-shadow: var(--shadow-lg);
}
.login-tarjeta.ancha { max-width: 640px; }
.login-tarjeta > .login-brand { justify-content: center; }
.login-tarjeta > .tricolor { margin: 20px 0 0; }
.login-tarjeta h1 { text-align: center; font-size: 30px; font-weight: 700; margin: 26px 0 4px; }
.login-tarjeta h1 span { color: var(--ink); }
.login-tarjeta.ancha h1 { font-size: 22px; }
.login-tarjeta .sub { text-align: center; font-size: 16px; margin-bottom: 24px; color: #475569; }
.login-tarjeta .flash { margin: 0 0 14px; }
.login-tarjeta .alert { margin-bottom: 14px; font-size: 13px; }
.login-tarjeta h2 { margin: 18px 0 10px; font-size: 14px; }
.login-modo { margin: 0 0 14px; font-size: 13.5px; color: var(--slate); text-align: center; }
.login-form { margin: 0; }
.login-campo { position: relative; display: block; margin: 0 0 14px; text-transform: none; letter-spacing: 0; }
.login-campo svg { position: absolute; left: 16px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%);
  color: var(--ink); pointer-events: none; }
.login-campo input { margin-top: 0; padding: 14px 16px 14px 52px; border-radius: 12px; font-size: 15.5px; }
.login-campo:focus-within svg { color: var(--teal-ink); }
.oculto { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.login-btn { display: flex; width: 100%; justify-content: center; align-items: center; gap: 10px; padding: 14px 18px;
  font-size: 17px; font-weight: 700; border-radius: 12px; margin-top: 6px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: 0 8px 20px rgba(245, 180, 20, .32); }
.login-btn svg { width: 22px; height: 22px; }
.login-pie { margin: 26px 0 0; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; font-size: 12px;
  color: var(--slate); }
.login-pie b { color: var(--ink); }

@media (max-width: 900px) {
  .login { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 22px 16px 30px; }
  .login-lado { order: 1; }
  .login-hero { order: 2; gap: 22px; padding: 0 4px; }
  .login-hero .login-brand { display: none; }   /* la tarjeta ya lleva la marca */
  .login-hola { font-size: 26px; }
  .login-nombre { font-size: 34px; }
  .login-bienvenida .login-lema { font-size: 16px; }
  .login-bienvenida .tricolor { margin-top: 18px; }
  .login-tarjeta { padding: 28px 20px 18px; border-radius: 20px; }
  .login-brand .mark { width: 46px; height: 46px; font-size: 26px; }
  .login-brand b { font-size: 21px; }
  .login-brand small { font-size: 12px; }
  .login-tarjeta h1 { font-size: 25px; }
  main.login-main::before { width: 150px; height: 130px; }
  main.login-main::after { width: 340px; height: 130px; }
}

/* Logo institucional de C.I. Colombian Mint, grande sobre «Bienvenido a» */
.login-bienvenida .login-logo { display: block; width: 200px; height: auto; margin: 0 0 22px;
  filter: drop-shadow(0 8px 18px rgba(15, 30, 51, .18)); }
@media (max-width: 900px) { .login-bienvenida .login-logo { width: 140px; margin-bottom: 14px; } }
@media (min-width: 901px) and (max-height: 820px) {
  .login-bienvenida .login-logo { width: 150px; margin-bottom: 12px; }
  .login-bienvenida .login-nombre { font-size: 54px; }
  .login-bienvenida .login-lema { font-size: 18px; margin-top: 10px; }
  .login-bienvenida .tricolor { margin-top: 18px; }
}

/* ---------------------------------------------------------------- impresión
   Solo el contenido: sin menú lateral, barra superior, filtros, botones ni mensajes; tablas completas y sin fondos. */
@media print {
  @page { margin: 14mm 12mm; }
  body, body:not(.login-body) { display: block; background: #fff; color: #000; font-size: 12px; }
  .sidebar, .topbar, .franja-simulada, .flash, .toolbar, .filtros, .actions, .btn, button, .dropzone, .procesando,
  .interpretado, input[type=file], details, .graficos, canvas { display: none !important; }
  main { padding: 0; }
  .contenido { padding: 0; max-width: none; overflow: visible; }
  .tabla { overflow: visible; }
  table { box-shadow: none; border-color: #999; page-break-inside: auto; }
  tr { page-break-inside: avoid; }
  thead { display: table-header-group; }
  th { background: #fff; color: #000; border-bottom-color: #999; }
  td { color: #000; border-bottom-color: #ccc; }
  tbody tr:hover { background: transparent; }
  .card, .panel, .chip, .alert { box-shadow: none; background: #fff; border-color: #999; color: #000; }
  .kpis, .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .badge { background: #fff; color: #000; border-color: #999; }
  a { color: #000; text-decoration: none; }
  h1, h2, h3 { color: #000; page-break-after: avoid; }
}

/* atributo hidden: siempre oculta, aunque la regla del elemento fije display (label, div…) */
[hidden] { display: none !important; }
/* tablas con campos editables en la fila (Configuración: bancos, clientes) */
table.editable td input { margin-top: 0; padding: 6px 10px; font-size: 13.5px; min-width: 110px; }
td.acciones-fila { white-space: nowrap; text-align: right; }
td.acciones-fila form { display: inline-block; margin: 0 0 0 6px; }

/* ---------------------------------------------------------------- ayuda (E15)
   «?» del título de cada pantalla (enlace a /ayuda#<sección>) y la guía de usuario convertida desde el .md. */
.ayuda-q { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 10px; vertical-align: 3px;
  border-radius: 50%; border: 1px solid var(--gold); background: var(--gold-soft); color: #7A5600; font-size: 13px;
  font-weight: 700; line-height: 1; text-decoration: none; }
.ayuda-q:hover, .ayuda-q:focus-visible { background: var(--gold); color: var(--ink); }
.guia { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 40px; }
.guia-indice { position: sticky; top: 76px; background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 14px 16px; font-size: 13px; box-shadow: var(--shadow); }
.guia-indice b { display: block; margin-bottom: 8px; color: var(--ink); }
.guia-indice ol { margin: 0; padding-left: 18px; }
.guia-indice li { margin: 4px 0; }
.guia-indice a { color: var(--teal-ink); text-decoration: none; }
.guia-indice a:hover { text-decoration: underline; }
.guia-texto { max-width: 920px; line-height: 1.6; color: var(--ink-2); }
.guia-texto h2 { font-size: 19px; margin: 34px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); scroll-margin-top: 76px; }
.guia-texto h3 { font-size: 15px; margin: 22px 0 8px; scroll-margin-top: 76px; }
.guia-texto h4 { font-size: 14px; margin: 16px 0 6px; color: var(--ink); scroll-margin-top: 76px; }
.guia-texto h2:target, .guia-texto h3:target { background: var(--gold-soft); border-radius: var(--radius-sm); padding-left: 8px; }
.guia-texto ul, .guia-texto ol { padding-left: 22px; }
.guia-texto li { margin: 4px 0; }
.guia-texto .tabla { margin: 10px 0 16px; }
.guia-texto a { color: var(--teal-ink); }
.guia-texto .nota { margin: 12px 0; padding: 10px 14px; border-left: 4px solid var(--gold); background: var(--gold-soft);
  border-radius: var(--radius-sm); color: var(--ink); }
@media (max-width: 900px) {
  .guia { grid-template-columns: minmax(0, 1fr); }
  .guia-indice { position: static; }
}
@media print {
  .ayuda-q, .guia-indice { display: none !important; }
  .guia { display: block; }
}
