/* Estilos globales del MRP */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #0f172a;
    --surface-color: #f8f9fa;
    --text-muted: #64748b;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--surface-color);
    color: #0f172a;
    /* Layout Fix: Full height strict */
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-body {
    background-color: #edf2ff;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-header {
    flex-shrink: 0;
    z-index: 1030;
}

.app-shell {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.app-sidebar {
    width: 260px;
    background: #0f172a;
    padding: 2rem 1.25rem;
    color: #e2e8f0;
    overflow-y: auto;
    flex-shrink: 0;
    transition: width 0.25s ease, padding 0.25s ease, opacity 0.2s ease;
}

body.sidebar-desktop-hidden .app-sidebar,
html.sidebar-desktop-hidden .app-sidebar {
    width: 72px;
    min-width: 72px;
    padding: 1.25rem 0.5rem;
    opacity: 1;
    overflow-y: auto;
    pointer-events: auto;
}

body.sidebar-desktop-hidden .app-sidebar__section-title,
html.sidebar-desktop-hidden .app-sidebar__section-title,
body.sidebar-desktop-hidden .app-sidebar__card,
html.sidebar-desktop-hidden .app-sidebar__card {
    display: none;
}

body.sidebar-desktop-hidden .app-sidebar__link,
html.sidebar-desktop-hidden .app-sidebar__link {
    justify-content: center;
    padding: 0.6rem 0.5rem;
    gap: 0;
}

body.sidebar-desktop-hidden .app-sidebar__link:hover,
html.sidebar-desktop-hidden .app-sidebar__link:hover {
    transform: none;
}

body.sidebar-desktop-hidden .app-sidebar__link span,
html.sidebar-desktop-hidden .app-sidebar__link span {
    display: none;
}

body.sidebar-desktop-hidden .app-sidebar__nav .app-sidebar__nav,
html.sidebar-desktop-hidden .app-sidebar__nav .app-sidebar__nav {
    padding-left: 0 !important;
}

.app-sidebar__inner {
    /* Removed sticky */
}

.app-sidebar__section-title {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: rgba(226, 232, 240, 0.7);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.app-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.app-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(226, 232, 240, 0.85);
    text-decoration: none;
    padding: 0.6rem 0.8rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.app-sidebar__link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(3px);
}

.app-sidebar__link.is-active {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.25), rgba(13, 110, 253, 0.15));
    color: #fff;
    border-left: 3px solid #0d6efd;
    font-weight: 500;
}

.app-sidebar__card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.app-sidebar__card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bg-gradient-info-subtle {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.08) 0%, rgba(13, 110, 253, 0.05) 100%);
}

/* Mejoras de colores para el sidebar oscuro */
.app-sidebar .text-dark {
    color: #f1f5f9 !important;
}

.app-sidebar .text-info {
    color: #0dcaf0 !important;
}

.app-sidebar .text-success {
    color: #20c997 !important;
}

.app-sidebar .text-warning {
    color: #ffc107 !important;
}

.app-sidebar .text-secondary {
    color: rgba(226, 232, 240, 0.75) !important;
}

.app-sidebar .text-muted {
    color: rgba(226, 232, 240, 0.6) !important;
}

.app-shell__content {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    /* Content scrolls independently */
}

.app-footer {
    flex-shrink: 0;
}

.app-shell__content-inner {
    max-width: 100%;
    margin: 0 auto;
}

@media (max-width: 991.98px) {
    body.sidebar-desktop-hidden .app-sidebar {
        width: 260px;
        padding: 2rem 1.25rem;
        opacity: 1;
        pointer-events: auto;
    }

    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 -260px;
        height: 100vh;
        z-index: 1050;
        box-shadow: 10px 0 40px rgba(15, 23, 42, 0.45);
        transition: transform 0.3s ease;
        transform: translateX(0);
    }

    .app-sidebar.is-open {
        transform: translateX(260px);
    }

    .app-shell__content {
        padding: 1.5rem;
    }
}

.home-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1200px 360px at 15% 0%, rgba(31, 157, 139, 0.16), transparent 52%),
        radial-gradient(900px 320px at 100% 0%, rgba(11, 79, 108, 0.14), transparent 56%),
        linear-gradient(120deg, #ffffff 5%, #fffef6 100%);
}

.home-hero::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -160px;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 217, 142, 0.42) 0%, rgba(255, 217, 142, 0.1) 45%, transparent 70%);
    pointer-events: none;
}

.home-kicker {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0b4f6c;
}

.home-title {
    font-family: "Space Grotesk", "Trebuchet MS", "Segoe UI", sans-serif;
    font-size: clamp(1.8rem, 3.2vw, 3.2rem);
    line-height: 1.08;
    color: #112433;
    max-width: 17ch;
}

.home-subtitle {
    max-width: 58ch;
    color: #34505f;
    font-size: 1.05rem;
}

.home-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.home-chips span {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(11, 79, 108, 0.08);
    color: #133b4e;
    font-weight: 600;
    font-size: 0.85rem;
}

.home-hero__stats {
    min-width: 260px;
    border-radius: 1rem;
    background: #f5fbfa;
    border: 1px solid rgba(17, 36, 51, 0.08);
    padding: 1.1rem 1.15rem;
}

.home-hero__stats p {
    color: #476579;
}

.home-hero__stats ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.home-hero__stats ul li {
    color: #2d4a5c;
    font-size: 0.95rem;
}

.home-compare {
    border-radius: 1rem;
    box-shadow: 0 12px 28px rgba(17, 36, 51, 0.08);
}

.home-compare h2 {
    color: #16384a;
}

.home-compare ul {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.home-compare ul li {
    position: relative;
    padding-left: 1.1rem;
    color: #37566a;
}

.home-compare ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62rem;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: #98a9b3;
}

.home-compare--legacy {
    background: #ffffff;
    border: 1px solid rgba(55, 86, 106, 0.16);
}

.home-compare--mrp {
    background: linear-gradient(165deg, #0b4f6c 0%, #0f6d72 100%);
    color: #f4fffd;
}

.home-compare--mrp h2,
.home-compare--mrp li {
    color: #f4fffd;
}

.home-compare--mrp li::before {
    background: #ffd98e;
}

.home-flow {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.timeline {
    border-left: 2px dashed rgba(15, 23, 42, 0.15);
    margin-left: 1rem;
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.timeline__item {
    position: relative;
    display: flex;
    gap: 1rem;
}

.timeline__badge {
    position: absolute;
    left: -2.4rem;
    top: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background-color: #0d6efd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.2);
}

.home-cta {
    background: linear-gradient(130deg, #122f3f 0%, #0c4756 70%);
    color: #e8fbff;
}

.home-cta .btn-dark {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: #ffd98e;
    color: #26394a;
    font-weight: 700;
}

.home-cta .btn-dark:hover {
    background: #ffe8b5;
    color: #1f2f3d;
}

.home-reveal {
    opacity: 0;
    transform: translateY(20px);
    animation: homeFadeUp 0.55s ease-out forwards;
}

.home-landing section:nth-of-type(2) {
    animation-delay: 0.08s;
}

@keyframes homeFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 576px) {
    .app-shell__content {
        padding: 1rem;
    }

    .home-title {
        max-width: 100%;
    }

    .home-chips span {
        font-size: 0.8rem;
    }

    .timeline {
        margin-left: 0.7rem;
        padding-left: 1.25rem;
    }

    .timeline__badge {
        left: -2.1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-reveal {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

.auth-wrapper {
    max-width: 1100px;
    margin: 0 auto;
}

.auth-card .form-control {
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
}

.auth-benefits li {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: 0;
    color: #475569;
}

.auth-benefits li i {
    color: #0d6efd;
}

.tenant-chip {
    border-radius: 999px;
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-weight: 600;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
}

.auth-meta {
    border-radius: 1rem;
    background-color: rgba(15, 23, 42, 0.03);
    padding: 1rem;
}

.user-menu-dropdown {
    min-width: 240px;
}

code {
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 0.85rem;
    background-color: rgba(15, 23, 42, 0.05);
    padding: 0.15rem 0.35rem;
    border-radius: 0.35rem;
}

.card {
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.badge {
    font-size: 0.85rem;
}
