:root {
    --ink: #17243a;
    --navy: #1d3557;
    --paper: #fff8f0;
    --paper-2: #f7efe5;
    --mint: #2a9d8f;
    --coral: #e76f51;
    --line: rgba(29, 53, 87, 0.16);
    --muted: #6f7580;
    --shadow: 0 20px 60px rgba(29, 53, 87, 0.11);
}

* {
    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;
}

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

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    background: var(--navy);
    color: var(--paper);
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.brand {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.brand img {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

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

.brand strong {
    font-size: 18px;
    letter-spacing: 0;
}

.brand small,
.label,
.eyebrow,
.nav-tabs button,
.lane-head span,
.plan-meta,
.detail-list dt,
.history-row time,
.workflow-stage small {
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

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

.nav-tabs {
    display: grid;
    gap: 6px;
}

.nav-tabs button {
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 11px 12px;
    background: transparent;
    color: rgba(255, 248, 240, 0.72);
    text-align: left;
    font-size: 13px;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-tabs button:hover,
.nav-tabs button.active {
    background: rgba(255, 248, 240, 0.12);
    color: var(--paper);
    transform: translateX(2px);
}

.side-note {
    margin-top: auto;
    border-top: 1px solid rgba(255, 248, 240, 0.18);
    padding-top: 18px;
}

.label,
.eyebrow {
    display: block;
    color: var(--mint);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.side-note strong {
    display: block;
    margin-top: 8px;
    line-height: 1.35;
}

.side-note p {
    margin: 10px 0 0;
    color: rgba(255, 248, 240, 0.7);
    font-size: 13px;
    line-height: 1.5;
}

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

.topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
    gap: 20px;
    align-items: end;
    margin-bottom: 18px;
}

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

h1 {
    margin-bottom: 0;
    max-width: 760px;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.02;
    letter-spacing: 0;
}

.search {
    display: grid;
    gap: 6px;
}

.search label {
    color: var(--muted);
    font-size: 12px;
}

.search input,
.action-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
    color: var(--ink);
    outline: none;
}

.search input {
    min-height: 42px;
    padding: 0 12px;
}

.search input:focus,
.action-form textarea:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.14);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
    box-shadow: var(--shadow);
}

.metrics div {
    min-width: 0;
    padding: 14px 16px;
    background: #fffdf8;
}

.metrics span {
    display: block;
    min-height: 32px;
    color: var(--muted);
    font-size: 12px;
}

.metrics strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    line-height: 1;
}

.view {
    display: none;
    animation: liftIn 220ms ease both;
}

.view.active {
    display: block;
}

.queue-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.lane-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lane-legend span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 10px;
    background: #fffdf8;
    font-size: 12px;
}

.ghost-button,
.action-form button {
    border: 0;
    border-radius: 8px;
    min-height: 40px;
    padding: 0 14px;
    background: var(--navy);
    color: var(--paper);
    transition: transform 160ms ease, opacity 160ms ease;
}

.ghost-button {
    background: #fffdf8;
    color: var(--navy);
    border: 1px solid var(--line);
}

.ghost-button:hover,
.action-form button:hover {
    transform: translateY(-1px);
}

.calendar-lanes {
    display: grid;
    grid-template-columns: repeat(4, minmax(210px, 1fr));
    gap: 12px;
    align-items: start;
}

.lane {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.76);
    overflow: hidden;
}

.lane-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: #fffdf8;
}

.lane-head strong,
.lane-head span {
    display: block;
}

.lane-head span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.lane-head b {
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--paper-2);
    color: var(--navy);
}

.lane-body {
    display: grid;
    gap: 8px;
    min-height: 360px;
    padding: 10px;
}

.plan-row {
    position: relative;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px;
    background: #fffdf8;
    color: var(--ink);
    text-align: left;
    box-shadow: 0 8px 22px rgba(29, 53, 87, 0.07);
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.plan-row:hover,
.plan-row.selected {
    border-color: rgba(42, 157, 143, 0.65);
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(29, 53, 87, 0.13);
}

.plan-row.has-conflict {
    border-color: rgba(231, 111, 81, 0.58);
}

.plan-row.has-conflict:after {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--coral);
}

.resource-chip {
    grid-row: span 2;
    display: grid;
    place-items: center;
    min-height: 48px;
    border-radius: 7px;
    background: rgba(42, 157, 143, 0.12);
    color: var(--mint);
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    font-weight: 700;
}

.plan-main,
.plan-main strong,
.plan-main small,
.plan-meta,
.plan-meta b,
.plan-meta small {
    display: block;
    min-width: 0;
}

.plan-main strong,
.plan-main small,
.plan-meta b,
.plan-meta small {
    overflow-wrap: anywhere;
}

.plan-main small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.plan-meta {
    grid-column: 2;
    color: var(--muted);
    font-size: 11px;
}

.plan-meta b {
    color: var(--navy);
}

.empty-lane {
    margin: 10px;
    color: var(--muted);
    font-size: 13px;
}

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

.section-head h2 {
    margin-bottom: 0;
    font-size: 24px;
}

.section-head p {
    max-width: 440px;
    margin-bottom: 0;
    color: var(--muted);
}

.history-list,
.workflow-grid {
    display: grid;
    gap: 1px;
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--line);
}

.history-row,
.workflow-stage {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 100px;
    gap: 16px;
    align-items: start;
    padding: 14px 16px;
    background: #fffdf8;
}

.history-row time,
.history-row b,
.workflow-stage small {
    color: var(--muted);
    font-size: 12px;
}

.history-row span,
.history-row p {
    display: block;
    margin: 4px 0 0;
    color: var(--muted);
}

.history-row p {
    color: var(--ink);
    line-height: 1.45;
}

.workflow-stage {
    grid-template-columns: 18px minmax(0, 1fr) 100px 240px;
    align-items: center;
}

.stage-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 6px rgba(42, 157, 143, 0.12);
}

.workflow-stage h3,
.workflow-stage p {
    margin: 0;
}

.workflow-stage p {
    margin-top: 4px;
    color: var(--muted);
}

.team-table-wrap {
    margin-top: 16px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
}

.team-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.team-table th,
.team-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

.team-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.person-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border-radius: 50%;
    vertical-align: middle;
}

.capacity {
    display: inline-block;
    width: 86px;
    height: 8px;
    margin-right: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--paper-2);
    vertical-align: middle;
}

.capacity i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--mint);
}

.inspector {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-left: 1px solid var(--line);
    background: #fffdf8;
    padding: 24px;
}

.empty-inspector,
.inspector-head {
    padding-top: 8px;
}

.empty-inspector p,
.inspector-head p {
    color: var(--muted);
    line-height: 1.5;
}

.inspector h2 {
    margin: 8px 0 6px;
    font-size: 28px;
    line-height: 1.08;
}

.detail-list {
    display: grid;
    grid-template-columns: minmax(110px, 0.75fr) minmax(0, 1.25fr);
    gap: 10px 14px;
    margin: 22px 0;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.detail-list dt {
    color: var(--muted);
    font-size: 11px;
}

.detail-list dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.conflict-box {
    border: 1px solid rgba(42, 157, 143, 0.35);
    border-radius: 8px;
    padding: 14px;
    background: rgba(42, 157, 143, 0.08);
}

.conflict-box.active {
    border-color: rgba(231, 111, 81, 0.5);
    background: rgba(231, 111, 81, 0.09);
}

.conflict-box p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.48;
}

.action-form {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.action-form label {
    color: var(--muted);
    font-size: 12px;
}

.action-form textarea {
    min-height: 108px;
    resize: vertical;
    padding: 12px;
}

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

.loading body {
    cursor: progress;
}

@keyframes liftIn {
    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);
    }

    .inspector {
        position: static;
        grid-column: 1 / -1;
        height: auto;
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}

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

    .sidebar {
        position: static;
        height: auto;
        padding: 16px;
    }

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

    .nav-tabs button {
        text-align: center;
        padding-inline: 6px;
        font-size: 12px;
    }

    .side-note {
        display: none;
    }

    .workspace {
        padding: 16px;
    }

    .topbar,
    .metrics {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 30px;
    }

    .calendar-lanes {
        grid-template-columns: 1fr;
    }

    .lane-body {
        min-height: 120px;
    }

    .section-head,
    .queue-toolbar {
        display: grid;
        align-items: start;
    }

    .history-row,
    .workflow-stage {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 520px) {
    .brand {
        grid-template-columns: 38px 1fr;
    }

    .brand img {
        width: 38px;
        height: 38px;
    }

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

    .metrics strong {
        font-size: 24px;
    }

    .plan-row {
        grid-template-columns: 50px minmax(0, 1fr);
    }

    .detail-list {
        grid-template-columns: 1fr;
    }
}

