:root {
    --ink: #202c39;
    --paper: #f4f1de;
    --route: #3d5a80;
    --clay: #e07a5f;
    --mint: #81b29a;
    --line: rgba(32, 44, 57, 0.18);
    --muted: rgba(32, 44, 57, 0.66);
    --white: #fffdf7;
    --shadow: 0 24px 60px rgba(32, 44, 57, 0.16);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

body {
    min-height: 100%;
    margin: 0;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.rail {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
    height: 100vh;
    padding: 26px 22px;
    background: var(--ink);
    color: var(--paper);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand strong,
h1,
h2,
h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    letter-spacing: 0;
}

.brand strong {
    display: block;
    font-size: 1.12rem;
    line-height: 1.05;
}

.brand small,
.rail-note span,
.eyebrow {
    color: rgba(244, 241, 222, 0.72);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.screen-nav {
    display: grid;
    gap: 8px;
}

.nav-button {
    min-height: 42px;
    border: 1px solid rgba(244, 241, 222, 0.16);
    border-radius: 8px;
    background: transparent;
    color: rgba(244, 241, 222, 0.76);
    text-align: left;
    padding: 0 14px;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-button:hover,
.nav-button.is-active {
    background: var(--paper);
    color: var(--ink);
    transform: translateX(2px);
}

.rail-note {
    margin-top: auto;
    border-top: 1px solid rgba(244, 241, 222, 0.18);
    padding-top: 20px;
}

.rail-note strong {
    display: block;
    margin-top: 8px;
    font-size: 0.98rem;
    line-height: 1.55;
}

.workspace {
    padding: 28px;
}

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

.eyebrow {
    margin: 0 0 8px;
    color: var(--route);
    font-weight: 800;
}

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

h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 4vw, 4.35rem);
    line-height: 0.95;
    max-width: 760px;
}

h2 {
    margin-bottom: 0;
    font-size: 2rem;
}

.live-chip,
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(61, 90, 128, 0.12);
    color: var(--route);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.live-chip.is-online {
    background: rgba(129, 178, 154, 0.18);
    color: #2f7652;
}

.live-chip.is-error,
.metric-alert strong {
    color: #a7462c;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    background: var(--white);
    box-shadow: var(--shadow);
}

.metric {
    min-width: 0;
    padding: 18px 20px;
    border-right: 1px solid var(--line);
}

.metric:last-child {
    border-right: 0;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
}

.metric strong {
    display: block;
    margin-top: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
}

.screen {
    display: none;
    margin-top: 24px;
    animation: enter 220ms ease both;
}

.screen.is-active {
    display: block;
}

.dispatch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(310px, 0.62fr);
    gap: 22px;
    align-items: start;
}

.field-board,
.inspector,
.action-stream,
.workflow-grid,
.team-board {
    min-width: 0;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 12px;
    margin-bottom: 14px;
}

.search-box {
    display: grid;
    gap: 5px;
}

.search-box span {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
}

input,
select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    padding: 0 12px;
}

.timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.stop {
    min-width: 0;
    min-height: 92px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #fffdf7, #eee8cf);
    color: var(--ink);
    padding: 12px;
    text-align: left;
    transition: transform 160ms ease, border-color 160ms ease;
}

.stop:hover {
    border-color: var(--route);
    transform: translateY(-2px);
}

.stop-index,
.stop small {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
}

.stop strong {
    display: block;
    margin: 6px 0;
}

.sample-list {
    display: grid;
    gap: 8px;
}

.sample-row {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    min-height: 74px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.68);
    color: var(--ink);
    padding: 12px;
    text-align: left;
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.sample-row:hover,
.sample-row.is-selected {
    background: var(--white);
    box-shadow: 0 14px 32px rgba(32, 44, 57, 0.12);
    transform: translateX(2px);
}

.route-pin {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--route);
}

.sample-main,
.sample-meta {
    min-width: 0;
}

.sample-main strong,
.sample-main small,
.sample-meta small {
    display: block;
    overflow-wrap: anywhere;
}

.sample-main small,
.sample-meta small,
.detail-grid dt,
.detail-grid dd,
.check small,
.action-item small,
.workflow-step small,
.team-member span,
.team-member small {
    color: var(--muted);
}

.sample-meta {
    text-align: right;
}

.sample-meta b {
    color: var(--route);
}

.inspector {
    position: sticky;
    top: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.mini-map {
    height: 240px;
    background: var(--ink);
}

.map-grid {
    position: relative;
    height: 100%;
    background:
        linear-gradient(rgba(244, 241, 222, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(244, 241, 222, 0.07) 1px, transparent 1px),
        radial-gradient(circle at 18% 30%, rgba(224, 122, 95, 0.23), transparent 26%),
        var(--ink);
    background-size: 34px 34px, 34px 34px, auto, auto;
}

.map-dot {
    position: absolute;
    width: 17px;
    height: 17px;
    border: 2px solid var(--paper);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 5px rgba(244, 241, 222, 0.12);
}

.map-dot.is-current {
    width: 25px;
    height: 25px;
    box-shadow: 0 0 0 8px rgba(224, 122, 95, 0.26);
}

.map-zone {
    position: absolute;
    color: rgba(244, 241, 222, 0.68);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.zone-a {
    left: 18px;
    top: 18px;
}

.zone-b {
    right: 18px;
    top: 44%;
}

.zone-c {
    left: 42%;
    bottom: 18px;
}

.inspector-body {
    padding: 20px;
}

.inspector-title h2 {
    margin: 12px 0 5px;
    font-size: 2.6rem;
    line-height: 0.95;
}

.inspector-title p {
    margin-bottom: 18px;
    color: var(--muted);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 0 18px;
}

.detail-grid div {
    min-width: 0;
}

.detail-grid dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 800;
}

.detail-grid dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.progress-line,
.load-bar {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(32, 44, 57, 0.12);
}

.progress-line span,
.load-bar span {
    display: block;
    height: 100%;
    background: var(--clay);
}

.checklist {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.check {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
}

.check > span {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 2px solid rgba(32, 44, 57, 0.28);
    border-radius: 50%;
}

.check.is-done > span {
    background: var(--mint);
    border-color: var(--mint);
}

.check p,
.action-item p {
    margin: 0;
}

.check small {
    display: block;
    margin-top: 2px;
}

.action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 10px;
}

.primary-command,
.ghost-command,
.icon-command {
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid var(--ink);
}

.primary-command {
    background: var(--ink);
    color: var(--paper);
}

.ghost-command,
.icon-command {
    background: transparent;
    color: var(--ink);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.icon-command {
    width: 44px;
    font-size: 1.2rem;
}

.action-stream,
.workflow-grid,
.team-board {
    display: grid;
    gap: 10px;
}

.action-item,
.workflow-step,
.team-member {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    padding: 16px;
}

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

.action-item time {
    color: var(--route);
    font-size: 0.86rem;
    font-weight: 800;
}

.workflow-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workflow-step {
    min-height: 210px;
}

.workflow-step span {
    color: var(--clay);
    font-weight: 900;
}

.workflow-step h3 {
    margin: 18px 0 10px;
    font-size: 1.6rem;
}

.team-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-member {
    display: grid;
    gap: 12px;
}

.team-member strong,
.team-member span {
    display: block;
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 18px;
    color: var(--muted);
    background: rgba(255, 253, 247, 0.68);
}

.status-blocked {
    background: #b54831;
}

.status-at-risk {
    background: var(--clay);
}

.status-in-progress {
    background: var(--route);
}

.status-ready {
    background: var(--mint);
}

.status-pill.status-blocked,
.status-pill.status-at-risk {
    background: rgba(224, 122, 95, 0.18);
    color: #9a3f29;
}

.status-pill.status-in-progress {
    background: rgba(61, 90, 128, 0.14);
    color: var(--route);
}

.status-pill.status-ready {
    background: rgba(129, 178, 154, 0.2);
    color: #2f7652;
}

@keyframes enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .rail {
        position: static;
        height: auto;
    }

    .screen-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .nav-button {
        text-align: center;
    }

    .rail-note {
        display: none;
    }

    .dispatch-layout,
    .workflow-grid,
    .team-board {
        grid-template-columns: 1fr;
    }

    .inspector {
        position: static;
    }
}

@media (max-width: 720px) {
    .workspace {
        padding: 18px;
    }

    .topline,
    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .metrics-grid,
    .timeline,
    .toolbar,
    .screen-nav {
        grid-template-columns: 1fr 1fr;
    }

    .metric:nth-child(2) {
        border-right: 0;
    }

    .metric {
        border-bottom: 1px solid var(--line);
    }

    .sample-row,
    .action-item {
        grid-template-columns: 1fr;
    }

    .sample-meta {
        text-align: left;
    }

    .action-row,
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 460px) {
    .metrics-grid,
    .timeline,
    .toolbar,
    .screen-nav {
        grid-template-columns: 1fr;
    }
}

