/* Visual reference: the design canvas. System fonts only (no third-party font requests). */
:root {
    --ink: #16242B;
    --muted: #55666E;
    --line: #DCE3E6;
    --field: #C3CED3;
    --dark: #12303A;
    --teal: #0B6B75;
    --teal-dark: #084E56;
    --teal-soft: #DFF0F1;
    --page: #F4F7F8;
    --ok: #1E6B3A;
    --bad: #A3271F;
    --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --display: Manrope, var(--font);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: #FFFFFF; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
h1, h2, h3 { font-family: var(--display); margin: 0; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand:hover { color: inherit; }
.brand span { font-family: var(--display); font-size: 22px; font-weight: 800; }

/* Buttons and fields */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 8px;
    font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
    background: var(--teal); color: #FFFFFF; border: 1px solid var(--teal); }
.button:hover { background: var(--teal-dark); color: #FFFFFF; }
.button.secondary { background: #FFFFFF; color: var(--ink); border-color: var(--field); }
.button.light { background: #FFFFFF; color: var(--dark); border-color: #FFFFFF; }
.button.ghost { background: transparent; color: #FFFFFF; border-color: #6F8C95; }
.button.large { min-height: 52px; padding: 0 26px; font-size: 16px; }
.link-button { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--teal); cursor: pointer; text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input { min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink); background: #FFFFFF; width: 100%; }
.field input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.hint { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 13px; }
.alert.error { background: #FBE7E5; border: 1px solid #F0B9B3; color: var(--bad); }
.alert.info { background: #E1EDFB; border: 1px solid #B5CDEE; color: #1B4A8A; }
.alert.ok { background: #E3F3E8; border: 1px solid #B3DCC0; color: var(--ok); }

/* Auth pages: dark background, centred white card */
.auth { min-height: 100vh; padding: 48px 24px; background: var(--dark); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.auth > .brand { color: #FFFFFF; }
.card { width: 100%; max-width: 440px; background: #FFFFFF; border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.card.wide { max-width: 480px; }
.card h1 { font-size: 24px; font-weight: 800; }
.card-head { display: flex; flex-direction: column; gap: 4px; }
.card form { display: flex; flex-direction: column; gap: 18px; }
.divider { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.inline { display: flex; gap: 10px; align-items: flex-end; }
.inline > .field { flex: 1 1 auto; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; }
.badge { align-self: flex-start; display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--teal-soft); color: #0A5560; font-size: 12px; font-weight: 700; }

/* One input styled as six boxes */
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 26px; font-weight: 700; letter-spacing: 0.9em;
    text-align: center; padding-left: 0.9em; height: 60px; border: 1px solid var(--field); border-radius: 10px; width: 100%; color: var(--ink); }
.code-input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

.code-row { display: flex; align-items: center; gap: 8px; }
.code-row input { flex: 1 1 auto; }
.code-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; min-height: 18px; }
.code-status.free { color: var(--ok); }
.code-status.taken, .code-status.invalid { color: var(--bad); }

/* Landing page */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; width: 100%; }
.site-header { background: var(--dark); color: #FFFFFF; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 22px; }
.site-nav a { color: #D5E3E7; text-decoration: none; font-weight: 600; padding: 12px 4px; }
.site-nav a:hover { color: #FFFFFF; }
.hero { background: var(--dark); color: #FFFFFF; padding: 56px 0 72px; }
.hero .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.hero-text { flex: 1 1 460px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.eyebrow { color: #9FD3D8; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 13px; }
.hero h1 { font-size: 46px; line-height: 1.12; font-weight: 800; }
.hero p { margin: 0; font-size: 18px; line-height: 1.5; color: #D5E3E7; max-width: 520px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero small { color: #9FB7BE; font-size: 14px; }
.preview { flex: 1 1 380px; max-width: 460px; background: #FFFFFF; color: var(--ink); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.preview-head strong { font-family: var(--display); font-size: 18px; font-weight: 800; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #E1EDFB; color: #1B4A8A; font-size: 12px; font-weight: 600; }
.preview dl { margin: 0; border-top: 1px solid var(--line); padding-top: 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; }
.preview dt { color: var(--muted); }
.preview dd { margin: 0; text-align: right; }
.preview-actions { display: flex; gap: 8px; }
.preview-actions span { flex: 1 1 0; text-align: center; padding: 10px; border-radius: 8px; border: 1px solid var(--field); font-weight: 600; }
.preview-actions span.primary { background: var(--teal); border-color: var(--teal); color: #FFFFFF; }
.section { padding: 72px 0; }
.section.alt { background: var(--page); }
.section .wrap { display: flex; flex-direction: column; gap: 32px; }
.section-head { display: flex; flex-direction: column; gap: 10px; max-width: 680px; }
.section-head .eyebrow { color: var(--teal); font-weight: 700; }
.section-head h2 { font-size: 32px; line-height: 1.2; font-weight: 800; }
.section-head p { margin: 0; color: var(--muted); font-size: 17px; }
.tiles { display: flex; flex-wrap: wrap; gap: 20px; list-style: none; margin: 0; padding: 0; }
.tile { flex: 1 1 300px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.tile h3 { font-size: 18px; font-weight: 700; }
.tile p { margin: 0; color: var(--muted); }
.tile-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; background: var(--teal-soft); color: var(--teal); }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; background: var(--dark); color: #FFFFFF; font-family: var(--display); font-weight: 800; font-size: 18px; }
.faq { display: flex; flex-direction: column; gap: 12px; max-width: 820px; }
.faq details { background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; padding: 4px 20px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 700; font-size: 16px; }
.faq details p { margin: 0 0 18px; color: var(--muted); }
.about { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.about > p { flex: 2 1 420px; margin: 0; font-size: 17px; line-height: 1.6; }
.about .tile { flex: 1 1 280px; }
.cta { background: var(--teal); color: #FFFFFF; padding: 56px 0; }
.cta .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta h2 { font-size: 28px; font-weight: 800; }
.cta p { margin: 8px 0 0; font-size: 17px; color: #E3F2F3; }
.site-footer { background: var(--dark); color: #D5E3E7; padding: 36px 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.site-footer .brand { color: #FFFFFF; }
.site-footer small { font-size: 13px; color: #9FB7BE; }

@media (max-width: 640px) {
    .hero h1 { font-size: 34px; }
    .wrap { padding: 0 20px; }
    .card { padding: 24px; }
}

/* App shell: left menu (canvas) */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; background: #F5F7F8; font-size: 14px; }
.side { flex: 1 1 220px; max-width: 260px; background: var(--dark); padding: 20px 14px; display: flex; flex-direction: column; gap: 24px; }
.side-company { padding: 0 12px; font-family: var(--display); font-size: 16px; font-weight: 800; color: #FFFFFF; }
.side-links { display: flex; flex-direction: column; gap: 4px; }
.side-links a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; text-decoration: none; color: #D5E3E7; }
.side-links a:hover { color: #FFFFFF; background: #1A3D49; }
.side-links a.current { background: #1E4654; color: #FFFFFF; font-weight: 600; }
.side-user { margin-top: auto; padding: 12px; border-top: 1px solid #2A4F5C; display: flex; flex-direction: column; gap: 2px; }
.side-name { color: #FFFFFF; font-weight: 600; }
.side-sub { color: #B7CBD1; font-size: 12px; overflow-wrap: anywhere; }
.side-sub a { color: #FFFFFF; }
.side-signout { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; background: none; border: 0; padding: 0; color: #FFFFFF; font: inherit; font-weight: 600; cursor: pointer; }
.content { flex: 999 1 560px; min-width: 0; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.panel { background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; flex: 999 1 480px; max-width: 760px; }
.panel.narrow { max-width: 520px; }
.panel h2 { font-size: 16px; font-weight: 700; }
.stack { display: flex; flex-direction: column; gap: 16px; flex: 999 1 480px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.grow { flex: 1 1 200px; }
.settings { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.settings-nav { flex: 1 1 220px; max-width: 260px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.settings-nav a.current { background: var(--teal-soft); color: #0A5560; font-weight: 600; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; min-width: 420px; border-collapse: collapse; }
.table th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid #EDF1F2; vertical-align: middle; }
.cell-input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; font: inherit; color: var(--ink); }
.order-cell { white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--field); border-radius: 8px; background: #FFFFFF; cursor: pointer; font-size: 16px; }
.icon-button:disabled { opacity: 0.35; cursor: default; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; white-space: nowrap; }
.check input { width: 18px; height: 18px; }
.radios { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.radios legend { padding: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.field select { min-height: 44px; padding: 0 10px; border: 1px solid var(--field); border-radius: 8px; font: inherit; color: var(--ink); background: #FFFFFF; width: 100%; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #E9EEF0; color: #33454D; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.blue { background: #E1EDFB; color: #1B4A8A; }
.tag.green { background: #DDF2E6; color: #135C36; }
.tag.grey { background: #EEF2F3; color: var(--muted); }
.shop-list { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.shop-option { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--field); font-size: 15px; font-weight: 600; cursor: pointer; }
.shop-option:has(input:checked) { border: 2px solid var(--teal); }
.shop-option .hint { margin-left: auto; font-weight: 400; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Clients */
.panel.wide { max-width: none; }
.side-panel { flex: 0 0 340px; max-width: 100%; align-self: flex-start; }
.filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.client-form { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.field textarea { padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; font: inherit; color: var(--ink); width: 100%; resize: vertical; }
.field-error { font-size: 13px; color: var(--bad); font-weight: 600; }
.check.wrap { white-space: normal; align-items: flex-start; padding-top: 10px; }
.check.wrap input { flex: none; margin-top: 1px; }
.alert.warn { background: #FFF1D6; border: 1px solid #E8C98A; color: #7A4A00; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.duplicate-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: #FFFFFF; border-radius: 8px; color: var(--ink); }
.duplicate-card > div { display: flex; flex-direction: column; gap: 2px; }
.strong { font-weight: 600; }
.facts { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, max-content); gap: 10px 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; overflow-wrap: break-word; min-width: 0; }
.notes { white-space: pre-line; }

/* Orders */
.tiles-row { display: flex; flex-wrap: wrap; gap: 12px; }
.count-tile { display: flex; flex-direction: column; gap: 2px; min-width: 160px; padding: 14px 18px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.count-tile strong { font-family: var(--display); font-size: 26px; font-weight: 800; }
.count-tile span { color: var(--muted); font-size: 13px; }
.num { text-align: right; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.matches { display: flex; flex-direction: column; gap: 6px; }
.match { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); }
.match:hover { border-color: var(--teal); }
.rx { border-collapse: collapse; }
.rx th { text-align: left; padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.rx td { padding: 4px 6px; vertical-align: top; }
.rx input { width: 90px; min-height: 40px; padding: 0 10px; border: 1px solid var(--field); border-radius: 8px; font: inherit; }
.rx .field-error { display: block; max-width: 120px; font-size: 12px; }
.field input.price { max-width: 160px; }
.totals { border-top: 1px solid var(--line); padding-top: 12px; font-size: 16px; }
.readonly { background: #EEF2F3; color: var(--muted); border-color: var(--line) !important; }
input.short { width: 96px; min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; font: inherit; }
.lists-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.lists-grid .panel { flex: 1 1 260px; max-width: 360px; }
.list-row { display: flex; gap: 6px; align-items: center; }
/* Panels stacked in a column keep their natural height (the row flex sizes are meant for widths). */
.stack > .panel { flex: 0 0 auto; max-width: none; }

/* Order screen */
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tag.red { background: #FDE4E1; color: #8F1D14; }
.status-field { flex: 0 1 300px; min-width: 220px; }
.status-field select { min-height: 48px; font-size: 15px; font-weight: 600; }
.facts-line { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.side-stack { flex: 1 1 400px; max-width: 460px; }
.confirm { border: 2px solid var(--teal); max-width: 720px; flex: 0 0 auto; }
.subform { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid #DCE3E6; padding-top: 14px; }
.subform h3 { margin: 0; font-size: 15px; }
.button.danger { background: #B3261E; border-color: #B3261E; color: #FFFFFF; }
.struck td:nth-child(3) { text-decoration: line-through; color: var(--muted); }
.nowrap { white-space: nowrap; }
.block { display: block; }
.side-stack .table { min-width: 0; }
.side-stack .table th, .side-stack .table td { padding: 10px 6px; }

/* Workshop board */
.board-wrap { display: flex; flex-direction: column; gap: 12px; }
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; align-items: start; }
.column { display: flex; flex-direction: column; gap: 10px; min-width: 0; background: #EAEFF1; border-radius: 12px; padding: 12px; }
.column h2 { font-size: 15px; font-weight: 700; padding: 2px 4px; display: flex; justify-content: space-between; }
.cards { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.work-card { background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; cursor: grab; }
.work-card select { min-height: 44px; padding: 0 10px; border: 1px solid var(--field); border-radius: 8px; font: inherit; font-weight: 600; color: var(--ink); background: #FFFFFF; width: 100%; }
.work-card.sortable-ghost { opacity: 0.4; }
.grip-row { display: inline-flex; align-items: center; gap: 8px; }
.grip { color: var(--muted); }
.due { color: var(--muted); font-size: 12px; }
.due.overdue { color: #B3261E; font-weight: 600; }
.small { font-size: 13px; }
.note { padding: 8px 10px; border-radius: 8px; background: #FFF3D6; border: 1px solid #E8C877; color: #6B4A00; font-size: 13px; overflow-wrap: anywhere; }
.note summary { cursor: pointer; list-style: none; }
.note .clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note .more { font-weight: 600; text-decoration: underline; }
.note[open] .clamp, .note[open] .more { display: none; }
.note p { margin: 4px 0 0; white-space: pre-wrap; }
.drag-handle { cursor: grab; color: var(--muted); padding: 0 4px; letter-spacing: -3px; user-select: none; }
.sortable-ghost { opacity: 0.4; }

/* Reports */
.report-page { display: flex; flex-direction: column; gap: 20px; }
.state-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.report-panel { max-width: none; flex: 0 0 auto; }
.sort { color: inherit; text-decoration: none; }
.sort:hover { text-decoration: underline; }
.table tfoot th, .table tfoot td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: left; font-size: 14px; color: var(--ink); font-weight: 700; }
.table th.num, .table td.num { text-align: right; }

/* Client import */
.import-steps { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; flex: 0 0 auto; }
.import-steps .panel { flex: 1 1 320px; }
.import-panel { max-width: none; flex: 0 0 auto; }
.step { font-size: 12px; font-weight: 600; color: var(--muted); }
.import-counts { display: flex; flex-wrap: wrap; gap: 12px; }
.import-counts .count { flex: 1 1 160px; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 10px; }
.import-counts strong { font-size: 22px; font-weight: 800; }
.count.ok { background: #DDF2E6; color: #135C36; }
.count.warn { background: #FFF1D6; color: #7A4A00; }
.count.bad { background: #FDE4E1; color: #8F1D14; }
.tag.amber { background: #FFF1D6; color: #7A4A00; }
.button.danger-outline { color: #8F1D14; border-color: #E5B5AF; }
.import-form { display: flex; flex-direction: column; gap: 14px; }
.legal { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
