:root {
    --ink: #2d3142;
    --paper: #f7fff7;
    --amber: #ff9f1c;
    --teal: #2ec4b6;
    --line: rgba(45, 49, 66, 0.18);
    --muted: #667085;
    --danger: #bd2d3a;
    --ok: #1d7f62;
    --shadow: 0 18px 48px rgba(20, 24, 36, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    min-width: 320px;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background:
        linear-gradient(90deg, rgba(45, 49, 66, 0.035) 1px, transparent 1px),
        linear-gradient(180deg, rgba(45, 49, 66, 0.035) 1px, transparent 1px),
        var(--paper);
    background-size: 32px 32px;
}

.command-bar {
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(190px, 260px) auto minmax(220px, 320px) minmax(88px, 120px);
    align-items: center;
    gap: 18px;
    padding: 12px 22px;
    border-bottom: 3px solid var(--ink);
    background: rgba(247, 255, 247, 0.94);
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.brand img {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
}

.brand strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 0.95;
}

.brand small,
.clock small,
.search label,
.eyebrow,
.section-line span {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.screen-tabs {
    display: flex;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.tab {
    min-height: 38px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    padding: 7px 12px;
    white-space: nowrap;
}

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

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

.search input,
.request-form input,
.request-form select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    padding: 8px 10px;
    outline: none;
}

.search input:focus,
.request-form input:focus,
.request-form select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.18);
}

.clock {
    justify-self: end;
    text-align: right;
}

.clock span {
    display: block;
    font-weight: 800;
    font-size: 20px;
}

main {
    padding: 24px;
    min-width: 0;
}

.screen {
    display: none;
}

.screen.is-active {
    display: block;
    animation: riseIn 220ms ease-out both;
}

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

.workspace-head.compact {
    align-items: start;
    max-width: 940px;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(30px, 4.6vw, 56px);
    line-height: 0.98;
    max-width: 860px;
}

h2 {
    font-size: 16px;
}

.eyebrow {
    margin-bottom: 7px;
    color: var(--teal);
    font-weight: 800;
}

.primary-action {
    min-height: 42px;
    border: 0;
    background: var(--amber);
    color: #1e2433;
    font-weight: 800;
    padding: 10px 16px;
    box-shadow: inset 0 -3px 0 rgba(45, 49, 66, 0.18);
}

.primary-action.wide {
    grid-column: 1 / -1;
    width: 100%;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 3px solid var(--ink);
    background: #ffffff;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

.metric {
    min-height: 108px;
    padding: 16px;
    display: grid;
    align-content: space-between;
    border-right: 1px solid var(--line);
    position: relative;
}

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

.metric strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1;
}

.metric small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.metric::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--teal);
}

.tone-amber::after {
    background: var(--amber);
}

.tone-red::after {
    background: var(--danger);
}

.tone-green::after {
    background: var(--ok);
}

.board-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 420px);
    gap: 18px;
    align-items: start;
}

.pipeline,
.stock-panel,
.request-form,
.dense-table,
.finance-grid,
.form-result {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    box-shadow: 0 10px 26px rgba(20, 24, 36, 0.07);
    min-width: 0;
}

.section-line {
    min-height: 52px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.lanes {
    display: flex;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.lane {
    flex: 1 0 170px;
    min-height: 420px;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(247, 255, 247, 0.75), rgba(255, 255, 255, 0.72));
}

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

.lane header {
    min-height: 46px;
    padding: 11px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(45, 49, 66, 0.06);
    border-bottom: 1px solid var(--line);
    font-weight: 800;
}

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

.order-row {
    display: grid;
    gap: 9px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.order-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(20, 24, 36, 0.12);
    position: relative;
    z-index: 1;
}

.order-row div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.order-row span,
.order-row em,
.asset-main span,
.asset-count small {
    color: var(--muted);
    font-style: normal;
    overflow-wrap: anywhere;
}

.order-row mark,
.table-row mark {
    background: rgba(46, 196, 182, 0.18);
    color: var(--ink);
    padding: 3px 7px;
}

.priority-urgent {
    border-left: 5px solid var(--danger);
}

.priority-urgent mark {
    background: rgba(189, 45, 58, 0.14);
}

.order-row button,
.asset-row button {
    min-height: 34px;
    border: 1px solid var(--ink);
    background: transparent;
    color: var(--ink);
    font-weight: 800;
}

.order-row button:disabled {
    opacity: 0.45;
    cursor: default;
}

.empty-lane {
    padding: 14px;
    color: var(--muted);
}

.asset-list {
    max-height: 590px;
    overflow: auto;
}

.asset-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(78px, auto) 44px;
    gap: 12px;
    align-items: center;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
}

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

.asset-main b,
.asset-main span {
    display: block;
}

.asset-count {
    text-align: right;
}

.asset-count strong {
    font-size: 22px;
}

.status-watch {
    background: rgba(255, 159, 28, 0.14);
}

.request-form {
    max-width: 940px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
}

.request-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.form-result {
    max-width: 940px;
    margin-top: 12px;
    padding: 14px 18px;
    color: var(--muted);
}

.dense-table {
    max-width: 1080px;
    overflow-x: auto;
}

.table-head,
.table-row {
    display: grid;
    grid-template-columns: 150px minmax(260px, 1fr) 130px 160px;
    gap: 14px;
    align-items: center;
    min-width: 700px;
    padding: 13px 16px;
}

.table-head {
    background: var(--ink);
    color: var(--paper);
    font-weight: 800;
}

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

.finance-grid {
    max-width: 980px;
    display: grid;
}

.finance-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 140px minmax(150px, 240px) 100px;
    gap: 16px;
    align-items: center;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
}

.finance-row div {
    display: grid;
    gap: 3px;
}

.finance-row span,
.finance-row small {
    color: var(--muted);
}

meter {
    width: 100%;
    height: 14px;
}

.event-stream {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
    padding: 12px 22px;
    border-top: 3px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
}

.stream-title {
    display: grid;
    align-content: center;
    gap: 4px;
}

.stream-title span {
    color: var(--teal);
    font-size: 12px;
    text-transform: uppercase;
}

.events {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.event {
    min-width: 260px;
    max-width: 360px;
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    background: rgba(247, 255, 247, 0.08);
    border-left: 4px solid var(--teal);
}

.event.is-warning {
    border-left-color: var(--amber);
}

.event.is-critical,
.event.is-red {
    border-left-color: var(--danger);
}

.event.is-success {
    border-left-color: var(--ok);
}

.event span {
    overflow-wrap: anywhere;
}

.event small {
    color: rgba(247, 255, 247, 0.66);
}

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

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

    .screen-tabs,
    .search {
        grid-column: 1 / -1;
    }

    .clock {
        grid-column: 2;
        grid-row: 1;
    }

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

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

    .board-layout {
        grid-template-columns: 1fr;
    }

    .stock-panel {
        order: -1;
    }
}

@media (max-width: 720px) {
    .command-bar {
        padding: 10px 12px;
        gap: 10px;
    }

    main {
        padding: 14px 12px;
    }

    .workspace-head {
        display: grid;
        gap: 12px;
    }

    .metric-strip,
    .request-form {
        grid-template-columns: 1fr;
    }

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

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

    .lanes {
        display: flex;
    }

    .lane {
        flex-basis: 75vw;
        min-width: 230px;
    }

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

    .asset-count {
        text-align: left;
    }

    .asset-row button {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .finance-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .event-stream {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .event {
        min-width: 82vw;
    }
}
