:root {
    color-scheme: dark;
    --bg: #101311;
    --panel: #181d1a;
    --panel-2: #202621;
    --line: #303a32;
    --text: #f3f5ef;
    --muted: #a8b1a9;
    --green: #b9f227;
    --green-dark: #263408;
    --amber: #f2c94c;
    --blue: #6fc8ff;
    --red: #ff8b8b;
    --radius: 14px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at 90% -10%, rgba(185, 242, 39, .08), transparent 28rem),
        var(--bg);
    color: var(--text);
    line-height: 1.4;
}

a { color: inherit; text-decoration-color: rgba(185, 242, 39, .55); text-underline-offset: .18em; }
a:hover { color: var(--green); }

.site-header,
.site-footer,
.page-shell {
    width: min(1220px, calc(100% - 48px));
    margin-inline: auto;
}

.site-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.brand__mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--green);
    color: #151b08;
    font-weight: 900;
    letter-spacing: -.04em;
}
.brand strong, .brand small { display: block; }
.brand small, .environment, .muted { color: var(--muted); }
.brand small { font-size: .78rem; }
.environment { font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; }

.page-shell { padding: 28px 0 46px; }
.eyebrow {
    margin: 0 0 4px;
    color: var(--green);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
h1 {
    margin: 0 0 22px;
    font-size: clamp(2.05rem, 3.4vw, 2.85rem);
    line-height: 1;
    letter-spacing: -.045em;
}
h2 { margin: 0; letter-spacing: -.02em; }

.summary-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
}
.summary-strip div { padding: 11px 20px; border-right: 1px solid var(--line); }
.summary-strip div:last-child { border-right: 0; }
.summary-strip strong { display: block; font-size: 1.3rem; line-height: 1.2; }
.summary-strip span { color: var(--muted); font-size: .78rem; }

.order-list-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}
.order-list { width: 100%; min-width: 1080px; border-collapse: collapse; }
.order-list th,
.order-list td {
    padding: 11px 13px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
.order-list th {
    color: var(--muted);
    background: var(--panel-2);
    font-size: .7rem;
    letter-spacing: .075em;
    text-transform: uppercase;
}
.order-list tbody tr:last-child td { border-bottom: 0; }
.order-list tbody tr:hover { background: rgba(185, 242, 39, .035); }
.order-list__number { min-width: 135px; }
.order-list__number a { font-size: 1.05rem; font-weight: 800; }
.order-list__number small,
.order-list__status small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .74rem;
}
.order-list__client { min-width: 125px; font-weight: 650; }
.order-list__asset { min-width: 105px; }
.order-list__type { min-width: 150px; }
.order-list__date { min-width: 104px; white-space: nowrap; }
.order-list__progress,
.order-list__labor {
    min-width: 90px;
    text-align: right !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.order-list__progress strong,
.order-list__labor strong { color: var(--text); }

.order-card, .panel, .detail-hero, .empty-state {
    background: linear-gradient(145deg, var(--panel), #151916);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.status {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    background: var(--panel-2);
}
.status--complete { color: var(--green); background: var(--green-dark); }
.status--progress { color: var(--blue); background: #0d2a3c; }
.status--hold { color: var(--amber); background: #342a0b; }
.status--cancelled { color: var(--red); background: #351414; }
.status--planned { color: #d2d9d3; }

.compact-details { margin: 12px 0 0; }
.compact-details div { display: grid; grid-template-columns: 88px 1fr; gap: 10px; padding: 4px 0; }
.compact-details dt { color: var(--muted); }
.compact-details dd { margin: 0; font-weight: 650; }

.back-link { margin: -10px 0 16px; }
.detail-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 18px 22px;
    margin-bottom: 12px;
}
.detail-hero p { max-width: 720px; margin: 10px 0 0; font-size: 1rem; }
.detail-hero__total { min-width: 230px; text-align: right; }
.detail-hero__total span, .detail-hero__total small, table small { display: block; color: var(--muted); }
.detail-hero__total strong { display: block; color: var(--green); font-size: 1.7rem; line-height: 1.2; }

.detail-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.panel { padding: 17px 20px; }
.panel h2 { font-size: 1rem; }
.complaint { margin-top: 12px; }
.complaint p { margin: 10px 0 0; white-space: normal; }

.work-section { margin-top: 26px; }
.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}
.section-heading h2 { font-size: 1.45rem; }
.section-heading p { margin: 0; color: var(--muted); }
.section-heading .eyebrow { margin: 0 0 2px; color: var(--green); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; min-width: 850px; border-collapse: collapse; background: var(--panel); }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: var(--panel-2); font-size: .7rem; letter-spacing: .075em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(185, 242, 39, .025); }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.sequence { color: var(--green); font-weight: 900; font-variant-numeric: tabular-nums; }

.empty-state { padding: 30px; text-align: center; }
.button {
    display: inline-flex;
    margin-top: 10px;
    padding: 9px 14px;
    border-radius: 9px;
    background: var(--green);
    color: #141a08;
    font-weight: 800;
    text-decoration: none;
}
.button:hover { color: #141a08; background: #cffb62; }
.site-footer { padding: 18px 0 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }

@media (max-width: 980px) {
    .order-list { min-width: 0; }
    .order-list thead { display: none; }
    .order-list tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; }
    .order-list tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: start;
        border: 1px solid var(--line);
        border-radius: 12px;
        overflow: hidden;
        background: #151916;
    }
    .order-list td,
    .order-list tbody tr:last-child td {
        display: grid;
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 8px;
        min-width: 0;
        padding: 8px 11px;
        border-bottom: 1px solid var(--line);
        text-align: left !important;
        white-space: normal;
    }
    .order-list td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: .66rem;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
    }
    .order-list__number,
    .order-list__status { grid-column: 1 / -1; }
    .order-list__number { display: block !important; }
    .order-list__number::before { display: none; }
    .order-list__number a { font-size: 1.15rem; }
    .order-list__status { border-bottom: 1px solid var(--line) !important; }
    .order-list tbody tr:hover { background: #151916; }
}

@media (max-width: 780px) {
    .site-header, .site-footer, .page-shell { width: min(100% - 24px, 1220px); }
    .site-header { min-height: 66px; }
    .environment { display: none; }
    .page-shell { padding: 22px 0 34px; }
    h1 { margin-bottom: 18px; font-size: 2.15rem; }
    .summary-strip div { padding: 9px 10px; }
    .summary-strip strong { font-size: 1.1rem; }
    .summary-strip span { font-size: .68rem; }
    .detail-columns { grid-template-columns: 1fr; }
    .detail-hero { align-items: flex-start; flex-direction: column; }
    .detail-hero__total { min-width: 0; text-align: left; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (max-width: 620px) {
    .order-list tbody { grid-template-columns: 1fr; }
    .order-list tbody tr { grid-template-columns: 1fr; }
    .order-list td { grid-template-columns: 82px minmax(0, 1fr); }
    .order-list__number,
    .order-list__status { grid-column: auto; }
    .order-list__number { grid-column: 1 / -1; }
}
