:root {
    --ui-primary: #1d3b53;
    --ui-primary-dark: #122a3d;
    --ui-accent: #1f7a75;
    --ui-surface: #ffffff;
    --ui-background: #f3f6f8;
    --ui-border: #dce3e8;
    --ui-text: #22313c;
    --ui-muted: #647580;
    --sidebar-width: 272px;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--ui-background);
    color: var(--ui-text);
    min-height: 100vh;
}

a {
    color: var(--ui-primary);
}

.guest-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 15% 20%, rgba(31, 122, 117, .14), transparent 32rem),
        linear-gradient(145deg, #f7fafb, #eaf0f3);
}

.guest-card {
    width: min(100%, 610px);
    border: 1px solid var(--ui-border);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 1.5rem 4rem rgba(18, 42, 61, .12);
    overflow: hidden;
}

.brand-lockup {
    display: flex;
    gap: .85rem;
    align-items: center;
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: .9rem;
    color: #fff;
    background: linear-gradient(145deg, var(--ui-primary), var(--ui-accent));
    font-weight: 800;
    letter-spacing: -.05em;
}

.brand-name {
    margin: 0;
    font-weight: 750;
    font-size: 1.05rem;
}

.brand-tagline {
    margin: .1rem 0 0;
    color: var(--ui-muted);
    font-size: .8rem;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--ui-primary-dark);
    color: #fff;
    padding: 1.25rem;
    z-index: 1040;
    overflow-y: auto;
    transition: transform .2s ease;
}

.sidebar .brand-tagline {
    color: rgba(255, 255, 255, .67);
}

.sidebar .brand-mark {
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .16);
}

.sidebar-nav {
    margin-top: 2rem;
}

.sidebar-label {
    color: rgba(255, 255, 255, .5);
    font-size: .69rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin: 1.25rem .75rem .45rem;
}

.sidebar-link {
    display: flex;
    gap: .75rem;
    align-items: center;
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
    padding: .7rem .8rem;
    border-radius: .7rem;
    margin-bottom: .2rem;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.sidebar-bullet {
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: #58bbb3;
    flex: 0 0 auto;
}

.main-area {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.5rem;
    background: var(--ui-surface);
    border-bottom: 1px solid var(--ui-border);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.content-area {
    padding: 1.5rem;
}

.page-heading h1 {
    font-size: 1.55rem;
    margin: 0;
}

.page-heading p {
    margin: .25rem 0 0;
    color: var(--ui-muted);
}

.panel-card,
.metric-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: 1rem;
    box-shadow: 0 .35rem 1rem rgba(18, 42, 61, .04);
}

.metric-card {
    padding: 1.15rem;
    height: 100%;
}

.metric-label {
    color: var(--ui-muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.metric-value {
    display: block;
    margin-top: .25rem;
    font-size: 2rem;
    font-weight: 800;
    color: var(--ui-primary);
}

.phase-item {
    border-left: 3px solid var(--ui-border);
    padding: .65rem 0 .65rem 1rem;
}

.phase-item.current {
    border-left-color: var(--ui-accent);
}

.table > :not(caption) > * > * {
    padding: .8rem .75rem;
    vertical-align: middle;
}

.form-label {
    font-weight: 650;
}

.btn-primary {
    --bs-btn-bg: var(--ui-primary);
    --bs-btn-border-color: var(--ui-primary);
    --bs-btn-hover-bg: var(--ui-primary-dark);
    --bs-btn-hover-border-color: var(--ui-primary-dark);
}

.mobile-menu {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main-area {
        margin-left: 0;
    }

    .mobile-menu {
        display: inline-flex;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(9, 25, 36, .48);
        z-index: 1035;
    }
}

@media (max-width: 575.98px) {
    .content-area,
    .topbar {
        padding: 1rem;
    }

    .user-meta {
        display: none;
    }
}
