:root {
    --ink: #17202f;
    --navy: #1d3557;
    --paper: #fff8f0;
    --surface: #ffffff;
    --line: #d9d1c6;
    --muted: #6e7480;
    --teal: #2a9d8f;
    --coral: #e76f51;
    --violet: #7d5fff;
    --shadow: 0 18px 48px rgba(29, 53, 87, 0.11);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--paper);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        linear-gradient(90deg, rgba(29, 53, 87, 0.05) 1px, transparent 1px),
        linear-gradient(180deg, rgba(29, 53, 87, 0.04) 1px, transparent 1px),
        var(--paper);
    background-size: 48px 48px;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

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

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

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

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

.brand-lockup small,
.rail-note span,
.eyebrow,
.metric span,
.section-title span,
.case-row small,
.workflow-row small,
.team-row small {
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    letter-spacing: 0;
    text-transform: uppercase;
}

.brand-lockup small {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 11px;
}

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

.tab {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.78);
    background: transparent;
    text-align: left;
    padding: 0 12px;
}

.tab.is-active {
    color: #0d2a3f;
    background: var(--paper);
    border-color: var(--paper);
}

.rail-note {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.rail-note span {
    display: block;
    color: rgba(255, 255, 255, 0.58);
    font-size: 10px;
}

.rail-note strong {
    display: block;
    margin-top: 6px;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.workspace {
    min-width: 0;
    padding: 28px;
}

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

.eyebrow {
    margin: 0 0 8px;
    color: var(--teal);
    font-size: 12px;
}

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

h1 {
    margin-bottom: 0;
    max-width: 820px;
    font-size: clamp(30px, 4vw, 58px);
    line-height: 0.96;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 0;
    font-size: 20px;
}

.status-chip,
.priority,
.resource-chip,
.owner-chip,
.deadline-chip,
.action-type,
.workflow-mode,
.focus-stage {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border-radius: 7px;
    white-space: nowrap;
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
}

.status-chip {
    padding: 0 12px;
    color: var(--navy);
    background: #dceeea;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 1px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: var(--line);
}

.metric {
    min-height: 88px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.76);
}

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

.metric strong {
    display: block;
    margin-top: 10px;
    color: var(--navy);
    font-size: 28px;
}

.screen {
    display: none;
}

.screen.is-visible {
    display: block;
    animation: lift 180ms ease-out;
}

.dispatch-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.lane-board,
.case-inspector,
.action-stream,
.workflow-editor,
.team-grid {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow);
}

.lane-board,
.case-inspector {
    min-height: 560px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: baseline;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.section-title span {
    color: var(--muted);
    font-size: 11px;
    text-align: right;
}

.timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 1px;
    padding: 0;
    background: var(--line);
    border-bottom: 1px solid var(--line);
}

.lane {
    position: relative;
    min-height: 128px;
    padding: 16px;
    border: 0;
    color: var(--ink);
    background: #fffdf9;
    text-align: left;
    overflow: hidden;
}

.lane::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 18px;
    height: 3px;
    background: linear-gradient(90deg, var(--navy), var(--teal), var(--coral));
}

.lane-index {
    display: block;
    margin-bottom: 22px;
    color: var(--muted);
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
}

.lane strong,
.lane small {
    display: block;
}

.lane small {
    margin-top: 6px;
    color: var(--muted);
}

.overlay {
    position: absolute;
    right: 10px;
    top: 10px;
    padding: 4px 7px;
    border: 1px solid rgba(231, 111, 81, 0.35);
    border-radius: 6px;
    color: #9a351e;
    background: rgba(231, 111, 81, 0.1);
    font-size: 11px;
}

.item-list {
    display: grid;
}

.case-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) 82px minmax(120px, 0.8fr) 104px 78px;
    gap: 12px;
    align-items: center;
    min-height: 78px;
    padding: 12px 18px;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    background: transparent;
    text-align: left;
    transition: background 160ms ease, transform 160ms ease;
}

.case-row:hover,
.case-row.is-selected {
    background: #fff8f0;
}

.case-row.is-selected {
    transform: translateX(4px);
    box-shadow: inset 4px 0 0 var(--teal);
}

.case-main {
    min-width: 0;
}

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

.case-main small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
}

.resource-chip {
    color: var(--navy);
    background:
        linear-gradient(90deg, rgba(42, 157, 143, 0.22) calc(var(--value) * 1%), transparent 0),
        #f4f1ea;
}

.owner-chip,
.deadline-chip {
    padding: 0 8px;
    color: var(--muted);
    background: #f4f1ea;
}

.priority {
    padding: 0 8px;
    color: var(--navy);
    background: #eef4f5;
}

.priority-urgent {
    color: #9a351e;
    background: rgba(231, 111, 81, 0.15);
}

.priority-high {
    color: #12695e;
    background: rgba(42, 157, 143, 0.15);
}

.case-inspector {
    position: sticky;
    top: 28px;
    padding: 18px;
}

.inspector-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--navy);
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

.lane-visual {
    position: relative;
    height: 236px;
    margin: 22px 0;
    background:
        linear-gradient(90deg, rgba(29, 53, 87, 0.09) 1px, transparent 1px),
        linear-gradient(180deg, rgba(29, 53, 87, 0.08) 1px, transparent 1px),
        #fffdf9;
    background-size: 34px 34px;
    border: 1px solid var(--line);
    overflow: hidden;
}

.lane-line {
    position: absolute;
    left: 34px;
    right: 34px;
    top: 118px;
    height: 3px;
    background: var(--navy);
}

.lane-dot {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 8px rgba(42, 157, 143, 0.14);
}

.dot-a {
    left: 42px;
    top: 109px;
}

.dot-b {
    left: 48%;
    top: 109px;
    background: var(--coral);
    box-shadow: 0 0 0 8px rgba(231, 111, 81, 0.13);
}

.dot-c {
    right: 42px;
    top: 109px;
}

.conflict-band {
    position: absolute;
    left: 44%;
    top: 0;
    bottom: 0;
    width: 52px;
    background: repeating-linear-gradient(45deg, rgba(231, 111, 81, 0.16), rgba(231, 111, 81, 0.16) 8px, transparent 8px, transparent 16px);
}

.mobile-task span,
.mobile-task p {
    color: var(--muted);
}

.mobile-task h3 {
    margin-bottom: 10px;
    font-size: 24px;
    line-height: 1.05;
}

.mobile-task p {
    margin-bottom: 0;
    line-height: 1.5;
}

.quick-action {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.quick-action label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
    text-transform: uppercase;
}

.quick-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 94px;
    gap: 8px;
}

.quick-row input,
.quick-row button {
    min-height: 42px;
    border-radius: 7px;
}

.quick-row input {
    min-width: 0;
    border: 1px solid var(--line);
    padding: 0 12px;
    background: #fffdf9;
}

.quick-row button {
    border: 0;
    color: #fff;
    background: var(--navy);
}

.action-stream,
.workflow-editor,
.team-grid {
    display: grid;
}

.action-row,
.workflow-row,
.team-row {
    display: grid;
    gap: 14px;
    align-items: center;
    min-height: 72px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
}

.action-row {
    grid-template-columns: 120px 84px minmax(0, 1fr);
}

.action-time {
    color: var(--muted);
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
}

.action-type {
    color: var(--navy);
    background: #eef4f5;
}

.action-row p {
    margin: 5px 0 0;
    color: var(--muted);
}

.workflow-row {
    grid-template-columns: 18px minmax(170px, 1fr) 90px 110px 90px;
}

.stage-mark {
    width: 12px;
    height: 42px;
    border-radius: 8px;
    background: var(--accent);
}

.workflow-sla,
.workflow-owner {
    color: var(--muted);
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

.workflow-mode,
.focus-stage {
    padding: 0 8px;
    color: var(--navy);
    background: #f4f1ea;
}

.team-row {
    grid-template-columns: 44px minmax(180px, 1fr) 120px minmax(120px, 260px) 48px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    background: var(--navy);
    font-weight: 700;
}

.team-row strong,
.team-row small,
.workflow-row strong,
.workflow-row small {
    display: block;
}

.team-row small,
.workflow-row small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.load-bar {
    display: block;
    height: 9px;
    border-radius: 999px;
    background: #eee6db;
    overflow: hidden;
}

.load-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--teal), var(--coral));
}

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

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

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

    .case-inspector {
        position: static;
        min-height: 0;
    }
}

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

    .side-rail {
        position: static;
        height: auto;
        padding: 14px;
    }

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

    .tab {
        text-align: center;
        padding: 0 6px;
    }

    .rail-note {
        display: none;
    }

    .workspace {
        padding: 16px;
    }

    .topbar,
    .section-title {
        display: grid;
    }

    .section-title span {
        text-align: left;
    }

    .metrics-row,
    .timeline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .case-row {
        grid-template-columns: 1fr 72px;
    }

    .owner-chip,
    .deadline-chip,
    .priority {
        justify-content: flex-start;
    }

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

    .stage-mark {
        width: 100%;
        height: 6px;
    }
}

@media (max-width: 520px) {
    h1 {
        font-size: 34px;
    }

    .metrics-row,
    .timeline,
    .screen-tabs {
        grid-template-columns: 1fr;
    }

    .quick-row {
        grid-template-columns: 1fr;
    }
}

