:root {
    --ink: #252422;
    --paper: #fffcf2;
    --line: #ded9cb;
    --muted: #756f63;
    --accent: #eb5e28;
    --blue: #4f6d7a;
    --mint: #dbe9df;
    --white: #fffefa;
    --shadow: 0 18px 45px rgba(37, 36, 34, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
    line-height: 1.55;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.queue-pane,
.action-pane {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    background: var(--white);
}

.queue-pane {
    border-right: 1px solid var(--line);
}

.action-pane {
    border-left: 1px solid var(--line);
}

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

.nav-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.nav-tabs button,
.icon-button,
.primary-button,
.text-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    min-height: 42px;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-tabs button {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
}

.nav-tabs button.is-active,
.primary-button {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.primary-button {
    padding: 0 18px;
    font-weight: 800;
}

.text-button {
    border-color: transparent;
    color: var(--blue);
    font-weight: 800;
    padding: 0 12px;
}

.icon-button {
    width: 44px;
    font-size: 22px;
}

.nav-tabs button:hover,
.icon-button:hover,
.primary-button:hover,
.text-button:hover,
.queue-item:hover {
    transform: translateY(-1px);
}

.search-box label,
.label,
.eyebrow,
.queue-head,
.pane-foot,
.section-line span {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 800;
}

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

.search-box input,
.case-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    min-height: 42px;
    padding: 9px 11px;
}

.queue-head,
.pane-foot,
.section-line,
.record-title,
.topbar,
.action-row,
.vendor-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.case-queue {
    display: grid;
    gap: 10px;
    overflow: auto;
    padding-right: 2px;
}

.queue-item {
    display: grid;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    padding: 13px;
}

.queue-item.is-active {
    border-color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
}

.queue-item span {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.queue-item b,
.queue-item em {
    font-style: normal;
    overflow-wrap: anywhere;
}

.queue-item em,
.queue-item small {
    color: var(--muted);
}

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

.topbar {
    margin-bottom: 20px;
}

.topbar h1,
.active-record h2,
.case-form h2,
.section-line h2,
.action-head h2,
.finance-layout h2 {
    margin: 0;
    line-height: 1.12;
    letter-spacing: 0;
}

.topbar h1 {
    font-size: clamp(28px, 4vw, 54px);
}

.screen {
    display: none;
    animation: rise 260ms ease both;
}

.screen.is-active {
    display: block;
}

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

.metric-strip div {
    display: grid;
    gap: 4px;
    min-height: 96px;
    padding: 16px;
    background: var(--white);
}

.metric-strip span,
.finance-total {
    font-size: clamp(26px, 4vw, 46px);
    font-weight: 900;
    line-height: 1;
}

.metric-strip small {
    color: var(--muted);
}

.active-record,
.vendor-compare,
.case-form,
.finance-layout,
.document-list,
.deadline-list {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.active-record,
.vendor-compare,
.case-form,
.finance-layout {
    padding: 22px;
}

.summary-text {
    max-width: 780px;
    color: var(--muted);
    font-family: Arial, sans-serif;
    line-height: 1.75;
}

.status-chip,
.doc-row mark,
.deadline-row span {
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.risk-low {
    background: var(--mint);
    color: #244d31;
}

.risk-medium {
    background: #f4dfca;
    color: #8a3c13;
}

.risk-high {
    background: #f2cbc3;
    color: #8b2516;
}

.workflow-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 22px 0;
}

.stage {
    display: grid;
    gap: 7px;
    border-top: 3px solid var(--line);
    padding-top: 10px;
    color: var(--muted);
}

.stage.is-done {
    border-color: var(--accent);
    color: var(--ink);
}

.stage span {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--line);
    font-weight: 900;
}

.stage.is-done span {
    background: var(--accent);
    color: var(--paper);
}

.vendor-panel {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
    margin-bottom: 16px;
}

.vendor-panel div {
    display: grid;
    gap: 2px;
}

.vendor-panel strong {
    font-size: 22px;
    overflow-wrap: anywhere;
}

.vendor-compare {
    margin-top: 16px;
}

.vendor-list,
.document-list,
.deadline-list,
.note-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.vendor-row,
.doc-row,
.deadline-row,
.note {
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding: 13px 0 4px;
}

.vendor-row {
    grid-template-columns: minmax(0, 1.3fr) minmax(120px, 1fr) auto;
    align-items: center;
}

.vendor-row span,
.vendor-row small,
.doc-row span,
.note time {
    color: var(--muted);
}

.bar {
    height: 9px;
    border-radius: 999px;
    background: #e9e3d7;
    overflow: hidden;
}

.bar i {
    display: block;
    height: 100%;
    background: var(--blue);
}

.case-form {
    display: grid;
    gap: 14px;
    max-width: 720px;
}

.case-form label {
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.form-status,
.empty {
    color: var(--muted);
    margin: 0;
}

.doc-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
}

.doc-row:last-child {
    border-bottom: 0;
}

.doc-checked {
    background: var(--mint);
    color: #244d31;
}

.doc-needs_revision,
.doc-waiting,
.doc-draft {
    background: #f4dfca;
    color: #8a3c13;
}

.finance-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
    gap: 24px;
}

.deadline-row {
    grid-template-columns: 94px minmax(0, 1fr) auto;
    align-items: center;
}

.deadline-row time {
    font-weight: 900;
    color: var(--blue);
}

.deadline-row span {
    background: #e4edf0;
    color: #294654;
}

.action-head {
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
}

.next-action {
    display: grid;
    gap: 10px;
    border-left: 3px solid var(--accent);
    padding-left: 14px;
    font-family: Arial, sans-serif;
}

.note {
    font-family: Arial, sans-serif;
}

.note p {
    margin: 0;
}

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

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

    .action-pane {
        grid-column: 1 / -1;
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}

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

    .queue-pane,
    .record-pane,
    .action-pane {
        padding: 16px;
    }

    .nav-tabs,
    .metric-strip,
    .workflow-track,
    .finance-layout,
    .vendor-row {
        grid-template-columns: 1fr;
    }

    .topbar,
    .record-title,
    .vendor-panel,
    .action-row,
    .section-line,
    .deadline-row,
    .doc-row {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .primary-button,
    .text-button {
        width: 100%;
    }
}

