:root {
    --ink: #22333b;
    --paper: #f2f4f3;
    --accent: #e63946;
    --mint: #a8dadc;
    --line: rgba(34, 51, 59, 0.14);
    --muted: rgba(34, 51, 59, 0.62);
    --white: #ffffff;
    --shadow: 0 22px 60px rgba(34, 51, 59, 0.12);
}

* {
    box-sizing: border-box;
}

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

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

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

.metric-spine {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 28px;
    color: var(--paper);
    background: var(--ink);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--paper);
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
}

.brand img {
    flex: 0 0 auto;
}

.metric-lead h1 {
    margin: 6px 0 12px;
    max-width: 320px;
    font-size: clamp(30px, 4.6vw, 56px);
    line-height: 0.95;
    letter-spacing: 0;
}

.metric-lead p {
    margin: 0;
    max-width: 280px;
    color: rgba(242, 244, 243, 0.72);
    line-height: 1.45;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.metric-stack {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(242, 244, 243, 0.16);
    border-radius: 8px;
    background: rgba(242, 244, 243, 0.16);
}

.metric {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    background: rgba(242, 244, 243, 0.06);
}

.metric span {
    color: rgba(242, 244, 243, 0.68);
    font-size: 13px;
}

.metric strong {
    color: var(--mint);
    font-size: 30px;
    line-height: 1;
}

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

.tab {
    width: 100%;
    padding: 12px 14px;
    color: rgba(242, 244, 243, 0.72);
    text-align: left;
    border-radius: 8px;
    background: transparent;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.tab:hover,
.tab.is-active {
    color: var(--paper);
    background: rgba(168, 218, 220, 0.14);
    transform: translateX(2px);
}

.workspace {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 26px;
}

.topbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.topbar h2 {
    margin: 6px 0 0;
    font-size: clamp(22px, 3vw, 38px);
    line-height: 1.05;
    letter-spacing: 0;
}

.search-box {
    display: grid;
    gap: 7px;
    width: min(360px, 100%);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

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

.search-box input:focus,
.quick-create input:focus,
.quick-create select:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 3px rgba(168, 218, 220, 0.42);
}

.screen {
    display: none;
    min-width: 0;
    padding-top: 22px;
}

.screen.is-visible {
    display: block;
    animation: rise 240ms ease both;
}

.quick-create {
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.68);
}

.quick-create form {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.8fr) minmax(140px, 0.55fr) auto;
    gap: 12px;
    align-items: end;
}

.quick-create label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.quick-create button,
.work-card button {
    min-height: 42px;
    padding: 0 16px;
    color: var(--paper);
    border-radius: 8px;
    background: var(--accent);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.quick-create button:hover,
.work-card button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(230, 57, 70, 0.22);
}

#formStatus {
    margin: 10px 0 0;
    min-height: 18px;
    color: var(--muted);
    font-size: 13px;
}

.kanban {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 14px;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 8px;
}

.stage-column {
    min-width: 220px;
    border-left: 1px solid var(--line);
    padding-left: 14px;
}

.stage-column header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.stage-column h3 {
    margin: 0;
    font-size: 14px;
    text-transform: uppercase;
}

.stage-column header span {
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    color: var(--ink);
    border-radius: 999px;
    background: var(--mint);
    font-size: 12px;
    font-weight: 900;
}

.stage-list {
    display: grid;
    gap: 12px;
}

.work-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 8px 26px rgba(34, 51, 59, 0.07);
    transition: transform 160ms ease, border-color 160ms ease;
}

.work-card:hover {
    transform: translateY(-2px);
    border-color: rgba(230, 57, 70, 0.42);
}

.card-line,
.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
}

.priority {
    color: var(--accent);
    font-weight: 900;
    text-transform: uppercase;
}

.priority-low .priority {
    color: #457b9d;
}

.priority-high {
    border-color: rgba(230, 57, 70, 0.5);
}

.work-card h3 {
    margin: 14px 0 8px;
    font-size: 17px;
    line-height: 1.18;
}

.work-card p {
    min-height: 38px;
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.progress {
    height: 6px;
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(34, 51, 59, 0.1);
}

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

.work-card button {
    min-height: 32px;
    padding: 0 12px;
    font-size: 12px;
}

.empty {
    margin: 0;
    padding: 18px 0;
    color: var(--muted);
    font-size: 13px;
}

.timeline,
.workflow-grid,
.team-grid {
    display: grid;
    gap: 12px;
    max-width: 980px;
}

.timeline-row,
.workflow-row,
.team-card {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 18px;
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.timeline-row time {
    color: var(--muted);
    font-size: 12px;
}

.timeline-row strong,
.workflow-row h3,
.team-card h3 {
    display: block;
    margin: 0 0 5px;
    font-size: 17px;
}

.timeline-row p,
.workflow-row p,
.team-card p {
    margin: 0 0 6px;
    color: var(--ink);
    line-height: 1.42;
}

.timeline-row span,
.team-card span {
    color: var(--muted);
    font-size: 13px;
}

.workflow-row {
    grid-template-columns: 18px 1fr 90px;
    align-items: center;
}

.workflow-row strong {
    text-align: right;
}

.stage-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

.team-card {
    grid-template-columns: 48px 1fr;
}

.avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--ink);
    border-radius: 50%;
    background: var(--mint);
    font-weight: 900;
}

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

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

    .metric-spine {
        min-height: auto;
    }

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

    .tab {
        text-align: center;
    }

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

@media (max-width: 680px) {
    .metric-spine,
    .workspace {
        padding: 18px;
    }

    .topbar {
        display: grid;
        align-items: start;
    }

    .screen-tabs,
    .quick-create form {
        grid-template-columns: 1fr;
    }

    .kanban {
        grid-template-columns: repeat(4, minmax(240px, 82vw));
    }

    .timeline-row,
    .workflow-row,
    .team-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .workflow-row strong {
        text-align: left;
    }
}

