html {
    width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    font-size: 15px;
}

/* Layout final: contenido + footer ocupan la altura completa de la pantalla. */
html,
body {
    min-height: 100% !important;
}

body {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
}

body > .app-main {
    display: flex !important;
    flex: 1 0 auto !important;
    flex-direction: column !important;
}

body > .app-main > .content-wrap {
    display: flex !important;
    flex: 1 0 auto !important;
    flex-direction: column !important;
    max-width: none !important;
}

body > .app-main > .content-wrap > main {
    display: flex !important;
    flex: 1 0 auto !important;
    flex-direction: column !important;
}

body > .app-main .login-shell {
    flex: 1 0 auto !important;
    min-height: 0 !important;
}

body > .app-footer {
    flex: 0 0 auto !important;
    margin-top: 0 !important;
}

@media (min-width: 769px) {
    body > .app-main .login-shell {
        min-height: calc(100dvh - 92px - 104px) !important;
    }
}

@media (max-width: 768px) {
    body > .app-main .login-shell {
        min-height: auto !important;
    }
}

:root {
    --ppso-turquoise: #00a6b2;
    --ppso-turquoise-dark: #007985;
    --ppso-turquoise-soft: #e5fbfd;
    --ppso-navy: #07323a;
    --ppso-ink: #102a2f;
    --ppso-border: #cfe8eb;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: #f3f9fa;
    color: var(--ppso-ink);
}

/* =========================================================
   ESTRUCTURA PRINCIPAL
   ========================================================= */

.app-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow: hidden;
}

.app-main {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.content-wrap {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    max-width: 1480px;
    min-width: 0;
    min-height: 0;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* =========================================================
   NAVBAR
   ========================================================= */

.app-topbar {
    position: relative;
    z-index: 1030;
    width: 100%;
    min-width: 0;
}

    .app-topbar .navbar {
        width: 100%;
        border-top: 5px solid var(--ppso-turquoise);
    }

.navbar-brand,
.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: var(--ppso-navy);
    font-weight: 700;
}

.brand-logo-img {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    object-fit: contain;
}

.navbar .nav-link {
    padding-right: .75rem;
    padding-left: .75rem;
    border-radius: 6px;
    color: var(--ppso-ink);
}

    .navbar .nav-link:hover,
    .navbar .nav-link:focus {
        background: var(--ppso-turquoise-soft);
        color: var(--ppso-turquoise-dark);
    }

.user-label {
    display: flex;
    align-items: center;
    padding: .5rem .75rem;
    color: #527278;
    white-space: nowrap;
}

/* =========================================================
   ENCABEZADOS
   ========================================================= */

.page-heading {
    margin: 1.5rem 0;
}

    .page-heading h1 {
        margin: 0;
        font-size: 1.75rem;
        font-weight: 700;
    }

    .page-heading p {
        margin: .35rem 0 0;
        color: #62717c;
    }

.with-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.button-row,
.action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* =========================================================
   CARDS Y MÉTRICAS
   ========================================================= */

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

    .metric-grid.compact {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

.metric-card,
.table-surface,
.login-panel,
.delete-panel,
.list-block,
.detail-split > div,
.record-form {
    background: #ffffff;
    border: 1px solid #d9e2e8;
    border-radius: 8px;
}

.metric-card {
    min-height: 92px;
    padding: 1rem;
}

    .metric-card span {
        display: block;
        color: #62717c;
        font-size: .86rem;
        font-weight: 600;
        text-transform: uppercase;
    }

    .metric-card strong {
        display: block;
        margin-top: .5rem;
        color: var(--ppso-turquoise-dark);
        font-size: 2rem;
        line-height: 1.1;
    }

    .metric-card small {
        color: #667786;
    }

/* =========================================================
   TABLAS
   ========================================================= */

.table-surface {
    overflow: hidden;
    padding: .9rem;
}

.surface-title {
    margin: 0 0 .75rem;
    font-size: 1rem;
    font-weight: 700;
}

.data-table {
    margin-bottom: 0;
}

    .data-table thead th {
        background: #edf2f5;
        color: var(--ppso-navy);
        font-size: .82rem;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .data-table td {
        min-width: 120px;
    }

.filter-bar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 220px 220px auto;
    align-items: end;
    gap: .8rem;
    margin-bottom: 1rem;
}

.filter-actions {
    display: flex;
    gap: .5rem;
}

.cell-link {
    display: grid;
    justify-items: center;
    gap: .35rem;
    width: 100%;
    background: transparent;
    border: 0;
    color: inherit;
    text-decoration: none;
}

.cell-button {
    cursor: pointer;
}

/* =========================================================
   ETIQUETAS
   ========================================================= */

.count-tag,
.gender-tag {
    display: inline-block;
    padding: .25rem .55rem;
    border-radius: 7px;
    font-weight: 700;
}

.count-tag {
    min-width: 54px;
    text-align: center;
}

.tag-ok {
    background: var(--ppso-turquoise-soft);
    color: var(--ppso-turquoise-dark);
}

.tag-mid {
    background: #e8f7ff;
    color: #047092;
}

.tag-warn {
    background: #fff0d6;
    color: #a15c00;
}

.gender-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem;
}

.gender-tag {
    font-size: .78rem;
}

    .gender-tag.men {
        background: var(--ppso-turquoise-soft);
        color: var(--ppso-turquoise-dark);
    }

    .gender-tag.women {
        background: #ffe8f2;
        color: #c02768;
    }

/* =========================================================
   LOGIN
   Ocupa toda la altura entre navbar y footer
   ========================================================= */

.login-shell {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 56%) minmax(420px, 44%);
    width: auto;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0 -1.25rem;
    padding: 0;
    background: #f3f9fa;
    overflow: hidden;
}

/* =========================================================
   ÁREA TURQUESA DEL LOGIN
   ========================================================= */

.login-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: clamp(1.5rem, 3vh, 3rem) clamp(2.5rem, 5vw, 5.5rem);
    background: linear-gradient( 135deg, var(--ppso-turquoise-dark) 0%, var(--ppso-turquoise) 100% );
    color: #ffffff;
    text-align: center;
}

.login-hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
}

.login-hero img,
.login-hero-logo {
    display: block;
    width: clamp(125px, 15vh, 165px);
    height: clamp(125px, 15vh, 165px);
    max-width: 165px;
    max-height: 165px;
    margin: 0 auto clamp(.9rem, 1.8vh, 1.5rem);
    border-radius: 24px;
    object-fit: contain;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}

.login-hero h1 {
    width: 100%;
    max-width: 600px;
    margin: 0 0 clamp(.6rem, 1.3vh, .95rem);
    color: #ffffff;
    font-size: clamp(2.2rem, 3vw, 3.1rem);
    font-weight: 800;
    line-height: 1.1;
    overflow-wrap: break-word;
}

.login-hero p {
    width: 100%;
    max-width: 530px;
    margin: 0 auto;
    color: rgba(255, 255, 255, .96);
    font-size: clamp(1rem, 1.15vw, 1.12rem);
    line-height: 1.55;
    overflow-wrap: break-word;
    text-wrap: balance;
}

/* =========================================================
   ÁREA DERECHA DEL LOGIN
   ========================================================= */

.login-form-area {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: clamp(1rem, 2.5vh, 2rem) clamp(2rem, 4vw, 4.5rem);
    background: radial-gradient( circle at center, rgba(0, 166, 178, .09), transparent 62% ), #f3f9fa;
}

.login-panel {
    width: 100%;
    max-width: 510px;
    padding: clamp(1.2rem, 2.2vh, 1.8rem) clamp(1.6rem, 2.8vw, 2.2rem);
    background: #ffffff;
    border: 1px solid #d9e2e8;
    border-radius: 10px;
    box-shadow: 0 22px 60px rgba(7, 50, 58, .18);
}

.login-logo {
    display: block;
    width: clamp(78px, 9vh, 100px);
    height: clamp(78px, 9vh, 100px);
    max-width: 100px;
    max-height: 100px;
    margin: 0 auto clamp(.7rem, 1.4vh, 1rem);
    border-radius: 19px;
    object-fit: contain;
}

.login-panel h2 {
    margin: 0 0 .4rem;
    color: var(--ppso-navy);
    font-size: clamp(1.45rem, 2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.login-panel > p,
.login-description {
    max-width: 420px;
    margin: 0 auto clamp(.8rem, 1.6vh, 1.15rem);
    color: #62717c;
    font-size: clamp(.93rem, 1vw, 1rem);
    line-height: 1.45;
    text-align: center;
}

.login-panel .stacked-form {
    display: grid;
    gap: clamp(.65rem, 1.3vh, .95rem);
}

.login-panel .form-field {
    display: grid;
    gap: .3rem;
}

.login-panel .form-label {
    margin: 0;
    font-size: 1rem;
}

.login-panel .form-control {
    width: 100%;
    min-height: 42px;
    padding: .5rem .75rem;
}

.login-panel .btn {
    width: 100%;
    min-height: 42px;
    font-size: 1rem;
}

.login-panel .stacked-form > .form-label {
    margin-bottom: -.35rem;
}

.login-panel .stacked-form > .text-danger:empty {
    display: none;
}

/* =========================================================
   FORMULARIOS GENERALES
   ========================================================= */

.stacked-form,
.record-form {
    display: grid;
    gap: .9rem;
}

.record-form,
.delete-panel {
    padding: 1.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

    .form-grid.three {
        grid-template-columns: 180px 1fr 1.4fr;
    }

.section-title {
    margin-top: .4rem;
    padding-top: 1rem;
    border-top: 1px solid #d9e2e8;
    color: var(--ppso-turquoise-dark);
    font-weight: 700;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

.user-lock-check {
    padding: .8rem .8rem .8rem 2.25rem;
    background: #f8fafc;
    border: 1px solid #d9e2e8;
    border-radius: 8px;
}

/* =========================================================
   DETALLES
   ========================================================= */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.detail-grid-main {
    grid-template-columns: minmax(320px, 2fr) minmax(260px, 1fr);
}

.alcaldia-block {
    grid-column: auto;
}

.detail-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

    .detail-split > div,
    .list-block {
        padding: 1rem;
    }

        .list-block h2,
        .detail-split h2 {
            margin: 0 0 .75rem;
            font-size: 1rem;
            font-weight: 700;
        }

        .list-block ul {
            margin-bottom: 0;
            padding-left: 1.1rem;
        }

.person-list {
    display: grid;
    gap: .75rem;
}

.person-row {
    display: grid;
    gap: .45rem;
    padding: .8rem;
    border: 1px solid #e3eaf0;
    border-radius: 8px;
}

.person-contact {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    color: #527278;
    overflow-wrap: anywhere;
}

.muted {
    margin: 0;
    color: #6d8589;
}

/* =========================================================
   BOTONES
   ========================================================= */

.btn-primary {
    background-color: var(--ppso-turquoise);
    border-color: var(--ppso-turquoise);
}

    .btn-primary:hover,
    .btn-primary:focus {
        background-color: var(--ppso-turquoise-dark);
        border-color: var(--ppso-turquoise-dark);
    }

.btn-outline-primary {
    border-color: var(--ppso-turquoise);
    color: var(--ppso-turquoise-dark);
}

    .btn-outline-primary:hover,
    .btn-outline-primary:focus {
        background-color: var(--ppso-turquoise);
        border-color: var(--ppso-turquoise);
    }

/* =========================================================
   FOOTER
   ========================================================= */

.app-footer {
    position: relative;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: .65rem 1rem;
    background: var(--ppso-navy);
    color: #e8fbfd;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.2fr;
    align-items: center;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    gap: .35rem 1.2rem;
}

.footer-block {
    display: grid;
    gap: .2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: .8rem;
}

    .footer-brand img {
        width: 48px;
        height: 48px;
        border-radius: 10px;
        object-fit: contain;
    }

.footer-block strong {
    color: #ffffff;
    font-size: .92rem;
}

.footer-block span,
.footer-block,
.app-footer a {
    font-size: .84rem;
    line-height: 1.3;
}

.footer-system {
    text-align: center;
}

.footer-dev {
    text-align: right;
}

.app-footer a {
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
}

    .app-footer a:hover,
    .app-footer a:focus {
        text-decoration: underline;
    }

/* =========================================================
   ESTADOS
   ========================================================= */

.status-pill {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
}

    .status-pill.ok {
        background: #dff5e8;
        color: #166534;
    }

    .status-pill.bad {
        background: #fde2e1;
        color: #991b1b;
    }

/* =========================================================
   ESCRITORIOS Y TABLETS
   ========================================================= */

@media (max-width: 1100px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-grid-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) and (min-width: 761px) {
    .login-shell {
        display: grid;
        flex: 1 1 auto;
        grid-template-columns: minmax(0, 53%) minmax(390px, 47%);
        width: auto;
        height: 100%;
        min-width: 0;
        min-height: 0;
        margin: 0 -1.25rem;
        padding: 0;
        background: #f3f9fa;
        overflow: hidden;
    }

    .login-hero {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        padding: 1.5rem 2rem;
        background: linear-gradient( 135deg, var(--ppso-turquoise-dark) 0%, var(--ppso-turquoise) 100% );
        color: #ffffff;
        text-align: center;
    }

    .login-form-area {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        padding: 1.25rem 1.5rem;
        background: radial-gradient( circle at center, rgba(0, 166, 178, .09), transparent 62% ), #f3f9fa;
    }

    .login-hero h1 {
        width: 100%;
        max-width: 600px;
        margin: 0 0 .6rem;
        color: #ffffff;
        font-size: 2.15rem;
        font-weight: 800;
        line-height: 1.1;
        overflow-wrap: break-word;
    }
}

/* =========================================================
   PANTALLAS DE POCA ALTURA
   ========================================================= */

@media (min-width: 761px) and (max-height: 820px) {
    .login-shell {
        display: grid;
        flex: 1 1 auto;
        grid-template-columns: minmax(0, 56%) minmax(420px, 44%);
        width: auto;
        height: 100%;
        min-width: 0;
        min-height: 0;
        margin: 0 -1.25rem;
        padding: 0;
        background: #f3f9fa;
        overflow: hidden;
    }

    .login-hero {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        padding: 1rem 2.5rem;
        background: linear-gradient( 135deg, var(--ppso-turquoise-dark) 0%, var(--ppso-turquoise) 100% );
        color: #ffffff;
        text-align: center;
    }

    .login-hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 620px;
        margin: 0 auto;
    }

    .login-hero img,
    .login-hero-logo {
        display: block;
        width: 115px;
        height: 115px;
        max-width: 115px;
        max-height: 115px;
        margin: 0 auto .7rem;
        border-radius: 21px;
        object-fit: contain;
        box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
    }

    .login-hero h1 {
        width: 100%;
        max-width: 600px;
        margin: 0 0 .45rem;
        color: #ffffff;
        font-size: 2.2rem;
        font-weight: 800;
        line-height: 1.1;
        overflow-wrap: break-word;
    }

    .login-hero p {
        width: 100%;
        max-width: 530px;
        margin: 0 auto;
        color: rgba(255, 255, 255, .96);
        font-size: .95rem;
        line-height: 1.4;
        overflow-wrap: break-word;
        text-wrap: balance;
    }

    .login-form-area {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        padding: .8rem 3rem;
        background: radial-gradient( circle at center, rgba(0, 166, 178, .09), transparent 62% ), #f3f9fa;
    }

    .login-panel {
        width: 100%;
        max-width: 500px;
        padding: 1rem 2rem;
        background: #ffffff;
        border: 1px solid #d9e2e8;
        border-radius: 10px;
        box-shadow: 0 22px 60px rgba(7, 50, 58, .18);
    }

    .login-logo {
        display: block;
        width: 72px;
        height: 72px;
        max-width: 72px;
        max-height: 72px;
        margin: 0 auto .5rem;
        border-radius: 17px;
        object-fit: contain;
    }

    .login-panel h2 {
        margin: 0 0 .3rem;
        color: var(--ppso-navy);
        font-size: 1.45rem;
        font-weight: 700;
        line-height: 1.2;
        text-align: center;
    }

    .login-panel > p,
    .login-description {
        max-width: 420px;
        margin: 0 auto .65rem;
        color: #62717c;
        font-size: .9rem;
        line-height: 1.35;
        text-align: center;
    }

    .login-panel .stacked-form {
        display: grid;
        gap: .55rem;
    }

    .login-panel .form-field {
        display: grid;
        gap: .25rem;
    }

    .login-panel .form-label {
        margin: 0;
        font-size: .95rem;
    }

    .login-panel .form-control {
        width: 100%;
        min-height: 38px;
        padding: .4rem .7rem;
    }

    .login-panel .btn {
        width: 100%;
        min-height: 38px;
        font-size: .95rem;
    }

    .app-footer {
        position: relative;
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: .45rem 1rem;
        background: var(--ppso-navy);
        color: #e8fbfd;
    }

    .footer-inner {
        display: grid;
        grid-template-columns: 1.2fr 1fr 1.2fr;
        align-items: center;
        width: 100%;
        max-width: 1480px;
        margin: 0 auto;
        gap: .3rem 1rem;
    }

    .footer-brand {
        display: flex;
        align-items: center;
        gap: .7rem;
    }

        .footer-brand img {
            width: 42px;
            height: 42px;
            border-radius: 9px;
            object-fit: contain;
        }

    .footer-block strong {
        color: #ffffff;
        font-size: .86rem;
    }

    .footer-block span,
    .footer-block,
    .app-footer a {
        font-size: .78rem;
        line-height: 1.25;
    }
}

/* =========================================================
   MÓVILES
   ========================================================= */

@media (max-width: 760px) {
    html {
        width: 100%;
        height: auto;
        min-height: 100%;
        margin: 0;
        font-size: 16px;
    }

    body {
        width: 100%;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        margin: 0;
        background: #f3f9fa;
        color: var(--ppso-ink);
        overflow-x: hidden;
    }

    .app-shell {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        margin: 0;
        overflow: visible;
    }

    .app-main {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        width: 100%;
        min-width: 0;
        min-height: 0;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .content-wrap {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        width: 100%;
        max-width: none;
        min-width: 0;
        min-height: 0;
        margin: 0;
        padding: 0;
    }

    .navbar {
        padding-top: .65rem;
        padding-bottom: .65rem;
    }

    .navbar-collapse {
        padding-top: .75rem;
    }

    .navbar .nav-link,
    .user-label {
        padding: .7rem .5rem;
        font-size: 1rem;
    }

    .brand-logo-img {
        width: 38px;
        height: 38px;
        border-radius: 8px;
        object-fit: contain;
    }

    .login-shell {
        display: grid;
        flex: 0 0 auto;
        grid-template-columns: 1fr;
        width: 100%;
        height: auto;
        min-width: 0;
        min-height: auto;
        margin: 0;
        padding: 0;
        background: #f6fbfc;
        overflow: visible;
    }

    .login-hero {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: auto;
        min-width: 0;
        min-height: auto;
        padding: 1.6rem 1.25rem;
        background: linear-gradient( 135deg, var(--ppso-turquoise-dark) 0%, var(--ppso-turquoise) 100% );
        color: #ffffff;
        text-align: center;
    }

    .login-hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }

    .login-hero img,
    .login-hero-logo {
        display: block;
        width: 88px;
        height: 88px;
        max-width: 88px;
        max-height: 88px;
        margin: 0 auto .7rem;
        border-radius: 16px;
        object-fit: contain;
        box-shadow: 0 12px 28px rgba(0, 0, 0, .16);
    }

    .login-hero h1 {
        width: 100%;
        max-width: 400px;
        margin: 0 0 .45rem;
        color: #ffffff;
        font-size: 1.75rem;
        font-weight: 800;
        line-height: 1.15;
        overflow-wrap: break-word;
    }

    .login-hero p {
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
        color: rgba(255, 255, 255, .96);
        font-size: .92rem;
        line-height: 1.45;
        overflow-wrap: break-word;
        text-wrap: balance;
    }

    .login-form-area {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: auto;
        min-width: 0;
        min-height: auto;
        padding: 1rem .85rem;
        background: #f3f9fa;
    }

    .login-panel {
        width: 100%;
        max-width: 500px;
        padding: 1.2rem;
        background: #ffffff;
        border: 1px solid #d9e2e8;
        border-radius: 10px;
        box-shadow: 0 18px 45px rgba(7, 50, 58, .16);
    }

    .login-logo {
        display: block;
        width: 70px;
        height: 70px;
        max-width: 70px;
        max-height: 70px;
        margin: 0 auto .7rem;
        border-radius: 16px;
        object-fit: contain;
    }

    .login-panel h2 {
        margin: 0 0 .35rem;
        color: var(--ppso-navy);
        font-size: 1.4rem;
        font-weight: 700;
        line-height: 1.2;
        text-align: center;
    }

    .login-panel > p,
    .login-description {
        max-width: 420px;
        margin: 0 auto .9rem;
        color: #62717c;
        font-size: .92rem;
        line-height: 1.4;
        text-align: center;
    }

    .login-panel .stacked-form {
        display: grid;
        gap: .7rem;
    }

    .login-panel .form-field {
        display: grid;
        gap: .3rem;
    }

    .login-panel .form-label {
        margin: 0;
        font-size: .95rem;
    }

    .login-panel .form-control {
        width: 100%;
        min-height: 42px;
        padding: .5rem .7rem;
    }

    .login-panel .btn {
        width: 100%;
        min-height: 42px;
        font-size: .95rem;
    }

    .with-actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .page-heading {
        margin: 1rem .85rem;
    }

        .page-heading h1 {
            font-size: 1.55rem;
        }

    .metric-grid,
    .metric-grid.compact,
    .form-grid,
    .form-grid.three,
    .filter-bar,
    .detail-grid,
    .detail-split {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: auto;
        padding: .9rem;
    }

        .metric-card strong {
            font-size: 1.65rem;
        }

    .table-surface,
    .record-form,
    .delete-panel,
    .list-block,
    .detail-split > div {
        padding: .85rem;
        border-radius: 8px;
    }

    .table-responsive {
        margin: 0 -.85rem;
        padding: 0 .85rem;
    }

    .data-table thead th {
        font-size: .78rem;
    }

    .data-table td,
    .data-table th {
        min-width: 145px;
        padding: .75rem .65rem;
    }

    .button-row,
    .action-cell {
        width: 100%;
    }

        .button-row .btn,
        .form-actions .btn {
            width: 100%;
        }

    .person-contact {
        display: grid;
        gap: .25rem;
    }

    .app-footer {
        position: relative;
        width: 100%;
        min-width: 0;
        margin: auto 0 0;
        padding: .65rem 1rem;
        background: var(--ppso-navy);
        color: #e8fbfd;
    }

    .footer-inner {
        display: grid;
        grid-template-columns: 1fr;
        align-items: center;
        width: 100%;
        max-width: none;
        margin: 0;
        gap: .7rem;
        text-align: center;
    }

    .footer-block {
        display: grid;
        gap: .2rem;
    }

    .footer-brand {
        display: grid;
        align-items: center;
        justify-items: center;
        gap: .5rem;
    }

        .footer-brand img {
            width: 44px;
            height: 44px;
            border-radius: 9px;
            object-fit: contain;
        }

    .footer-system {
        text-align: center;
    }

    .footer-dev {
        text-align: center;
    }
}

/* =========================================================
   MÓVILES PEQUEÑOS
   ========================================================= */

@media (max-width: 420px) {
    .login-hero {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: auto;
        min-width: 0;
        min-height: auto;
        padding: 1.3rem 1rem;
        background: linear-gradient( 135deg, var(--ppso-turquoise-dark) 0%, var(--ppso-turquoise) 100% );
        color: #ffffff;
        text-align: center;
    }

        .login-hero img,
        .login-hero-logo {
            display: block;
            width: 74px;
            height: 74px;
            max-width: 74px;
            max-height: 74px;
            margin: 0 auto .6rem;
            border-radius: 15px;
            object-fit: contain;
            box-shadow: 0 12px 28px rgba(0, 0, 0, .16);
        }

        .login-hero h1 {
            width: 100%;
            max-width: 380px;
            margin: 0 0 .4rem;
            color: #ffffff;
            font-size: 1.55rem;
            font-weight: 800;
            line-height: 1.15;
            overflow-wrap: break-word;
        }

        .login-hero p {
            width: 100%;
            max-width: 340px;
            margin: 0 auto;
            color: rgba(255, 255, 255, .96);
            font-size: .88rem;
            line-height: 1.4;
            overflow-wrap: break-word;
            text-wrap: balance;
        }

    .login-form-area {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: auto;
        min-width: 0;
        min-height: auto;
        padding: .9rem .7rem;
        background: #f3f9fa;
    }

    .login-panel {
        width: 100%;
        max-width: 500px;
        padding: 1rem .9rem;
        background: #ffffff;
        border: 1px solid #d9e2e8;
        border-radius: 10px;
        box-shadow: 0 18px 45px rgba(7, 50, 58, .16);
    }

    .login-logo {
        display: block;
        width: 60px;
        height: 60px;
        max-width: 60px;
        max-height: 60px;
        margin: 0 auto .6rem;
        border-radius: 14px;
        object-fit: contain;
    }
}
