@media screen, print {
    :root {
        color-scheme: light;

        /* Variables heredadas que deben conservarse. */
        --main-letter-type: Roboto, "Roboto Condensed", "Nimbus Sans L",
            Arial, Helvetica, Tahoma, Verdana, sans-serif;
        --main-letter-size: 11px;
        --main-line-height: 35px;
        --main-line-height-input: 38px;
        --main-line-height-button: 38px;
        --main-line-height-title: 40px;
        --main-line-height-title-mov: 32px;
        --main-line-height-check: 20px;
        --main-selector-txt-color: #ffffff;
        --main-selector-bar-color: linear-gradient(#d18840, #b06720);
        --main-selected-txt-color: #ffffff;
        --main-selected-bar-color: linear-gradient(#f1a860, #d18840);
        --main-jover-texto: #ffffff;
        --main-jover-color: linear-gradient(#d18840, #b06720);
        --main-line1-color: #f7f2e7;
        --main-line2-color: #fbf8f3;
        --main-base-color: #71706e;
        --main-focus-color: #9c551f;

        /* Variables nuevas construidas a partir de las anteriores. */
        --brand-700: #8c4515;
        --brand-600: #a95a1a;
        --brand-500: #c57432;
        --surface-0: #ffffff;
        --surface-1: #fbf8f3;
        --surface-2: #f7f2e7;
        --surface-3: #eee7dc;
        --border-color: #ded6ca;
        --text-color: var(--main-base-color);
        --text-strong: #332f2a;
        --text-muted: #777068;
        --danger: #a33a34;
        --success: #397456;
        --shadow: 0 18px 50px rgba(56, 39, 24, 0.12);
        --radius-sm: 8px;
        --radius-md: 14px;
        --radius-lg: 22px;
    }

    :root[data-theme="dark"] {
        color-scheme: dark;
        --main-line1-color: #272522;
        --main-line2-color: #211f1d;
        --main-base-color: #dedbd5;
        --main-focus-color: #efad73;
        --surface-0: #181715;
        --surface-1: #1f1e1b;
        --surface-2: #272522;
        --surface-3: #302d29;
        --border-color: #48433d;
        --text-color: var(--main-base-color);
        --text-strong: #faf7f2;
        --text-muted: #aaa39a;
        --danger: #e68a83;
        --success: #84c49e;
        --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
    }

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

    html {
        min-height: 100%;
        background: var(--surface-1);
        color: var(--text-color);
        font-family: var(--main-letter-type);
        font-size: var(--main-letter-size);
    }

    body {
        min-height: 100vh;
        margin: 0;
        background:
            radial-gradient(circle at 100% 0, rgba(209, 136, 64, 0.12), transparent 32rem),
            var(--surface-1);
        color: var(--text-color);
        font-family: var(--main-letter-type);
        font-size: var(--main-letter-size);
        line-height: 1.5;
    }

    button,
    input,
    select {
        color: inherit;
        font: inherit;
    }

    button,
    select {
        cursor: pointer;
    }

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

    h1,
    h2,
    p {
        margin-top: 0;
    }

    h1,
    h2 {
        color: var(--text-strong);
        line-height: 1.14;
    }

    h1 {
        margin-bottom: 10px;
        font-size: clamp(2rem, 4vw, 3.4rem);
        letter-spacing: -0.04em;
    }

    h2 {
        margin-bottom: 8px;
        font-size: 1.7rem;
    }

    .eyebrow {
        margin-bottom: 7px;
        color: var(--brand-600);
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.14em;
        text-transform: uppercase;
    }

    .muted {
        color: var(--text-muted);
    }

    .login-shell {
        display: grid;
        min-height: 100vh;
        place-items: center;
        padding: 24px;
    }

    .login-card {
        width: min(100%, 430px);
        padding: clamp(28px, 6vw, 48px);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        background: color-mix(in srgb, var(--surface-0) 94%, transparent);
        box-shadow: var(--shadow);
    }

    .brand-mark {
        display: grid;
        width: 58px;
        height: 58px;
        margin-bottom: 28px;
        place-items: center;
        border-radius: 18px;
        background: var(--main-selector-bar-color);
        color: var(--main-selector-txt-color);
        box-shadow: 0 9px 22px rgba(176, 103, 32, 0.28);
        font-size: 1.9rem;
        font-weight: 900;
    }

    .brand-mark-small {
        width: 38px;
        height: 38px;
        margin: 0;
        border-radius: 12px;
        font-size: 1.15rem;
    }

    .stack {
        display: grid;
        gap: 10px;
        margin-top: 28px;
    }

    label {
        color: var(--text-strong);
        font-weight: 700;
    }

    input,
    select {
        min-height: var(--main-line-height-input);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        outline: none;
        background: var(--surface-0);
        padding: 0 12px;
    }

    input:focus,
    select:focus,
    button:focus-visible,
    a:focus-visible {
        outline: 3px solid color-mix(in srgb, var(--main-focus-color) 32%, transparent);
        outline-offset: 2px;
        border-color: var(--main-focus-color);
    }

    .button {
        min-height: var(--main-line-height-button);
        border: 1px solid transparent;
        border-radius: var(--radius-sm);
        padding: 0 17px;
        font-weight: 800;
    }

    .button-primary {
        margin-top: 12px;
        background: var(--main-selector-bar-color);
        color: var(--main-selector-txt-color);
        box-shadow: 0 7px 18px rgba(176, 103, 32, 0.2);
    }

    .button-primary:hover {
        background: var(--main-jover-color);
        color: var(--main-jover-texto);
    }

    .button-quiet {
        border-color: var(--border-color);
        background: var(--surface-0);
        color: var(--text-color);
    }

    .theme-cycle {
        width: 100%;
        margin-top: 18px;
    }

    .notice {
        margin: 20px 0 0;
        border-radius: var(--radius-sm);
        padding: 12px 14px;
    }

    .notice-error {
        border: 1px solid color-mix(in srgb, var(--danger) 36%, transparent);
        background: color-mix(in srgb, var(--danger) 10%, var(--surface-0));
        color: var(--danger);
    }

    .app-shell {
        display: grid;
        min-height: 100vh;
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .sidebar {
        display: flex;
        position: sticky;
        top: 0;
        height: 100vh;
        flex-direction: column;
        border-right: 1px solid var(--border-color);
        background: var(--surface-0);
        padding: 24px 18px;
    }

    .brand {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 8px;
    }

    .brand strong,
    .brand small,
    .user-summary strong,
    .user-summary small {
        display: block;
    }

    .brand strong {
        color: var(--text-strong);
        font-size: 1.05rem;
    }

    .brand small,
    .user-summary small {
        color: var(--text-muted);
    }

    .main-nav {
        display: grid;
        gap: 6px;
        margin-top: 48px;
    }

    .nav-link {
        display: flex;
        min-height: var(--main-line-height);
        align-items: center;
        gap: 12px;
        border-radius: var(--radius-sm);
        padding: 0 13px;
        color: var(--text-muted);
        font-weight: 700;
    }

    .nav-link:hover {
        background: var(--surface-2);
        color: var(--text-strong);
    }

    .nav-link.active {
        background: var(--main-selected-bar-color);
        color: var(--main-selected-txt-color);
        box-shadow: 0 7px 16px rgba(176, 103, 32, 0.18);
    }

    .sidebar-footer {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: auto;
        border-top: 1px solid var(--border-color);
        padding: 18px 8px 0;
    }

    .avatar {
        display: grid;
        width: 38px;
        height: 38px;
        flex: 0 0 auto;
        place-items: center;
        border-radius: 50%;
        background: var(--surface-3);
        color: var(--brand-600);
        font-weight: 900;
    }

    .user-summary {
        min-width: 0;
    }

    .user-summary strong,
    .user-summary small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .content {
        width: min(100%, 1360px);
        padding: clamp(24px, 5vw, 68px);
    }

    .topbar {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 24px;
    }

    .topbar-actions {
        display: flex;
        align-items: end;
        gap: 10px;
    }

    .theme-field {
        display: grid;
        gap: 4px;
        color: var(--text-muted);
        font-size: 0.78rem;
    }

    .theme-field select {
        min-width: 142px;
    }

    .welcome-panel {
        margin-top: 38px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        background:
            linear-gradient(125deg, rgba(209, 136, 64, 0.12), transparent 55%),
            var(--surface-0);
        padding: clamp(26px, 5vw, 46px);
        box-shadow: var(--shadow);
    }

    .welcome-panel p:last-child {
        max-width: 62ch;
        margin-bottom: 0;
        color: var(--text-muted);
    }

    .dashboard-grid {
        display: grid;
        gap: 18px;
        margin-top: 20px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-card {
        display: grid;
        min-height: 210px;
        grid-template-columns: auto 1fr;
        gap: 18px;
        align-content: start;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        background: var(--surface-0);
        padding: 26px;
    }

    .dashboard-card:hover {
        border-color: color-mix(in srgb, var(--brand-500) 55%, var(--border-color));
        transform: translateY(-2px);
        transition: transform 160ms ease, border-color 160ms ease;
    }

    .dashboard-card p:not(.eyebrow) {
        margin-bottom: 0;
        color: var(--text-muted);
    }

    .card-icon {
        display: grid;
        width: 44px;
        height: 44px;
        place-items: center;
        border-radius: 13px;
        background: var(--surface-2);
        color: var(--brand-600);
        font-size: 1.35rem;
    }

    .status-pill {
        width: max-content;
        grid-column: 2;
        align-self: end;
        border-radius: 999px;
        background: var(--surface-2);
        color: var(--text-muted);
        padding: 5px 10px;
        font-size: 0.76rem;
        font-weight: 800;
    }

    @media (max-width: 820px) {
        .app-shell {
            grid-template-columns: 1fr;
        }

        .sidebar {
            position: static;
            width: 100%;
            height: auto;
            border-right: 0;
            border-bottom: 1px solid var(--border-color);
        }

        .main-nav {
            display: flex;
            margin-top: 20px;
            overflow-x: auto;
        }

        .sidebar-footer {
            display: none;
        }

        .content {
            padding: 24px 18px 42px;
        }

        .topbar {
            display: block;
        }

        .topbar-actions {
            margin-top: 18px;
        }

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

    @media (max-width: 480px) {
        .topbar-actions {
            align-items: stretch;
            flex-direction: column;
        }

        .theme-field select,
        .topbar-actions form,
        .topbar-actions .button {
            width: 100%;
        }

        .dashboard-card {
            grid-template-columns: 1fr;
        }

        .status-pill {
            grid-column: 1;
        }
    }

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

