:root {
  color-scheme: dark;
  --bg: #0d1117;
  --bg-soft: #111827;
  --panel: #161b22;
  --panel-strong: #1f2937;
  --field: #0f172a;
  --text: #e6edf3;
  --muted: #9aa7b5;
  --line: #303947;
  --line-strong: #435064;
  --brand: #38bdf8;
  --brand-strong: #7dd3fc;
  --brand-contrast: #07131c;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --danger-strong: #ef4444;
  --focus: rgba(56, 189, 248, .34);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--brand-strong); text-underline-offset: 3px; }
a:hover { color: #bae6fd; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: rgba(22, 27, 34, .94); border-bottom: 1px solid var(--line); padding: 14px clamp(16px, 4vw, 40px); display: flex; align-items: center; justify-content: space-between; gap: 16px; box-shadow: 0 12px 34px rgba(0, 0, 0, .22); }
.brand { font-weight: 800; color: var(--text); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.nav a, .link-button { color: var(--muted); text-decoration: none; border: 0; background: transparent; font: inherit; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.nav a:hover, .link-button:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.main { width: min(1180px, 100%); margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px); }
.auth-wrap { width: min(520px, 100%); margin: 48px auto; }
.panel, .card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; box-shadow: 0 16px 40px rgba(0, 0, 0, .18); }
.card { color: inherit; text-decoration: none; }
.card:hover { border-color: var(--line-strong); background: #1a202a; }
.stack { display: grid; gap: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
form.grid { align-items: end; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.flash { padding: 12px 14px; border-radius: 8px; border: 1px solid rgba(52, 211, 153, .36); background: rgba(6, 78, 59, .42); color: #bbf7d0; margin-bottom: 16px; }
.error { border-color: rgba(248, 113, 113, .42); background: rgba(127, 29, 29, .34); color: #fecaca; }
label { display: grid; gap: 6px; font-weight: 650; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--field); color: var(--text); font: inherit; }
input:focus, textarea:focus, select:focus, button:focus-visible, .button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: #718096; }
textarea { min-height: 110px; resize: vertical; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check-row input { width: auto; }
.choice-row { display: flex; flex-wrap: wrap; gap: 14px; }
.button, button { min-height: 38px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-contrast); border-radius: 8px; padding: 8px 12px; font: inherit; font-weight: 750; line-height: 1.2; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; max-width: 100%; }
.button:hover, button:hover { background: #7dd3fc; border-color: #7dd3fc; }
.button.secondary, button.secondary { background: transparent; color: var(--brand-strong); border-color: var(--line-strong); }
.button.secondary:hover, button.secondary:hover { background: rgba(125, 211, 252, .1); border-color: var(--brand); }
.button.danger, button.danger { background: var(--danger-strong); border-color: var(--danger-strong); color: #fff; }
.button.danger:hover, button.danger:hover { background: #f87171; border-color: #f87171; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid var(--line); padding: 3px 9px; font-size: 13px; font-weight: 750; background: rgba(255, 255, 255, .04); }
.status-open { color: #cbd5e1; }
.status-quote-in-progress { color: var(--warn); }
.status-quote-confirmation { color: #c4b5fd; }
.status-order-in-progress { color: var(--brand-strong); }
.status-ready-for-pickup { color: var(--ok); }
.status-completed { color: #a7f3d0; }
.status-archived { color: var(--muted); }
.swatch-input { width: 28px; height: 28px; min-width: 28px; border: 1px solid var(--line); border-radius: 999px; padding: 0; background: var(--field); vertical-align: middle; overflow: hidden; }
.swatch-input:disabled { opacity: 1; cursor: default; }
.swatch-input::-webkit-color-swatch-wrapper { padding: 0; }
.swatch-input::-webkit-color-swatch { border: 0; border-radius: 999px; }
.swatch-input::-moz-color-swatch { border: 0; border-radius: 999px; }
.qr-code { width: 224px; height: 224px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: block; }
.break-word { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.section-spaced { margin-top: 18px; }
.secondary-panel { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--bg-soft); }
.inline-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions button { min-height: 34px; padding: 6px 10px; font-size: 14px; }
.color-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 10px 8px 0; }
.request-list { display: grid; gap: 14px; }
.list-controls { display: grid; grid-template-columns: repeat(2, minmax(180px, 260px)) auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.request-card { display: grid; gap: 16px; }
.request-card-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.request-card-heading { min-width: 0; }
.request-card-heading h2 { margin-bottom: 6px; font-size: 20px; }
.request-card-heading a { color: var(--text); text-decoration: none; }
.request-card-heading a:hover { color: var(--brand-strong); }
.request-card-heading p { margin: 0; font-size: 14px; }
.request-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.request-meta div { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg-soft); }
.request-meta dt { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.request-meta dd { margin: 0; color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.request-card-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 2px; }
.request-card-footer .button { min-height: 34px; padding: 6px 10px; font-size: 14px; }
.request-empty { display: grid; gap: 10px; justify-items: start; }
.request-empty h2, .request-empty p { margin: 0; }
.split { display: grid; grid-template-columns: 1.3fr .7fr; gap: 18px; align-items: start; }
.quote-breakdown { display: grid; border-top: 1px solid var(--line); }
.quote-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.quote-line-label { display: grid; gap: 2px; color: var(--text); overflow-wrap: anywhere; }
.quote-line-title { font-weight: 750; }
.quote-line-detail { color: var(--muted); font-size: 13px; line-height: 1.35; }
.quote-line-amount { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quote-notes { display: grid; gap: 6px; padding-top: 2px; color: var(--muted); }
.quote-notes strong { color: var(--text); font-size: 14px; }
.quote-notes p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.quote-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line-strong); font-weight: 800; }
.quote-total strong { font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quote-section { display: grid; gap: 12px; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--bg-soft); }
.quote-section legend { padding: 0 6px; font-size: 14px; font-weight: 800; color: var(--text); }
.quote-color-rows { display: grid; gap: 10px; }
.quote-color-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(110px, auto) minmax(120px, 180px); gap: 10px; align-items: end; }
.quote-color-row .color-chip { margin: 0; align-self: center; }
.quote-time-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quote-summary { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); }
.quote-summary span { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--field); }
.inline-price-form { display: grid; grid-template-columns: minmax(90px, 120px) minmax(92px, 110px) auto; gap: 8px; align-items: center; }
.price-unit-form { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(92px, 120px); gap: 8px; }
.status-form { grid-template-columns: minmax(220px, 360px) auto; justify-content: start; align-items: end; }
.status-form button { align-self: end; }
.file-picker { border: 1px dashed var(--line-strong); padding: 16px; border-radius: 8px; background: var(--bg-soft); }
.footer { color: var(--muted); font-size: 13px; padding: 20px clamp(16px, 4vw, 40px); text-align: center; }
@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .main { padding-top: 20px; }
  .split { grid-template-columns: 1fr; }
  .quote-color-row { grid-template-columns: 1fr; }
  .quote-time-row { grid-template-columns: 1fr; }
  .inline-row { grid-template-columns: 1fr; }
  .inline-price-form { grid-template-columns: 1fr; }
  .price-unit-form { grid-template-columns: 1fr; }
  .request-card-main { grid-template-columns: 1fr; }
  .request-meta { grid-template-columns: 1fr; }
  .status-form { grid-template-columns: 1fr; }
  .list-controls { grid-template-columns: 1fr; }
  .toolbar > .button, .auth-wrap button, .status-form button, form.stack > button[type="submit"] { width: 100%; }
  .nav { width: 100%; }
  .nav a, .nav form, .nav button { flex: 1 1 auto; }
}

