:root {
    --color-primario: #0f2846;
    --color-primario-oscuro: #091a2f;
    --color-secundario: #1d5b8d;
    --color-acento: #15998e;
    --color-acento-suave: rgba(21, 153, 142, 0.12);
    --color-fondo: #eff4f8;
    --color-fondo-suave: #f8fbfd;
    --color-superficie: rgba(255, 255, 255, 0.9);
    --color-borde: rgba(15, 40, 70, 0.1);
    --color-borde-fuerte: rgba(15, 40, 70, 0.18);
    --color-texto: #10233e;
    --color-texto-suave: #637286;
    --color-texto-tenue: #8b97a7;
    --color-peligro: #d4575a;
    --sombra-suave: 0 16px 40px rgba(10, 24, 44, 0.08);
    --sombra-media: 0 22px 56px rgba(10, 24, 44, 0.12);
    --sombra-fuerte: 0 28px 80px rgba(10, 24, 44, 0.16);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body.appPage {
    min-height: 100vh;
    margin: 0;
    color: var(--color-texto);
    font-family: "Manrope", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(21, 153, 142, 0.14), transparent 24%),
        radial-gradient(circle at top right, rgba(29, 91, 141, 0.15), transparent 22%),
        linear-gradient(180deg, #f7fbfd 0%, var(--color-fondo) 52%, #e8eef4 100%);
    position: relative;
}

body.appPage::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(15, 40, 70, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 40, 70, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 80%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 80%);
}

body.pageLogin {
    background:
        radial-gradient(circle at top left, rgba(21, 153, 142, 0.2), transparent 26%),
        radial-gradient(circle at bottom right, rgba(52, 114, 175, 0.22), transparent 24%),
        linear-gradient(135deg, #081325 0%, var(--color-primario) 56%, #15395d 100%);
    color: #ffffff;
}

body.pageLogin::before {
    display: none;
}

body.pageInicio::before,
body.pageSettings::before {
    display: none;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: inherit;
}

.appShell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 56px;
    position: relative;
    z-index: 1;
}

.appShellCompact {
    width: min(920px, calc(100% - 32px));
}

.appShellNarrow {
    width: min(760px, calc(100% - 32px));
}

.appHeroCard,
.appCard {
    background: var(--color-superficie);
    border: 1px solid var(--color-borde);
    border-radius: 28px;
    box-shadow: var(--sombra-media);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.appHeroCard {
    padding: clamp(24px, 4vw, 38px);
}

.appSectionCard {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--color-borde);
    border-radius: 28px;
    box-shadow: var(--sombra-suave);
    padding: clamp(22px, 3vw, 30px);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.appLogo {
    width: min(240px, 100%);
    height: auto;
}

.appEyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(15, 40, 70, 0.08);
    color: var(--color-primario);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.appHeroTitle {
    margin: 18px 0 10px;
    font-size: clamp(2rem, 5vw, 3.3rem);
    line-height: 0.96;
    letter-spacing: -0.05em;
    font-weight: 800;
}

.appHeroText {
    margin: 0;
    max-width: 720px;
    color: var(--color-texto-suave);
    font-size: 1.02rem;
    line-height: 1.7;
}

.appSectionHeader {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.appSectionKicker {
    display: block;
    margin-bottom: 8px;
    color: var(--color-texto-suave);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.appSectionTitle {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    font-weight: 800;
}

.appSectionText {
    margin: 8px 0 0;
    color: var(--color-texto-suave);
    line-height: 1.6;
}

.appFloatingNav {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.appFloatingButton {
    width: 60px;
    height: 60px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    background: rgba(15, 40, 70, 0.94);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 44px rgba(10, 24, 44, 0.24);
}

.appFloatingButton:hover {
    transform: translateY(-2px);
    background: #173656;
    color: #ffffff;
}

.appFloatingButton:focus-visible,
.tarjetaPlantillaInicio:focus-visible,
.tarjetaAccionPanel:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(21, 153, 142, 0.18), var(--sombra-media);
}

.appFloatingButton i {
    font-size: 1.35rem;
}

.btn {
    border-radius: 16px;
    font-weight: 700;
    padding: 0.8rem 1.2rem;
}

.btn.btn-sm {
    border-radius: 14px;
    padding: 0.58rem 0.92rem;
    font-size: 0.84rem;
}

.btn:focus {
    box-shadow: none;
}

.btn-asecon-primary,
.btn-asecon-primary:hover,
.btn-asecon-primary:focus {
    color: #ffffff;
}

.btn-asecon-primary {
    background: linear-gradient(135deg, #103255 0%, #0f2846 58%, #13385d 100%);
    border: none;
    box-shadow: 0 18px 36px rgba(15, 40, 70, 0.2);
}

.btn-asecon-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 40px rgba(15, 40, 70, 0.24);
}

.btn-asecon-soft {
    background: rgba(15, 40, 70, 0.08);
    border: 1px solid rgba(15, 40, 70, 0.12);
    color: var(--color-primario);
}

.btn-asecon-soft:hover {
    background: rgba(15, 40, 70, 0.12);
    color: var(--color-primario);
}

.btn-asecon-outline {
    background: transparent;
    border: 1px solid rgba(15, 40, 70, 0.18);
    color: var(--color-primario);
}

.btn-asecon-outline:hover {
    background: rgba(15, 40, 70, 0.06);
    color: var(--color-primario);
}

.btn-asecon-danger {
    background: linear-gradient(135deg, #e06567 0%, #cb4f53 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 18px 36px rgba(203, 79, 83, 0.24);
}

.btn-asecon-danger:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.form-control,
.form-select {
    min-height: 52px;
    border-radius: 16px;
    border: 1px solid rgba(15, 40, 70, 0.12);
    background: #f8fafc;
    color: var(--color-texto);
    padding: 0.82rem 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(21, 153, 142, 0.38);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(21, 153, 142, 0.12);
}

textarea.form-control {
    min-height: 132px;
}

.form-label {
    margin-bottom: 0.45rem;
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--color-texto);
}

.campoPasswordConToggle {
    position: relative;
}

.inputPasswordConBoton {
    padding-right: 3.8rem;
}

.botonVisibilidadPassword {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: rgba(15, 40, 70, 0.06);
    color: var(--color-texto-suave);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.botonVisibilidadPassword:hover {
    background: rgba(15, 40, 70, 0.1);
    color: var(--color-texto);
}

.botonVisibilidadPassword:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(21, 153, 142, 0.12);
}

.botonVisibilidadPassword svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

input[type="file"].form-control {
    padding: 0.38rem;
    overflow: hidden;
}

input[type="file"].form-control::file-selector-button,
input[type="file"].form-control::-webkit-file-upload-button {
    margin-right: 0.9rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #103255 0%, #0f2846 100%);
    color: #ffffff;
    padding: 0.78rem 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 40, 70, 0.18);
}

input[type="file"].form-control:hover::file-selector-button,
input[type="file"].form-control:hover::-webkit-file-upload-button {
    background: linear-gradient(135deg, #13385d 0%, #153454 100%);
}

.alert {
    border-radius: 18px;
    border: 1px solid transparent;
    padding: 0.95rem 1.05rem;
}

.alert-info {
    border-color: rgba(46, 124, 182, 0.16);
    background: rgba(46, 124, 182, 0.09);
    color: #1d4f75;
}

.alert-secondary {
    border-color: rgba(15, 40, 70, 0.08);
    background: rgba(15, 40, 70, 0.05);
    color: var(--color-texto-suave);
}

.alert-success {
    border-color: rgba(21, 153, 142, 0.18);
    background: rgba(21, 153, 142, 0.1);
    color: #0f7168;
}

.alert-danger {
    border-color: rgba(212, 87, 90, 0.18);
    background: rgba(212, 87, 90, 0.08);
    color: #ab3437;
}

.badge {
    border-radius: 999px;
    padding: 0.55em 0.9em;
    font-weight: 800;
}

.table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(15, 40, 70, 0.03);
    --bs-table-hover-bg: rgba(15, 40, 70, 0.035);
}

.table thead th {
    border-bottom-width: 1px;
    border-color: rgba(15, 40, 70, 0.08);
    color: var(--color-texto-suave);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.95rem 0.85rem;
}

.table td {
    vertical-align: middle;
    border-color: rgba(15, 40, 70, 0.08);
    padding: 1rem 0.85rem;
    color: var(--color-texto);
}

.modal-content {
    border-radius: 26px;
    border: 1px solid rgba(15, 40, 70, 0.1);
    box-shadow: var(--sombra-fuerte);
}

.modal-header,
.modal-footer {
    border-color: rgba(15, 40, 70, 0.08);
    padding: 1.1rem 1.4rem;
}

.modal-body {
    padding: 1.35rem 1.4rem;
}

.modal-title {
    font-weight: 800;
    color: var(--color-texto);
}

.btn-close,
.close {
    border: 0;
    background: transparent;
    color: var(--color-texto-suave);
    font-size: 1.7rem;
    line-height: 1;
    opacity: 1;
    box-shadow: none;
}

.tarjetaPlantillaInicio {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 22px 24px;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 248, 251, 0.96) 100%);
    border: 1px solid rgba(15, 40, 70, 0.08);
    box-shadow: var(--sombra-suave);
    overflow: hidden;
}

.tarjetaPlantillaInicio::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(21, 153, 142, 0.12), transparent 32%),
        linear-gradient(135deg, rgba(15, 40, 70, 0.04) 0%, transparent 52%);
    opacity: 0;
}

.tarjetaPlantillaInicio:hover {
    transform: translateY(-3px);
    border-color: rgba(21, 153, 142, 0.24);
    box-shadow: var(--sombra-media);
}

.tarjetaPlantillaInicio:hover::before {
    opacity: 1;
}

.tarjetaPlantillaInicioSimple {
    min-height: 94px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.tarjetaPlantillaInicioSimple .tituloPlantillaInicio {
    font-size: 1.12rem;
}

.chipPlantillaInicio {
    width: fit-content;
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    background: rgba(15, 40, 70, 0.07);
    color: var(--color-primario);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tituloPlantillaInicio {
    position: relative;
    z-index: 1;
    font-size: 1.22rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: var(--color-texto);
}

.metaPlantillaInicio {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--color-texto-suave);
    font-size: 0.9rem;
}

.metaPildoraPlantilla {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.38rem 0.68rem;
    border-radius: 999px;
    background: rgba(15, 40, 70, 0.05);
}

.flechaPlantillaInicio {
    position: absolute;
    right: 22px;
    top: 22px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 14px;
    background: rgba(15, 40, 70, 0.08);
    color: var(--color-primario);
}

.listaAccionesPanel {
    display: grid;
    gap: 14px;
}

.tarjetaAccionPanel {
    appearance: none;
    font: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 18px 20px;
    background: rgba(248, 251, 253, 0.9);
    border: 1px solid rgba(15, 40, 70, 0.08);
    border-radius: 22px;
    color: var(--color-texto);
    text-align: left;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.tarjetaAccionPanel:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(21, 153, 142, 0.18);
}

.tarjetaAccionPanelIcono {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    background: rgba(15, 40, 70, 0.08);
    color: var(--color-primario);
    font-size: 1.15rem;
}

.tarjetaAccionPanelTexto {
    flex: 1;
    min-width: 0;
}

.tarjetaAccionPanelTitulo {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.tarjetaAccionPanelDescripcion {
    display: block;
    margin-top: 4px;
    color: var(--color-texto-suave);
    font-size: 0.9rem;
}

.tarjetaAccionPanelFlecha {
    color: var(--color-texto-tenue);
}

.resumenUsuarioCard {
    display: grid;
    gap: 18px;
}

.resumenUsuarioCabecera {
    display: flex;
    align-items: center;
    gap: 18px;
}

.avatarUsuario {
    width: 86px;
    height: 86px;
    border-radius: 26px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(15, 40, 70, 0.94), rgba(29, 91, 141, 0.78));
    color: #ffffff;
    box-shadow: 0 18px 38px rgba(15, 40, 70, 0.22);
    font-size: 2rem;
}

.nombreUsuarioCard {
    margin: 0;
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    line-height: 1;
    letter-spacing: -0.04em;
    font-weight: 800;
}

.rolUsuarioCard {
    margin: 8px 0 0;
    color: var(--color-texto-suave);
    font-size: 1rem;
    font-weight: 600;
}

.panelGrid {
    display: grid;
    gap: 24px;
}

.panelTarjetaFormulario {
    max-width: 460px;
}

.panelAccionesTabla {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.appLoginLayout {
    min-height: 100vh;
    display: grid;
    align-items: center;
}

.appLoginGrid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 28px;
    align-items: stretch;
}

.appLoginIntro {
    padding: clamp(28px, 4vw, 42px);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.appLoginIntro .appEyebrow {
    background: rgba(255, 255, 255, 0.12);
    color: #dff2ff;
}

.appLoginIntro .appHeroText {
    color: rgba(255, 255, 255, 0.76);
}

.appLoginCard {
    background: rgba(255, 255, 255, 0.96);
    color: var(--color-texto);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: var(--sombra-fuerte);
    padding: clamp(26px, 4vw, 40px);
}

.appLoginSimple {
    max-width: 520px;
    margin: 0 auto;
}

.appLoginTitulo {
    margin: 22px 0 10px;
    font-size: 1.8rem;
    line-height: 1;
    letter-spacing: -0.04em;
    font-weight: 800;
}

.appLoginTexto {
    color: var(--color-texto-suave);
    line-height: 1.6;
}

.appEstadoVacio {
    padding: 18px 20px;
    border-radius: 18px;
    background: rgba(15, 40, 70, 0.04);
    border: 1px dashed rgba(15, 40, 70, 0.14);
    color: var(--color-texto-suave);
    text-align: center;
}

@media (max-width: 991px) {
    .appLoginGrid {
        grid-template-columns: 1fr;
    }

    .panelGrid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 992px) {
    .panelGrid {
        grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
        align-items: start;
    }
}

@media (max-width: 768px) {
    .appShell {
        width: min(100%, calc(100% - 24px));
        padding: 18px 0 38px;
    }

    .appSectionHeader {
        flex-direction: column;
    }

    .resumenUsuarioCabecera {
        align-items: flex-start;
        flex-direction: column;
    }

    .appFloatingNav {
        left: 12px;
        bottom: 12px;
    }

    .appFloatingButton {
        width: 54px;
        height: 54px;
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}
