/* Pantallas aprobadas: ingreso, inicio y estadísticas. El resto conserva su diseño. */
.login-page,
.home-page,
.statistics-page {
    background: var(--background);
}

.login-page .site-header,
.home-page .site-header,
.statistics-page .site-header {
    min-height: 72px;
    border-top: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}

.login-page .page-shell {
    width: min(100% - 32px, 460px);
    margin-block: clamp(32px, 8vh, 80px);
}

.approved-login-card {
    padding: clamp(28px, 6vw, 42px);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgb(39 70 48 / 8%);
}

.approved-login-card h1 {
    margin-top: 8px;
}

.password-input-wrap {
    position: relative;
}

.password-input-wrap input {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    transform: translateY(-50%);
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--primary);
    background: #eef4ef;
}

.password-toggle svg {
    display: block;
}

.password-toggle svg[hidden] {
    display: none;
}

.home-page .page-shell,
.statistics-page .page-shell {
    width: min(100% - 32px, 1040px);
    margin-block: clamp(36px, 7vw, 72px);
}

.workspace-home {
    display: grid;
    gap: 28px;
}

.workspace-heading {
    max-width: 650px;
}

.workspace-heading h1,
.statistics-heading h1 {
    margin-top: 8px;
}

.workspace-user {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.workspace-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.workspace-action {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 18px;
    min-height: 108px;
    padding: 22px;
    color: var(--text);
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgb(70 91 75 / 5%);
}

.workspace-action:hover {
    border-color: #aac0bb;
    box-shadow: 0 10px 28px rgb(70 91 75 / 9%);
}

.workspace-action span:first-child {
    display: grid;
    gap: 5px;
}

.workspace-action strong {
    color: var(--primary);
}

.workspace-action small {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.workspace-arrow {
    color: var(--brand-purple);
    font-size: 1.5rem;
}

.statistics-shell {
    display: grid;
    gap: 18px;
}

.statistics-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}

.statistics-date {
    margin: 0 0 6px;
    color: var(--muted);
    white-space: nowrap;
}

.statistics-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.statistics-summary article,
.statistics-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.statistics-summary article {
    display: grid;
    gap: 5px;
    padding: 20px;
}

.statistics-summary article strong {
    color: var(--primary);
}

.statistics-summary article span {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.statistics-panel {
    padding: 24px;
}

.statistics-panel h2 {
    margin: 0 0 4px;
}

.statistics-panel > p {
    margin: 0;
}

.statistics-bars {
    display: grid;
    gap: 13px;
    margin-top: 20px;
}

.statistics-bar-row {
    display: grid;
    grid-template-columns: minmax(115px, 1fr) minmax(100px, 1.7fr) 36px;
    align-items: center;
    gap: 10px;
}

.statistics-bar-row > span {
    overflow-wrap: anywhere;
}

.statistics-bar-row strong {
    color: var(--muted);
    text-align: right;
}

.statistics-bar-row progress {
    width: 100%;
    height: 8px;
    overflow: hidden;
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: #e4ebe5;
}

.statistics-bar-row progress::-webkit-progress-bar {
    background: #e4ebe5;
    border-radius: 999px;
}

.statistics-bar-row progress::-webkit-progress-value {
    background: var(--brand-green);
    border-radius: 999px;
}

.statistics-bar-row progress::-moz-progress-bar {
    background: var(--brand-green);
    border-radius: 999px;
}

.statistics-empty {
    margin-top: 18px !important;
    color: var(--muted);
}

@media (max-width: 760px) {
    .home-page .site-header,
    .statistics-page .site-header {
        align-items: flex-start;
    }

    .workspace-actions,
    .statistics-summary,
    .statistics-grid {
        grid-template-columns: 1fr;
    }

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

    .statistics-date {
        white-space: normal;
    }
}

@media (max-width: 460px) {
    .statistics-bar-row {
        grid-template-columns: 1fr 36px;
    }

    .statistics-bar-row progress {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

/* Aplicacion de marca oficial en las pantallas principales. */
.login-page {
    background-color: var(--background);
    background-image:
        url("../img/respira-isotipo.884dfd212133.png"),
        radial-gradient(circle at 12% 10%, rgb(214 226 216 / 72%), transparent 29rem),
        radial-gradient(circle at 92% 16%, rgb(227 219 234 / 70%), transparent 28rem);
    background-position: right calc(-1 * min(8vw, 105px)) bottom 16px, left top, right top;
    background-repeat: no-repeat;
    background-size: min(40vw, 520px) auto, auto, auto;
}

.login-brand-image {
    display: block;
    width: 176px;
    max-width: 58%;
    height: auto;
    margin: -14px auto 24px;
}

.approved-login-card .eyebrow {
    color: var(--brand-purple);
}

.workspace-home {
    position: relative;
}

.workspace-heading {
    padding-right: 190px;
}

.workspace-brand-seal {
    position: absolute;
    top: -22px;
    right: 8px;
    width: 154px;
    height: auto;
    filter: drop-shadow(0 12px 22px rgb(55 78 61 / 9%));
}

.workspace-action {
    position: relative;
    overflow: hidden;
}

.workspace-action::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--brand-green), var(--brand-purple));
    opacity: 0.7;
}

.workspace-action:nth-child(even)::before {
    background: linear-gradient(180deg, var(--brand-purple), var(--brand-light-green));
}

@media (max-width: 900px) {
    .login-page {
        padding-bottom: 160px;
        background-position: right -60px bottom 0, left top, right top;
        background-size: 300px auto, auto, auto;
    }
}

@media (max-width: 760px) {
    .workspace-heading {
        padding-right: 0;
    }

    .workspace-brand-seal {
        position: static;
        width: 112px;
        margin: -10px 0 2px;
    }
}

@media (max-width: 520px) {
    .login-brand-image {
        width: 144px;
        margin-bottom: 20px;
    }
}
