/*
 * tema.css — Tokens visuales del portal.
 * Los valores por defecto coinciden con la paleta histórica. tema.js los
 * reemplaza en tiempo de ejecución con la apariencia guardada desde
 * Configuración > Apariencia (GET /api/apariencia).
 */
:root {
    --brand: #0C2068;
    --brand-hover: #0a1a55;
    --brand-rgb: 12, 32, 104;
    --brand-soft: #e8eef8;
    --login-1: #1d2b46;
    --login-2: #2c3e50;
}

/* Evita el destello de la marca por defecto mientras se aplica el tema guardado. */
html.tema-pendiente body { visibility: hidden; }

/* Mientras acciones.js arma el menú, oculta los botones viejos de las grillas.
   Si por algún motivo el script no corre, el animation los vuelve visibles a los 2s. */
td.row-actions:not([data-menu-acciones="1"]):not([data-menu-listo="1"]) button,
div.row-actions:not([data-menu-acciones="1"]):not([data-menu-listo="1"]) button,
td.actions:not([data-menu-acciones="1"]):not([data-menu-listo="1"]) button,
.mp-actions:not([data-menu-acciones="1"]):not([data-menu-listo="1"]) button {
    visibility: hidden;
    animation: acciones-mostrar 0s linear 2s forwards;
}
@keyframes acciones-mostrar { to { visibility: visible; } }

/* ---- Menú de acciones de las grillas (tres puntos) ---- */
.menu-acciones {
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
}
.menu-acciones-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #eef1f5;
    color: #3d4a55;
    cursor: pointer;
    transition: background .15s, color .15s, transform .15s;
}
.menu-acciones-btn:hover {
    background: var(--brand);
    color: #fff;
}
.menu-acciones-btn:active {
    transform: scale(.94);
}
.menu-acciones-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}
.menu-acciones-list {
    position: fixed;
    z-index: 2000;
    display: none;
    min-width: 200px;
    max-width: 300px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 5px;
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
}
.menu-acciones.open .menu-acciones-list {
    display: block;
}
.menu-acciones-list .menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 9px 10px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #3d4a55;
    font: inherit;
    font-size: 13px;
    line-height: 1.25;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}
.menu-acciones-list .menu-item svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}
.menu-acciones-list .menu-item:hover,
.menu-acciones-list .menu-item:focus-visible {
    background: var(--brand);
    color: #fff;
    outline: none;
}
.menu-acciones-list .menu-item.menu-item-danger:hover,
.menu-acciones-list .menu-item.menu-item-danger:focus-visible {
    background: #c0392b;
    color: #fff;
}
.menu-acciones-list .menu-item:disabled {
    opacity: .5;
    cursor: default;
    background: transparent;
    color: #9aa0a7;
}
.menu-acciones-list .menu-item-text {
    display: inline-block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
