/* Purpose:
Global RBO Field Intel design tokens, typography, controls, layout primitives, and shared responsive behavior.

Responsibilities:
- Apply the layout, responsive behavior, and visual states required by app.

Boundaries:
CSS controls presentation only; trust meaning, workflow state, privacy, and persistence remain in maintained source logic.

Key decisions and invariants:
Global tokens and primitives remain centralized so feature styles do not silently create conflicting product semantics.
*/
:root {
    --rbo-navy: #050728;
    --rbo-navy-soft: #10143d;
    --rbo-gold: #eece7a;
    --rbo-orange: #f29836;
    --rbo-cream: #f6f0e4;
    --rbo-paper: #fffdf8;
    --rbo-ink: #151a2f;
    --rbo-muted: #687083;
    --rbo-border: #ddd6c7;
    --rbo-success: #35745a;
    --shadow-soft: 0 18px 50px rgba(5, 7, 40, 0.08);
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--rbo-cream);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--rbo-cream);
    color: var(--rbo-ink);
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 26px 20px 22px;
    color: #fff;
    background:
        radial-gradient(circle at 30% 0%, rgba(238, 206, 122, 0.16), transparent 28%),
        var(--rbo-navy);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 2px 6px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
    width: 62px;
    height: 62px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.brand-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.brand-subtitle {
    margin-top: 4px;
    color: var(--rbo-gold);
    font-size: 0.72rem;
    letter-spacing: 0.19em;
    text-transform: uppercase;
}

.primary-nav {
    display: grid;
    gap: 7px;
    margin-top: 24px;
}

.nav-item {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.76);
    text-decoration: none;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.active,
.nav-item-active {
    color: #fff;
    border-color: rgba(238, 206, 122, 0.24);
    background: rgba(238, 206, 122, 0.11);
}

.nav-item-disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.nav-icon {
    width: 24px;
    color: var(--rbo-orange);
    font-weight: 800;
    text-align: center;
}

.sidebar-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: auto;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-status div {
    display: grid;
    gap: 3px;
}

.sidebar-status strong {
    font-size: 0.82rem;
}

.sidebar-status span:not(.status-dot) {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.74rem;
}

.status-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--rbo-orange);
    box-shadow: 0 0 0 4px rgba(242, 152, 54, 0.14);
}

.status-dot-muted {
    margin-top: 0;
    background: #8c94a7;
    box-shadow: none;
}

.workspace-shell {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px clamp(22px, 4vw, 54px);
    border-bottom: 1px solid rgba(21, 26, 47, 0.08);
    background: rgba(246, 240, 228, 0.92);
    backdrop-filter: blur(14px);
}

.topbar > div:first-child {
    display: grid;
    gap: 3px;
}

.topbar-context {
    font-weight: 700;
}

.connection-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid var(--rbo-border);
    border-radius: 999px;
    color: var(--rbo-muted);
    background: rgba(255, 253, 248, 0.7);
    font-size: 0.78rem;
}

.main-content {
    width: min(1260px, 100%);
    margin: 0 auto;
    padding: clamp(26px, 4vw, 56px);
}

.eyebrow {
    margin: 0;
    color: var(--rbo-orange);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.55fr);
    gap: clamp(24px, 5vw, 66px);
    align-items: center;
    padding: clamp(30px, 5vw, 58px);
    border-radius: 28px;
    color: #fff;
    background:
        linear-gradient(120deg, rgba(5, 7, 40, 0.98), rgba(16, 20, 61, 0.95)),
        var(--rbo-navy);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    position: relative;
}

.hero-panel::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    right: -150px;
    bottom: -200px;
    border: 48px solid rgba(238, 206, 122, 0.12);
    transform: rotate(45deg);
}

.hero-panel h1 {
    max-width: 750px;
    margin: 12px 0 16px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.15rem, 5vw, 4.5rem);
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -0.035em;
}

.hero-copy {
    max-width: 720px;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
    margin-top: 26px;
}

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 0.88rem;
    font-weight: 750;
    text-decoration: none;
}

.button-primary {
    color: var(--rbo-navy);
    background: linear-gradient(135deg, var(--rbo-gold), var(--rbo-orange));
}

.button-secondary {
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.button-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.readiness-card {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 7px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.readiness-card strong {
    margin-top: 4px;
    color: var(--rbo-gold);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3.4rem;
    font-weight: 500;
    line-height: 1;
}

.readiness-card > span:not(.readiness-label) {
    color: rgba(255, 255, 255, 0.7);
}

.readiness-label {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.progress-track,
.location-progress {
    height: 7px;
    margin: 11px 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    overflow: hidden;
}

.progress-track span,
.location-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--rbo-gold), var(--rbo-orange));
}

.readiness-card small {
    color: rgba(255, 255, 255, 0.58);
    line-height: 1.5;
}

.section-block {
    margin-top: 48px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.section-heading h2,
.phase-banner h2,
.empty-state h1 {
    margin: 7px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    font-weight: 500;
    letter-spacing: -0.025em;
}

.section-note {
    color: var(--rbo-muted);
    font-size: 0.8rem;
}

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

.action-card,
.location-card {
    border: 1px solid var(--rbo-border);
    border-radius: 19px;
    background: var(--rbo-paper);
    box-shadow: 0 12px 30px rgba(5, 7, 40, 0.04);
}

.action-card {
    min-height: 200px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    padding: 24px;
}

.action-card-primary {
    border-color: rgba(242, 152, 54, 0.46);
    background: linear-gradient(145deg, #fffdf8, #fff8e9);
}

.action-number {
    color: var(--rbo-orange);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.4rem;
}

.action-card h3,
.location-card h3 {
    margin: 0 0 9px;
    font-size: 1.08rem;
}

.action-card p,
.location-card > p,
.phase-banner p,
.empty-state p {
    margin: 0;
    color: var(--rbo-muted);
    line-height: 1.62;
}

.text-link {
    grid-column: 2;
    align-self: end;
    color: var(--rbo-navy);
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
}

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

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

.location-card {
    display: flex;
    flex-direction: column;
    gap: 17px;
    padding: 22px;
    scroll-margin-top: 96px;
}

.location-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.location-status {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--rbo-orange);
    font-size: 0.66rem;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.location-score {
    min-width: 58px;
    display: grid;
    justify-items: end;
    gap: 3px;
}

.location-score strong {
    color: var(--rbo-navy);
    font-size: 1.2rem;
}

.location-score span {
    color: var(--rbo-muted);
    font-size: 0.72rem;
}

.location-progress {
    margin: 0;
    background: #ece6da;
}

.next-requirement {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-left: 3px solid var(--rbo-orange);
    border-radius: 0 10px 10px 0;
    background: #f7f1e6;
}

.next-requirement span {
    color: var(--rbo-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.next-requirement strong {
    font-size: 0.84rem;
    line-height: 1.45;
}

details {
    margin-top: auto;
    border-top: 1px solid var(--rbo-border);
    padding-top: 14px;
}

summary {
    cursor: pointer;
    color: var(--rbo-navy);
    font-size: 0.82rem;
    font-weight: 800;
}

.requirement-list {
    display: grid;
    gap: 10px;
    margin: 15px 0 0;
    padding: 0;
    list-style: none;
}

.requirement-list li {
    display: grid;
    grid-template-columns: 15px 1fr;
    gap: 9px;
    align-items: start;
    color: var(--rbo-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.requirement-marker {
    width: 12px;
    height: 12px;
    margin-top: 2px;
    border: 1px solid #a9a28f;
    border-radius: 3px;
}

.requirement-complete {
    text-decoration: line-through;
}

.phase-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-top: 48px;
    padding: 28px 30px;
    border: 1px solid rgba(238, 206, 122, 0.44);
    border-radius: 20px;
    background: linear-gradient(125deg, rgba(238, 206, 122, 0.25), rgba(242, 152, 54, 0.11));
}

.phase-banner p {
    max-width: 760px;
    margin-top: 9px;
}

.phase-tag {
    flex: 0 0 auto;
    padding: 9px 12px;
    border-radius: 999px;
    color: #fff;
    background: var(--rbo-navy);
    font-size: 0.74rem;
    font-weight: 800;
}

.empty-state {
    min-height: 60vh;
    display: grid;
    place-content: center;
    justify-items: start;
    gap: 12px;
}

#blazor-error-ui {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    color: #fff;
    background: #8b2f36;
    box-shadow: var(--shadow-soft);
}

#blazor-error-ui .reload {
    color: #fff;
    font-weight: 800;
}

#blazor-error-ui .dismiss {
    border: 0;
    color: #fff;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
}

.loading-screen {
    min-height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 18px;
    color: #fff;
    background: var(--rbo-navy);
}

.loading-diamond {
    width: 62px;
    height: 62px;
    border: 8px solid var(--rbo-gold);
    transform: rotate(45deg);
    animation: breathe 1.4s ease-in-out infinite alternate;
}

.loading-screen strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.3rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.loading-screen span {
    color: var(--rbo-gold);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

@keyframes breathe {
    from { opacity: 0.55; transform: rotate(45deg) scale(0.92); }
    to { opacity: 1; transform: rotate(45deg) scale(1); }
}

@media (max-width: 1050px) {
    .app-shell {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .sidebar {
        padding-inline: 14px;
    }

    .brand-block {
        justify-content: center;
    }

    .brand-block > div,
    .nav-item span:last-child,
    .sidebar-status div {
        display: none;
    }

    .brand-mark {
        width: 54px;
        height: 54px;
    }

    .nav-item {
        justify-content: center;
    }

    .nav-icon {
        font-size: 1.1rem;
    }

    .sidebar-status {
        justify-content: center;
    }

    .hero-panel {
        grid-template-columns: 1fr;
    }

    .readiness-card {
        max-width: 420px;
    }

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

@media (max-width: 720px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        display: block;
        padding: 12px 14px;
    }

    .brand-block,
    .sidebar-status {
        display: none;
    }

    .primary-nav {
        display: flex;
        gap: 6px;
        margin: 0;
        overflow-x: auto;
    }

    .nav-item {
        min-width: 48px;
        min-height: 42px;
        padding: 8px 11px;
    }

    .topbar {
        position: static;
        padding: 14px 18px;
    }

    .connection-pill {
        display: none;
    }

    .main-content {
        padding: 20px 16px 36px;
    }

    .hero-panel {
        padding: 26px 21px;
        border-radius: 20px;
    }

    .hero-panel h1 {
        font-size: clamp(2.05rem, 11vw, 3.1rem);
    }

    .hero-actions,
    .action-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .button {
        width: 100%;
    }

    .section-heading,
    .phase-banner {
        align-items: flex-start;
        flex-direction: column;
    }

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