:root {
    --ink: #2d3142;
    --paper: #f7fff7;
    --accent: #ff9f1c;
    --mint: #2ec4b6;
    --line: rgba(45, 49, 66, 0.18);
    --muted: #6a7183;
    --danger: #a62929;
    --ok: #1d7c69;
    --shadow: 0 18px 50px rgba(45, 49, 66, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

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

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(46, 196, 182, 0.11) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, rgba(255, 159, 28, 0.11) 0 1px, transparent 1px 100%),
        var(--paper);
    background-size: 42px 42px;
}

.command-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto minmax(250px, 1fr);
    gap: 18px;
    align-items: center;
    padding: 12px clamp(16px, 3vw, 34px);
    background: rgba(247, 255, 247, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
}

.brand span {
    display: grid;
}

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

.brand strong {
    font-size: 1.25rem;
    line-height: 1;
}

.brand small,
.kicker,
.stream-title span {
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.screen-tabs {
    display: inline-flex;
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(45, 49, 66, 0.07);
}

.tab,
.icon-button {
    border: 0;
    background: transparent;
    color: var(--ink);
}

.tab {
    padding: 10px 13px;
    min-height: 42px;
}

.tab.is-active {
    background: var(--ink);
    color: var(--paper);
}

.command-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.search-box {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr);
    gap: 8px;
    align-items: center;
    width: min(360px, 100%);
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid var(--line);
}

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

.search-box input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    background: #ffffff;
    font-size: 1.1rem;
}

main {
    padding: 24px clamp(14px, 3vw, 34px) 34px;
}

.screen {
    display: none;
}

.screen.is-active {
    display: block;
    animation: reveal 180ms ease-out;
}

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

.kicker {
    margin: 0 0 6px;
    font-weight: 800;
    color: var(--ok);
}

h1 {
    margin: 0;
    max-width: 900px;
    font-size: clamp(2rem, 4vw, 4.7rem);
    line-height: 0.94;
}

h2 {
    margin: 0;
    font-size: 0.92rem;
}

.status-chip,
.finance-total {
    flex: none;
    padding: 11px 13px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 800;
}

.finance-total {
    min-width: 104px;
    text-align: center;
    background: var(--accent);
    color: var(--ink);
    font-size: 1.4rem;
}

.metrics-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.76);
    margin-bottom: 18px;
}

.metrics-strip div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 14px;
    border-right: 1px solid var(--line);
}

.metrics-strip div:last-child {
    border-right: 0;
}

.metrics-strip span {
    font-size: clamp(1.55rem, 4vw, 2.35rem);
    font-weight: 900;
}

.metrics-strip small,
.item-meta,
.table-status {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.board {
    display: grid;
    grid-template-columns: repeat(4, minmax(230px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.board-column {
    min-height: 470px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
}

.column-head {
    position: sticky;
    top: 67px;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 12px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.column-head span {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    background: var(--mint);
    color: #062e2b;
    font-weight: 900;
}

.lane {
    display: grid;
    gap: 10px;
    padding: 10px;
}

.work-item {
    display: grid;
    gap: 10px;
    padding: 13px;
    background: #ffffff;
    border-left: 6px solid var(--mint);
    box-shadow: var(--shadow);
}

.work-item.status-risk {
    border-left-color: var(--accent);
}

.work-item.status-published {
    border-left-color: var(--ok);
}

.item-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.item-top strong {
    min-width: 0;
    font-size: 1rem;
    line-height: 1.18;
}

.item-top span {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 38px;
    height: 38px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 900;
}

.work-item p {
    margin: 0;
    color: #394052;
    line-height: 1.4;
}

.item-meta,
.item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.item-meta span {
    padding: 5px 7px;
    background: rgba(46, 196, 182, 0.12);
}

.item-actions button,
.primary-button {
    min-height: 38px;
    border: 1px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
    font-weight: 800;
}

.item-actions button {
    padding: 7px 9px;
}

.item-actions button:last-child,
.primary-button {
    background: var(--ink);
    color: var(--paper);
}

.event-stream {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    align-items: start;
    padding: 14px 0 0;
    border-top: 2px solid var(--ink);
}

.event-stream ol {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
}

.event-stream li {
    display: grid;
    gap: 8px;
    min-height: 104px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid var(--line);
}

.event-stream time,
.event-stream small {
    color: var(--muted);
    font-size: 0.76rem;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(280px, 680px) minmax(240px, 1fr);
    gap: 26px;
    align-items: start;
}

.intake-form,
.rules-panel {
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.intake-form {
    display: grid;
    gap: 14px;
    padding: clamp(18px, 4vw, 34px);
}

.intake-form label {
    display: grid;
    gap: 7px;
    font-weight: 800;
}

.intake-form input,
.intake-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    padding: 11px;
    outline-color: var(--mint);
}

.primary-button {
    justify-self: start;
    padding: 0 16px;
}

.rules-panel {
    padding: 22px;
    border-top: 8px solid var(--accent);
}

.rules-panel p,
.rules-panel li {
    color: #394052;
    line-height: 1.48;
}

.rules-panel ul {
    margin: 16px 0 0;
    padding-left: 18px;
}

.table-wrap {
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--ink);
    color: var(--paper);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.table-status {
    display: inline-block;
    padding: 4px 7px;
    background: rgba(255, 159, 28, 0.18);
    color: var(--ink);
}

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

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

    .command-actions {
        justify-content: stretch;
    }

    .screen-tabs {
        overflow-x: auto;
    }

    .tab {
        white-space: nowrap;
    }

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

    .metrics-strip div:nth-child(2) {
        border-right: 0;
    }

    .metrics-strip div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }

    .split-layout,
    .event-stream {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    main {
        padding-inline: 10px;
    }

    .workspace-head {
        display: grid;
    }

    h1 {
        font-size: 2rem;
        line-height: 1;
    }

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

    .metrics-strip div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .metrics-strip div:last-child {
        border-bottom: 0;
    }

    .board {
        grid-template-columns: minmax(260px, 86vw) minmax(260px, 86vw) minmax(260px, 86vw) minmax(260px, 86vw);
    }
}

