:root {
    --ink: #2d3142;
    --paper: #f7fff7;
    --amber: #ff9f1c;
    --mint: #2ec4b6;
    --red: #c3423f;
    --blue: #36558f;
    --line: rgba(45, 49, 66, 0.18);
    --soft: rgba(247, 255, 247, 0.78);
    --shadow: 0 18px 50px rgba(45, 49, 66, 0.16);
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(90deg, rgba(45, 49, 66, 0.06) 1px, transparent 1px),
        linear-gradient(0deg, rgba(45, 49, 66, 0.05) 1px, transparent 1px),
        var(--paper);
    background-size: 28px 28px;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.command-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(190px, 260px) auto minmax(220px, 320px) auto;
    gap: 16px;
    align-items: center;
    min-height: 76px;
    padding: 12px 22px;
    color: var(--paper);
    background: var(--ink);
    border-bottom: 4px solid var(--amber);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

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

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

.brand strong {
    display: block;
    font-size: 20px;
    line-height: 1;
}

.brand small,
.clock small,
.search-box span,
.mono {
    text-transform: uppercase;
    letter-spacing: 0;
    font-size: 11px;
    font-weight: 800;
}

.brand small,
.clock small {
    color: rgba(247, 255, 247, 0.72);
}

.screen-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab,
.primary-action,
.reservation-card button,
.request-form button {
    border: 0;
    min-height: 40px;
    border-radius: 4px;
    font-weight: 800;
}

.tab {
    padding: 0 14px;
    color: var(--paper);
    background: rgba(247, 255, 247, 0.12);
}

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

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

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

.search-box input {
    border-color: rgba(247, 255, 247, 0.2);
    background: rgba(247, 255, 247, 0.1);
    color: var(--paper);
}

.search-box input::placeholder {
    color: rgba(247, 255, 247, 0.62);
}

.clock {
    text-align: right;
}

.clock span {
    display: block;
    font-size: 22px;
    font-weight: 900;
}

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

.status-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(247, 255, 247, 0.92);
}

.status-cell {
    min-height: 82px;
    padding: 16px;
    border-right: 1px solid var(--line);
}

.status-cell:last-child {
    border-right: 0;
}

.status-cell span,
.request-form span,
.doc-row span,
.inspection-row span,
.ledger-row span {
    display: block;
    color: rgba(45, 49, 66, 0.72);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.status-cell strong {
    display: block;
    margin-top: 6px;
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1;
    font-family: Georgia, 'Times New Roman', serif;
}

.status-cell.accent {
    background: var(--amber);
}

.screen {
    display: none;
    animation: rise 180ms ease-out;
}

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

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

.overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    min-height: calc(100vh - 244px);
    border: 1px solid var(--line);
    background: rgba(247, 255, 247, 0.84);
}

.wall-panel {
    min-width: 0;
    border-right: 1px solid var(--line);
}

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

.section-head.slim {
    padding-left: 0;
    padding-right: 0;
}

.section-head h1,
.section-head h2,
.docs-layout h2,
.finance-ledger h2 {
    margin: 4px 0 0;
    font-size: clamp(26px, 4vw, 46px);
    line-height: 1.02;
}

.section-head h2,
.docs-layout h2,
.finance-ledger h2 {
    font-size: clamp(24px, 3vw, 36px);
}

.mono {
    margin: 0;
    color: var(--blue);
}

.primary-action,
.request-form button {
    padding: 0 16px;
    color: var(--ink);
    background: var(--amber);
    box-shadow: inset 0 -3px 0 rgba(45, 49, 66, 0.18);
}

.reservation-wall {
    display: grid;
    grid-template-columns: repeat(4, minmax(230px, 1fr));
    min-height: 560px;
    overflow-x: auto;
}

.wall-lane {
    min-width: 230px;
    border-right: 1px solid var(--line);
}

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

.wall-lane > header {
    position: sticky;
    top: 76px;
    z-index: 2;
    min-height: 96px;
    padding: 14px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.lane-type {
    display: inline-block;
    padding: 3px 7px;
    color: var(--paper);
    background: var(--ink);
    border-radius: 3px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.wall-lane strong {
    display: block;
    margin-top: 9px;
}

.wall-lane small {
    display: block;
    margin-top: 4px;
    color: rgba(45, 49, 66, 0.66);
}

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

.reservation-card {
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 1px solid rgba(45, 49, 66, 0.24);
    border-left: 6px solid var(--mint);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 28px rgba(45, 49, 66, 0.08);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.reservation-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.reservation-card.priority-critical {
    border-left-color: var(--red);
}

.reservation-card.priority-high {
    border-left-color: var(--amber);
}

.reservation-card header,
.reservation-card footer,
.order-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.reservation-card header span,
.reservation-card header b {
    font-size: 12px;
}

.reservation-card h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.15;
}

.reservation-card p {
    margin: 0;
    color: rgba(45, 49, 66, 0.74);
    line-height: 1.35;
}

.order-meta {
    flex-wrap: wrap;
}

.order-meta span {
    padding: 4px 6px;
    background: rgba(46, 196, 182, 0.16);
    border-radius: 3px;
    font-size: 12px;
    font-weight: 800;
}

.public,
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.public.clear,
.badge.clear {
    color: #0b4b43;
    background: rgba(46, 196, 182, 0.22);
}

.public.watch,
.badge.watch {
    color: #6b3d00;
    background: rgba(255, 159, 28, 0.28);
}

.public.risk,
.badge.risk {
    color: #7b1612;
    background: rgba(195, 66, 63, 0.18);
}

.reservation-card button {
    padding: 0 10px;
    color: var(--paper);
    background: var(--ink);
}

.inspector {
    padding: 16px;
    background: rgba(45, 49, 66, 0.04);
}

.seal-line {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    text-transform: uppercase;
    font-size: 12px;
}

.seal-dot {
    width: 14px;
    height: 14px;
    border-radius: 99px;
    background: var(--mint);
    box-shadow: 0 0 0 5px rgba(46, 196, 182, 0.2);
}

.active-reservation {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.active-reservation h3 {
    margin: 12px 0 6px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 25px;
    line-height: 1.08;
}

.active-reservation p {
    margin: 0 0 16px;
}

.active-reservation dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.active-reservation div {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 10px;
}

.active-reservation dt {
    color: rgba(45, 49, 66, 0.62);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.active-reservation dd {
    margin: 0;
}

.incident-list {
    display: grid;
    gap: 10px;
    padding-top: 14px;
}

.incident {
    padding: 10px;
    border-left: 5px solid var(--amber);
    background: rgba(255, 255, 255, 0.68);
}

.incident.critical,
.incident.high {
    border-left-color: var(--red);
}

.incident span,
.incident small {
    display: block;
    font-size: 12px;
    color: rgba(45, 49, 66, 0.66);
}

.incident strong {
    display: block;
    margin: 4px 0;
}

.form-layout,
.docs-layout,
.finance-layout {
    padding: 20px 0;
}

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

.request-form label {
    display: grid;
    gap: 6px;
}

.request-form button {
    align-self: end;
}

.form-status {
    min-height: 24px;
    font-weight: 800;
}

.docs-layout,
.finance-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
}

.document-list,
.inspection-list,
#financeEntries {
    display: grid;
    gap: 10px;
}

.doc-row,
.inspection-row,
.ledger-row,
.finance-board article {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.72);
}

.doc-row {
    grid-template-columns: 110px minmax(0, 1fr) minmax(160px, auto) 100px;
    align-items: center;
}

.doc-row strong,
.ledger-row small,
.inspection-row small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.inspection-row.pass {
    border-left: 5px solid var(--mint);
}

.inspection-row.watch {
    border-left: 5px solid var(--amber);
}

.inspection-row.fail {
    border-left: 5px solid var(--red);
}

.finance-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: 14px;
}

.finance-board article {
    min-height: 150px;
    justify-content: end;
}

.finance-board article.accent {
    background: var(--mint);
}

.finance-board span {
    text-transform: uppercase;
    font-weight: 900;
}

.finance-board strong {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(30px, 5vw, 54px);
    line-height: 1;
}

.event-stream {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-height: 112px;
    padding: 14px 22px;
    color: var(--paper);
    background: var(--ink);
    border-top: 4px solid var(--mint);
}

.event-stream .mono {
    color: var(--amber);
}

.event-items {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(190px, 260px);
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.event-items article {
    min-height: 72px;
    padding: 10px;
    border: 1px solid rgba(247, 255, 247, 0.2);
    border-radius: 6px;
    background: rgba(247, 255, 247, 0.08);
}

.event-items span,
.event-items small {
    display: block;
    color: rgba(247, 255, 247, 0.7);
    font-size: 12px;
}

.event-items strong {
    display: block;
    margin: 4px 0;
}

.empty {
    margin: 0;
    color: rgba(45, 49, 66, 0.62);
    font-weight: 700;
}

.lane-empty {
    min-height: 70px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line);
    border-radius: 6px;
}

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

    .clock {
        text-align: left;
    }

    .overview-grid,
    .docs-layout,
    .finance-layout {
        grid-template-columns: 1fr;
    }

    .wall-panel {
        border-right: 0;
    }

    .inspector {
        border-top: 1px solid var(--line);
    }

    .request-form {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 720px) {
    .command-bar,
    .workspace,
    .event-stream {
        padding-left: 12px;
        padding-right: 12px;
    }

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

    .status-cell {
        border-bottom: 1px solid var(--line);
    }

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

    .reservation-wall {
        grid-template-columns: repeat(4, 82vw);
    }

    .request-form,
    .finance-board {
        grid-template-columns: 1fr;
    }

    .doc-row {
        grid-template-columns: 1fr;
    }

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