:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: #202520; background: #f5f4ef; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
header, main, footer { width: min(1560px, calc(100% - 40px)); margin-inline: auto; }
header { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 44px 0 26px; border-bottom: 1px solid #dcded6; }
h1 { margin: 4px 0 0; font-size: clamp(28px, 5vw, 46px); letter-spacing: -.04em; }
h2 { letter-spacing: -.025em; }
.eyebrow, .muted, footer { color: #70776f; font-size: 14px; }
.eyebrow { margin: 0; letter-spacing: .12em; font-weight: 700; }
nav { display: flex; align-items: center; gap: 18px; }
nav form { margin: 0; }
a { color: #314b3a; text-underline-offset: 3px; }
main { padding: 34px 0 70px; }
footer { padding: 22px 0 36px; border-top: 1px solid #dcded6; }
button { appearance: none; border: 0; border-radius: 8px; background: #202b23; color: white; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer; }
nav button { color: #314b3a; background: transparent; border: 1px solid #cbd0c8; }
input { width: 100%; margin-top: 8px; border: 1px solid #cbd0c8; border-radius: 8px; background: #fff; padding: 13px; font: inherit; }
label { display: block; margin: 20px 0; font-weight: 650; }
.login-page header { border: 0; }
.login-page header, .login-page main, .login-page footer { max-width: 520px; }
.login-card, .order-card, .summary, .empty { background: #fff; border: 1px solid #dcded6; border-radius: 12px; padding: 26px; }
.login-card button { width: 100%; }
.notice { color: #8b2f28; background: #fff1ef; border-radius: 7px; padding: 12px; }
.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr)); gap: 18px; }
.order-card h2 { margin: 5px 0 22px; }
.order-card h2 a { color: inherit; }
.order-card-heading, .client-summary-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.client-status-chip { display: inline-flex; flex: 0 0 auto; align-items: center; border: 1px solid #c9d5cb; border-radius: 999px; background: #eef4ef; color: #314b3a; padding: 7px 10px; font-size: 12px; font-weight: 750; line-height: 1.1; }
progress { width: 100%; height: 10px; border: 0; border-radius: 10px; overflow: hidden; accent-color: #41644d; }
progress::-webkit-progress-bar { background: #e6e8e2; }
progress::-webkit-progress-value { background: #41644d; }
.summary { margin-bottom: 36px; }
.client-history { margin: 0 0 36px; padding: 26px; border: 1px solid #dcded6; border-radius: 12px; background: #fff; }
.client-history h2 { margin-top: 0; }
.client-history ol { list-style: none; margin: 24px 0 0; padding: 0; }
.client-history li { display: grid; grid-template-columns: 12px 1fr; gap: 12px; padding: 0 0 20px; position: relative; }
.client-history li::before { content: ""; position: absolute; top: 12px; bottom: 0; left: 5px; width: 2px; background: #dce4dd; }
.client-history li:last-child::before { display: none; }
.client-history li > span { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: #41644d; position: relative; z-index: 1; }
.client-history strong, .client-history small { display: block; }
.client-history small { margin-top: 4px; color: #70776f; }
.client-fittings { margin: 0 0 36px; padding: 26px; border: 1px solid #dcded6; border-radius: 12px; background: #fff; }
.client-fittings > h2 { margin-top: 0; }
.client-fitting { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; margin-top: 16px; padding: 20px; border: 1px solid #dcded6; border-left: 5px solid #41644d; border-radius: 10px; }
.client-fitting.status-reschedule_requested { border-left-color: #bd7a20; }
.client-fitting.status-cancelled,
.client-fitting.status-no_show { border-left-color: #9a493d; }
.client-fitting > p,
.client-fitting > ul,
.client-fitting-actions { grid-column: 1 / -1; }
.client-fitting h3 { margin: 4px 0; }
.client-fitting ul { margin: 4px 0; padding: 0; list-style: none; }
.client-fitting li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; padding: 10px 0; border-top: 1px solid #e6e7e2; }
.client-fitting li p { width: 100%; margin: 0; color: #70776f; }
.client-fitting-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.client-fitting-actions form { margin: 0; }
.client-fitting-actions details { padding: 10px 13px; border: 1px solid #cbd0c8; border-radius: 8px; }
.client-fitting-actions textarea { width: 100%; min-height: 90px; margin-top: 8px; padding: 10px; border: 1px solid #cbd0c8; border-radius: 8px; font: inherit; }
.saved-notice { padding: 12px; border-radius: 8px; background: #e9f4ea; color: #275b34; }
.table-wrap { overflow-x: auto; border: 1px solid #dcded6; border-radius: 10px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th, td { text-align: left; padding: 15px; border-bottom: 1px solid #e6e7e2; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #70776f; }
td progress { width: 120px; vertical-align: middle; }
.client-progress { display: flex; align-items: center; gap: 8px; }
.realtime-status { position: fixed; right: 16px; bottom: 16px; z-index: 90; padding: 7px 11px; border: 1px solid #cbd7cd; border-radius: 999px; box-shadow: 0 6px 22px rgb(35 48 39 / 12%); background: rgb(255 255 255 / 94%); color: #45604c; font-size: 12px; line-height: 1.2; backdrop-filter: blur(8px); }
.realtime-status::before { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #4e805a; content: ""; }
.realtime-status.is-connecting::before, .realtime-status.is-refreshing::before { background: #b27b2c; }
.realtime-status.is-reconnecting::before { background: #a64b3f; }
.realtime-update-notice { position: fixed; top: 14px; left: 50%; z-index: 100; display: flex; width: min(620px, calc(100% - 28px)); padding: 10px 12px 10px 16px; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid #c9d6cb; border-radius: 10px; box-shadow: 0 12px 36px rgb(31 45 35 / 18%); background: #f8fbf7; transform: translateX(-50%); }
.realtime-update-notice[hidden] { display: none; }
.realtime-update-notice button { flex: 0 0 auto; white-space: nowrap; }

@media (max-width: 620px) {
    header, main, footer { width: calc(100% - 24px); }
    header { align-items: flex-start; flex-direction: column; padding-top: 28px; }
    nav { width: 100%; justify-content: space-between; }
    nav a, nav button { min-height: 44px; display: inline-flex; align-items: center; }
    main { padding-top: 24px; }
    button, input, textarea, select { min-height: 44px; }
    input, textarea, select { font-size: 16px; }
    .login-card, .order-card, .summary, .empty, .client-history, .client-fittings { padding: 18px; }
    .order-card-heading, .client-summary-heading { flex-direction: column; }
    .client-fitting { grid-template-columns: 1fr; padding: 16px; }
    .client-fitting > * { grid-column: 1; }
    .client-fitting-actions, .client-fitting-actions form, .client-fitting-actions button { width: 100%; }
    .table-wrap { border: 0; border-radius: 0; background: transparent; overflow: visible; }
    table, tbody, tr, td { display: block; width: 100%; min-width: 0; }
    thead { display: none; }
    tr { margin-bottom: 12px; padding: 10px 14px; border: 1px solid #dcded6; border-radius: 10px; background: #fff; }
    td { display: grid; grid-template-columns: minmax(94px, .8fr) minmax(0, 1.4fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid #ecece8; overflow-wrap: anywhere; }
    td:last-child { border-bottom: 0; }
    td::before { color: #70776f; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; content: attr(data-label); }
    td progress { width: 100%; max-width: 180px; }
    .client-progress { min-width: 0; }
    .realtime-update-notice { align-items: stretch; flex-direction: column; }
    .realtime-update-notice button { width: 100%; white-space: normal; }
    .realtime-status { right: 10px; bottom: 10px; }
}
