/* Pantalla de acceso: copiado de Alpha.Clasifica.Reingenieria (base.css + login de shell.css), mismo login que PostMaria. */
/* ==========================================================================
   base.css — sistema de diseño propio de Alpha Clasifica.

   No depende de ninguna librería externa (ni Bootstrap, ni Kendo, ni íconos de terceros).
   Los nombres de clase de formularios y botones siguen la convención conocida (btn,
   form-control, alert…) para que el marcado se lea fácil, pero toda la implementación está acá.
   Orden: tokens → reset → tipografía → utilidades → componentes.
   ========================================================================== */

:root {
    --c-primary: #2f6fed;
    --c-primary-hover: #1d5bd6;
    --c-primary-dark: #1f3a5f;
    --c-primary-soft: #eaf1ff;
    --c-text: #24303f;
    --c-muted: #6b7891;
    --c-border: #e2e6ee;
    --c-border-strong: #c9d1de;
    --c-surface: #ffffff;
    --c-surface-alt: #f7f9fb;
    --c-bg: #f4f6f9;
    --c-danger: #c0392b;
    --c-danger-soft: #fdecea;
    --c-warning: #b7791f;
    --c-warning-soft: #fff7e6;
    --c-info: #2563eb;
    --c-info-soft: #eaf1ff;
    --c-success: #1f8a4c;
    --c-success-soft: #e3f5ec;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 6px 20px rgba(16, 24, 40, .10);
    --shadow-lg: 0 20px 50px rgba(16, 24, 40, .22);
    --focus-ring: 0 0 0 .2rem rgba(47, 111, 237, .25);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}
img, svg { vertical-align: middle; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--c-primary-hover); }
a:hover { color: var(--c-primary-dark); }
hr { border: 0; border-top: 1px solid var(--c-border); margin: 1rem 0; }
table { border-collapse: collapse; }

/* ---------- Tipografía ---------- */
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem; font-weight: 600; line-height: 1.25; color: #1b2735; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: 1rem; }
h6 { font-size: .9rem; }
p { margin: 0 0 1rem; }
small, .small { font-size: .85em; }
.text-muted { color: var(--c-muted) !important; }
.text-danger { color: var(--c-danger) !important; }
.text-success { color: var(--c-success) !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-nowrap { white-space: nowrap !important; }
.fw-semibold { font-weight: 600 !important; }
.mono { font-family: var(--font-mono); }

/* ---------- Utilidades ---------- */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-flex { display: flex !important; }
.flex-wrap { flex-wrap: wrap !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }
.gap-1 { gap: .25rem !important; } .gap-2 { gap: .5rem !important; } .gap-3 { gap: 1rem !important; }
.w-100 { width: 100% !important; }
.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .25rem !important; } .mb-2 { margin-bottom: .5rem !important; } .mb-3 { margin-bottom: 1rem !important; } .mb-4 { margin-bottom: 1.5rem !important; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .25rem !important; } .mt-2 { margin-top: .5rem !important; } .mt-3 { margin-top: 1rem !important; } .mt-4 { margin-top: 1.5rem !important; }
.ms-auto { margin-left: auto !important; }
.py-2 { padding-top: .5rem !important; padding-bottom: .5rem !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Grilla de formularios ---------- */
/* .grid: columnas que se acomodan solas. .grid--2/3/4 fija la cantidad en escritorio. */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2; }
.col-span-full { grid-column: 1 / -1; }
@media (max-width: 900px) {
    .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
    .col-span-2 { grid-column: auto; }
}

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn svg { width: 1.05em; height: 1.05em; }
.btn:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.btn:disabled, .btn.disabled { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); color: #fff; }
.btn-secondary { background: #eef1f5; border-color: #eef1f5; color: var(--c-text); }
.btn-secondary:hover { background: #e2e7ee; color: var(--c-text); }
.btn-outline-secondary { background: #fff; border-color: var(--c-border-strong); color: var(--c-text); }
.btn-outline-secondary:hover { background: var(--c-surface-alt); border-color: #aab4c4; color: var(--c-text); }
.btn-outline-primary { background: #fff; border-color: var(--c-primary); color: var(--c-primary-hover); }
.btn-outline-primary:hover { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.btn-danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #a93226; color: #fff; }
.btn-link { border: 0; padding-left: .25rem; padding-right: .25rem; color: var(--c-primary-hover); text-decoration: underline; }
.btn-sm { padding: .3rem .65rem; font-size: .85rem; }
.btn-lg { padding: .7rem 1.25rem; font-size: 1.05rem; }
.btn-icon { padding: .4rem; width: 2.2rem; height: 2.2rem; }

/* ---------- Formularios ---------- */
.form-label { display: block; margin-bottom: .3rem; font-size: .85rem; font-weight: 600; color: #3a4a5c; }
.form-control, .form-select {
    display: block;
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    background-color: #fff;
    font-size: .95rem;
    line-height: 1.4;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control::placeholder { color: #9aa5b5; }
.form-control:focus, .form-select:focus { outline: 0; border-color: var(--c-primary); box-shadow: var(--focus-ring); }
.form-control:disabled, .form-select:disabled { background: #f1f3f6; color: var(--c-muted); }
.form-control.is-invalid { border-color: var(--c-danger); }
.form-control-sm { padding: .3rem .55rem; font-size: .85rem; }
.form-control-lg { padding: .65rem .9rem; font-size: 1.05rem; }
textarea.form-control { min-height: 5rem; resize: vertical; }
.form-select {
    appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7891' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .7rem center;
    background-size: 12px 12px;
}
.form-select[multiple] { background-image: none; padding-right: .75rem; }
.form-text { margin-top: .25rem; font-size: .8rem; color: var(--c-muted); }
.form-check { display: flex; align-items: center; gap: .45rem; min-height: 1.5rem; }
.form-check-input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--c-primary); cursor: pointer; }
.form-check-label { cursor: pointer; font-size: .92rem; }
.form-check-inline { display: inline-flex; margin-right: 1rem; }
.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group > .form-control { flex: 1 1 auto; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.input-group-lg > .form-control { padding: .65rem .9rem; font-size: 1.05rem; }
.field-validation-error, .text-danger.small { display: block; margin-top: .25rem; }
.validation-summary-valid { display: none; }

/* Combo con búsqueda (App.comboBuscable, se aplica solo a todo select.form-select): cerrado se ve como un
   select; abierto despliega un panel con un campo para escribir arriba y la lista filtrada debajo.
   El contenedor no tiene caja (display: contents) y el botón lleva las clases del select, así cada pantalla
   conserva el ancho que le daba a su combo. El panel vive en el <body> con posición fija (lo ubica app.js). */
.combo-buscable { display: contents; }
.combo-buscable__boton {
    display: block;
    width: 100%;
    overflow: hidden;
    text-align: left;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}
.combo-buscable__boton:disabled { cursor: default; }
.combo-buscable__boton.is-vacio { color: #7a8597; }
.combo-buscable__boton.is-invalid { border-color: var(--c-danger); }
.combo-buscable__boton.is-abierto { border-color: var(--c-primary); box-shadow: var(--focus-ring); }
.combo-buscable__select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    clip: rect(0 0 0 0);
    opacity: 0;
    pointer-events: none;
}
.combo-buscable__panel {
    position: fixed;
    z-index: 2300;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: .95rem;
}
.combo-buscable__panel[hidden] { display: none; }
.combo-buscable__buscar { position: relative; flex: none; padding: .5rem; border-bottom: 1px solid var(--c-border); }
.combo-buscable__buscar svg { position: absolute; left: 1.1rem; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--c-muted); pointer-events: none; }
.combo-buscable__buscar .form-control { padding-left: 2rem; }
.combo-buscable__lista { max-height: 320px; margin: 0; padding: .25rem 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; }
.combo-buscable__opcion { padding: .45rem .75rem; font-size: .92rem; line-height: 1.35; cursor: pointer; }
.combo-buscable__opcion.is-en-grupo { padding-left: 1.4rem; }
.combo-buscable__opcion.is-activa { background: var(--c-primary-soft); }
.combo-buscable__opcion.is-elegida { font-weight: 600; color: var(--c-primary-dark); }
.combo-buscable__opcion.is-deshabilitada { color: #a8b1bd; cursor: default; }
.combo-buscable__grupo { padding: .5rem .75rem .2rem; font-size: .75rem; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--c-muted); }
.combo-buscable__vacio, .combo-buscable__mas { padding: .5rem .75rem; font-size: .85rem; color: var(--c-muted); }
@media print { .combo-buscable__panel { display: none !important; } }

/* Buscador con ícono adentro */
.search-input { position: relative; }
.search-input > svg { position: absolute; left: .75rem; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--c-muted); pointer-events: none; }
.search-input > .form-control { padding-left: 2.4rem; }

/* ---------- Alertas ---------- */
.alert { position: relative; padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: .93rem; }
.alert-danger { background: var(--c-danger-soft); border-color: #f5c2bd; color: #8a2a20; }
.alert-success { background: var(--c-success-soft); border-color: #b5e2c7; color: #1b6b3d; }
.alert-warning { background: var(--c-warning-soft); border-color: #f3d9a4; color: #7a5310; }
.alert-info { background: var(--c-info-soft); border-color: #c4d6fb; color: #1e3f8a; }

/* ---------- Badges / chips ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .18rem .5rem;
    border-radius: 999px;
    background: #eef1f5;
    color: #3a4a5c;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}
.badge--primary { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.badge--danger { background: var(--c-danger-soft); color: #8a2a20; }
.badge--warning { background: var(--c-warning-soft); color: #7a5310; }
.badge--info { background: var(--c-info-soft); color: #1e3f8a; }
.badge--muted { background: #f1f3f6; color: var(--c-muted); }

/* ---------- Página ---------- */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.page-header__title { margin: 0; font-size: 1.5rem; color: var(--c-primary-dark); }
.page-header__subtitle { margin: .2rem 0 0; color: var(--c-muted); font-size: .95rem; }
.page-header__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Paneles (también definidos en shell.css; acá variantes) ---------- */
.panel + .panel { margin-top: 1rem; }
.panel__header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.panel__header h2, .panel__header h3 { margin: 0; font-size: 1.05rem; color: var(--c-primary-dark); }
.panel__footer { padding: .85rem 1.25rem; border-top: 1px solid var(--c-border); background: var(--c-surface-alt); border-radius: 0 0 12px 12px; }
.panel--filtros { border-top: 3px solid var(--c-primary); }

/* ---------- Tablas ---------- */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--c-border); border-radius: var(--radius); background: #fff; }
.table { width: 100%; font-size: .9rem; }
.table th, .table td { padding: .6rem .8rem; border-bottom: 1px solid var(--c-border); text-align: left; vertical-align: top; }
.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--c-primary-dark);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
}
.table tbody tr:nth-child(even) { background: var(--c-surface-alt); }
.table tbody tr:hover { background: var(--c-primary-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table-sm th, .table-sm td { padding: .35rem .55rem; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.is-clickable { cursor: pointer; }
.table tr.is-selected { background: #d3efdf !important; box-shadow: inset 3px 0 0 var(--c-primary); }

/* Tabla de pares etiqueta/valor (detalles) */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; font-size: .92rem; }
.kv dt { color: var(--c-muted); font-weight: 600; }
.kv dd { margin: 0; }

/* ---------- Pestañas ---------- */
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 2px solid var(--c-border); margin-bottom: 1rem; }
.tabs__tab {
    position: relative;
    padding: .55rem .95rem;
    border: 0;
    background: none;
    color: var(--c-muted);
    font-size: .92rem;
    font-weight: 600;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tabs__tab:hover { color: var(--c-primary-dark); background: var(--c-surface-alt); }
.tabs__tab.is-active { color: var(--c-primary-dark); }
.tabs__tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--c-primary); }
.tabs__tab .badge { margin-left: .35rem; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------- Acordeón (details/summary nativos) ---------- */
.accordion { border: 1px solid var(--c-border); border-radius: var(--radius); background: #fff; overflow: hidden; }
.accordion > details + details { border-top: 1px solid var(--c-border); }
/* La fila del título se alinea por la línea de base del texto: la flecha, el título y los globitos quedan
   sobre la misma línea aunque el título ocupe dos renglones. */
.accordion summary {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    padding: .75rem 1rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: var(--c-primary-dark);
}
.accordion summary::-webkit-details-marker { display: none; }
/* La flecha es un "carácter": un espacio de ancho cero con la flecha dibujada encima (máscara SVG del color
   del texto). Así mide exactamente un renglón y tiene línea de base, y queda centrada en el primer renglón
   del título con cualquier alineación de la fila (baseline, flex-start o center). */
.accordion summary::before {
    content: "\200B";
    flex: none;
    width: .8em;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cpolyline points='9 5 16 12 9 19' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e") center / .8em .8em no-repeat;
    mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cpolyline points='9 5 16 12 9 19' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e") center / .8em .8em no-repeat;
    transition: transform .15s ease;
}
.accordion details[open] > summary::before { transform: rotate(90deg); }
.accordion details[open] > summary { background: var(--c-surface-alt); border-bottom: 1px solid var(--c-border); }
.accordion__body { padding: 1rem; }

/* ---------- Paginador ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; font-size: .88rem; color: var(--c-muted); }
.pager__pages { display: flex; gap: .25rem; flex-wrap: wrap; }
.pager__btn {
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 .55rem;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--c-text);
    font-size: .88rem;
}
.pager__btn:hover:not(:disabled) { border-color: var(--c-primary); color: var(--c-primary-dark); }
.pager__btn.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 600; }
.pager__btn:disabled { opacity: .45; cursor: default; }
.pager__gap { align-self: center; padding: 0 .2rem; }

/* ---------- Estados vacíos / cargando ---------- */
.empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--c-muted);
}
.empty svg { width: 42px; height: 42px; color: #b7c2d0; margin-bottom: .6rem; }
.empty__title { margin: 0 0 .25rem; color: #3a4a5c; font-weight: 600; }
.spinner {
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid rgba(47, 111, 237, .25);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: -.2em;
}
.loading-inline { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 2rem 1rem; color: var(--c-muted); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Modal propio (App.modal en app.js) ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    background: rgba(18, 34, 56, .5);
    overflow-y: auto;
}
.modal.is-open { display: flex; animation: modal-fade .15s ease; }
/* La ventana nunca supera el alto de la pantalla (deja el mismo margen arriba y abajo que el padding de
   .modal): el encabezado queda siempre a la vista y lo que scrollea es el contenido (.modal__body). */
.modal__dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 4rem);
    max-height: calc(100dvh - 4rem);
    margin: auto 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    animation: modal-in .18s ease;
}
.modal__dialog > * { flex: none; }
.modal__dialog > .modal__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.modal__dialog--lg { max-width: 1000px; }
.modal__dialog--xl { max-width: 1280px; }
.modal__header { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--c-border); }
.modal__title { margin: 0; font-size: 1.1rem; color: var(--c-primary-dark); flex: 1; }
.modal__close { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: transparent; color: var(--c-muted); font-size: 1.4rem; line-height: 1; }
.modal__close:hover { background: #eef1f5; color: var(--c-text); }
.modal__body { padding: 1.25rem; }
.modal__footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .85rem 1.25rem; border-top: 1px solid var(--c-border); }
body.modal-abierto { overflow: hidden; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Toast ---------- */
.copy-toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    z-index: 2200;
    padding: .55rem 1rem;
    border-radius: 999px;
    background: rgba(20, 40, 30, .92);
    color: #fff;
    font-size: .88rem;
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.copy-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Contenido HTML de la base (textos de normas, notas, noticias) ---------- */
.rich-text { font-size: .95rem; line-height: 1.6; overflow-wrap: anywhere; }
/* Los textos cargados en la base (muchos pegados desde Word) traen su propia fuente en línea o con <font face>:
   se muestran siempre con la fuente de la página. Lo que se pega de ahora en más ya se limpia en el editor.
   La excepción es la fuente elegida a propósito en el editor (editor-html.js), que va marcada con data-fuente. */
.rich-text, .rich-text *:not(code):not(pre):not(kbd):not(samp):not([data-fuente]) { font-family: inherit !important; }
.rich-text table { border-collapse: collapse; max-width: 100%; }
.rich-text td, .rich-text th { border: 1px solid var(--c-border); padding: .3rem .5rem; }
.rich-text img { height: auto; }
mark, .hl { background: #fff3a3; color: inherit; padding: 0 .1em; border-radius: 2px; }

/* ---------- Tarjetas de herramientas (Inicio) ---------- */
.tool-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tool-card {
    --tc: var(--c-primary);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: 1.15rem 1.2rem;
    border: 1px solid var(--c-border);
    border-radius: 14px;
    background: #fff;
    color: var(--c-text);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--tc); color: var(--c-text); }
.tool-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--tc) 14%, white);
    color: var(--tc);
}
.tool-card__icon svg { width: 22px; height: 22px; }
.tool-card__title { margin: 0; font-size: 1.02rem; font-weight: 600; color: #1b2735; }
.tool-card__text { margin: 0; font-size: .88rem; color: var(--c-muted); }
.tool-card--soon { opacity: .7; }
.tool-card--soon .badge { position: absolute; top: .9rem; right: .9rem; }

/* ---------- Menú lateral: opciones pendientes ---------- */
.app-nav-link__pronto {
    margin-left: auto;
    padding: .05rem .4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: rgba(198, 227, 209, .75);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
}
body.sidebar-colapsado .app-nav-link__pronto { display: none; }

/* Cantidad de alertas sin leer. Achicado el menú, queda como un punto sobre el ícono. */
.app-nav-link { position: relative; }
.app-nav-link__contador {
    margin-left: auto;
    min-width: 1.35rem;
    padding: .05rem .4rem;
    border-radius: 999px;
    background: #e5484d;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}
body.sidebar-colapsado .app-nav-link__contador {
    position: absolute;
    top: 6px;
    right: 12px;
    min-width: 0;
    width: 10px;
    height: 10px;
    padding: 0;
    font-size: 0;
    border: 2px solid var(--sb-bg, #0b2a1b);
}

/* ---------- Editor de texto enriquecido (wwwroot/js/editor-html.js, CKEditor 4) ---------- */
.cke_chrome { max-width: 100%; }

/* ---------- Impresión ---------- */
@media print {
    .app-sidebar, .app-topbar, .app-footer, .wa-fab, .scroll-top, .no-print { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .app-content { padding: 0 !important; }
    .panel { box-shadow: none !important; border-color: #ccc !important; }
    /* Al imprimir una ventana sale entera, no sólo lo que entraba en pantalla. */
    .modal__dialog { display: block; max-height: none !important; }
    .modal__dialog > .modal__body { overflow: visible; }
}
:root {
    --app-sidebar-width: 250px;
    --app-verde: #1f3a5f;
    --app-verde-oscuro: #162b47;
    --app-accent: #2f6fed;
    --app-bg: #f4f6f9;
    --app-border: #e2e6ee;
}
/* ============================ Auth (login / recover) ============================ */
/* Altura fija y sin desborde: la pantalla de login entra entera en la ventana y no scrollea.
   Lo que puede crecer —la lista de novedades— scrollea adentro de su propio panel. */
.auth {
    height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--app-bg);
}

/* ---- Brand panel ---- */
/* The container-ship photo sits behind the brand copy. A verde scrim on top keeps the
   panel on-palette and stops the busy parts of the photo from fighting the text. */
.auth__brand {
    position: relative;
    display: flex;
    align-items: center;
    padding: 3.5rem;
    color: #fff;
    background-color: var(--app-verde-oscuro);
    background-image:
        linear-gradient(120deg, rgba(18, 34, 56, .82) 0%, rgba(22, 43, 71, .62) 55%, rgba(31, 58, 95, .45) 100%),
        url("../img/login-ship.jpg");
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    overflow: hidden;
    isolation: isolate;
}

/* A solid white card over the ship photo. Opaque by design: this is what guarantees the
   copy is readable regardless of what part of the photo falls behind it (the sky and
   water are bright enough that a translucent panel left the bullets under 4.5:1). */
/* 30% larger than the 460px/2.25rem it was, so the panel carries the extra copy. */
.auth__brand-content {
    position: relative;
    z-index: 1;
    max-width: 598px;
    padding: 2.9rem;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .6);
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .55);
    /* The panel is white, so the copy has to invert with it — .auth__brand sets
       color:#fff for the panel-on-verde design this replaces. */
    color: #24303f;
    animation: auth-rise .7s cubic-bezier(.2, .7, .2, 1) both;
}

.auth__brand-title {
    font-size: 2.15rem;
    font-weight: 700;
    letter-spacing: -.5px;
    margin: 1.25rem 0 .5rem;
    line-height: 1.15;
    color: var(--app-verde);
}

/* Slightly darker than the usual #6b7891 muted grey, which lands at 4.45:1 on white —
   just under the bar for text this size. */
.auth__brand-tagline {
    color: #5f6c85;
    font-size: 1.05rem;
    line-height: 1.55;
    margin-bottom: 2rem;
}

.auth__brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: .85rem;
}

.auth__brand-features li {
    position: relative;
    padding-left: 2rem;
    color: #3a4a63;
    line-height: 1.4;
}

.auth__brand-features li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    font-size: .8rem;
    color: var(--app-accent);
    background: rgba(47, 111, 237, .12);
    border: 1px solid rgba(47, 111, 237, .35);
    border-radius: 50%;
    font-weight: 700;
}

/* ---- Form panel ---- */
/* The blue the brand panel used to carry now lives here, so the login card reads as a
   white sheet on verde. Same family as the sidebar/footer rather than the old
   translucent value, which only made sense composited over the photo. */
.auth__form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    /* min-height: 0 deja que el contenido se encoja dentro del alto fijo en vez de
       empujar hacia afuera; overflow auto es la red para ventanas muy bajas, donde es
       preferible scrollear este panel antes que cortar el formulario. */
    min-height: 0;
    overflow: auto;
    background:
        radial-gradient(1000px 500px at 100% 0%, rgba(47, 111, 237, .28), transparent 65%),
        linear-gradient(160deg, #24457a 0%, var(--app-verde) 45%, var(--app-verde-oscuro) 100%);
}

.auth__form-inner {
    width: 100%;
    max-width: 410px;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 20px;
    padding: 2.75rem;
    box-shadow:
        0 1px 2px rgba(16, 24, 40, .04),
        0 24px 60px -20px rgba(16, 24, 40, .18);
    animation: auth-rise .6s cubic-bezier(.2, .7, .2, 1) both;
}

/* The Alpha 2000 wordmark: a wide (~3.6:1) image, not the square badge it replaced. */
.auth__logo {
    display: block;
    height: 44px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* Único logo de marca, centrado en el panel (antes iba junto al de BANK, con divisor). */
.auth__logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    flex-wrap: wrap;
}


.auth__logo--mobile {
    display: none;
    height: 38px;
    margin: 0 auto 1.25rem;
}

.auth__heading {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -.4px;
    color: var(--app-verde);
    margin-bottom: .35rem;
}

.auth__subheading {
    color: #6b7891;
    margin-bottom: 1.75rem;
}

/* Refined form controls within the auth card */
.auth__form-inner .form-label {
    font-weight: 600;
    font-size: .85rem;
    color: #3a4a63;
    margin-bottom: .4rem;
}

.auth__form-inner .form-control,
.auth__form-inner .input-group {
    border-radius: 12px;
}

.auth__form-inner .form-control {
    border-color: #dce1ec;
    padding-top: .7rem;
    padding-bottom: .7rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth__form-inner .form-control:hover {
    border-color: #c2cbdb;
}

.auth__form-inner .input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.auth__form-inner .input-group:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(47, 111, 237, .18);
    border-radius: 12px;
}

.auth__form-inner .input-group:focus-within .form-control,
.auth__form-inner .input-group:focus-within .auth__toggle {
    border-color: var(--app-accent);
    box-shadow: none;
}

.auth__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7891;
    background: #fff;
    border-color: #dce1ec;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    transition: color .15s ease, background .15s ease;
}

.auth__toggle:hover {
    color: var(--app-accent);
    background: #f2faf5;
    border-color: #dce1ec;
}

.auth__form-inner .form-check-input {
    border-color: #c2cbdb;
    cursor: pointer;
}

.auth__form-inner .form-check-label {
    color: #4a5772;
    cursor: pointer;
    user-select: none;
}

.auth__link {
    color: var(--app-accent);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    transition: color .15s ease;
}

.auth__link:hover {
    color: #1d5bd6;
    text-decoration: underline;
}

/* Primary submit button */
.auth__form-inner .btn-primary {
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    background: linear-gradient(135deg, var(--app-accent) 0%, #1d5bd6 100%);
    border: none;
    border-radius: 12px;
    padding-top: .75rem;
    padding-bottom: .75rem;
    font-weight: 600;
    letter-spacing: .2px;
    box-shadow: 0 8px 20px -6px rgba(47, 111, 237, .55);
    transition: transform .12s ease, box-shadow .18s ease, filter .15s ease;
}

.auth__form-inner .btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px -6px rgba(47, 111, 237, .6);
}

.auth__form-inner .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px -6px rgba(47, 111, 237, .5);
}

.auth__form-inner .alert-danger {
    border-radius: 12px;
    border-color: #f3c6c6;
    background: #fdecec;
    color: #9b2c2c;
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes auth-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(20px, 30px) scale(1.08); }
}

/* Stack to a single column on tablets/phones; hide the brand panel. */
@media (max-width: 767.98px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth__brand {
        display: none;
    }

    .auth__logo--mobile {
        display: block;
    }

    .auth__form-inner {
        padding: 2.25rem 1.75rem;
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth__brand-content,
    .auth__form-inner {
        animation: none;
    }
}

/* ============================ Responsive ============================ */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .app-topbar__toggle {
        display: flex;
    }

    .app-sidebar__backdrop.is-open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .4);
        z-index: 1025;
    }
}

