:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #07111f;
  color: #eaf3ff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
.fleet-service-alert { display: block; margin-top: 5px; width: fit-content; }
.fleet-inventory-table { min-width: 1060px; }
.fleet-inventory-table .badge { white-space: nowrap; overflow-wrap: normal; }
.fleet-inventory-table .badge-overdue, #service-schedule .badge-overdue { color: #ffe0da; background: #51251f; border-color: #a84e3f; }
.fleet-details summary, .fleet-schedule-edit summary, .service-entry summary { cursor: pointer; color: #bfffd3; font-weight: 600; }
.fleet-details[open] > summary, .fleet-schedule-edit[open] > summary { margin-bottom: 22px; }
.fleet-schedule-edit { margin-top: 22px; }
.fleet-history-heading { gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.service-entry { border-top: 1px solid #294252; padding: 18px 0; }
.service-entry:last-child { padding-bottom: 0; }
.service-entry summary { overflow-wrap: anywhere; }
.service-entry-date { display: inline-block; margin-right: 16px; font-variant-numeric: tabular-nums; }
.service-entry-title { margin-right: 16px; white-space: pre-line; }
.service-entry .detail-grid { margin-top: 22px; }
.service-entry .wide { grid-column: 1 / -1; }
body { margin: 0; min-width: 320px; background: #07111f; }
a { color: #85e5ad; text-decoration: none; }
a:hover { color: #c7ffdc; text-decoration: underline; }
button, input, select, textarea { font: inherit; }

.topbar {
  min-height: 86px; display: flex; align-items: center; gap: 32px;
  padding: 12px max(24px, calc((100vw - 1440px) / 2));
  background: #091827; border-bottom: 1px solid #25415a;
}
.brand { display: flex; align-items: center; gap: 10px; color: #dfffea; white-space: nowrap; }
.topbar > .brand { min-width: 0; }
.brand img { display: block; width: 142px; height: 70px; object-fit: contain; object-position: center; border: 2px solid #2f5aa8; border-radius: 5px; background: #fff; }
.brand span { min-width: 0; overflow: hidden; color: #fff; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: 12px; letter-spacing: .03em; text-overflow: ellipsis; text-transform: uppercase; }
nav { display: flex; align-items: center; gap: 8px; flex: 1; }
nav a { padding: 9px 12px; border-radius: 6px; color: #d2e2f1; }
nav a:hover { background: #17334b; text-decoration: none; }
.account { display: flex; align-items: center; gap: 12px; color: #a9bfd3; font-size: 13px; white-space: nowrap; }
.account form { margin: 0; }

.page { max-width: 1440px; margin: 0 auto; padding: 38px 28px 64px; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 440px); padding: 34px; background: #0d1c2d; border: 1px solid #29445f; border-top: 3px solid #3cb371; border-radius: 12px; box-shadow: 0 20px 60px #0005; }
.eyebrow { margin: 0 0 8px; color: #63bd8a; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(27px, 4vw, 36px); letter-spacing: -.025em; }
h2 { font-size: 18px; }
.muted { color: #9bb0c4; }
.small { font-size: 12px; margin: 14px 0 0; }
.stack { display: grid; gap: 18px; margin-top: 25px; }
label { display: grid; gap: 7px; color: #c7d7e6; font-size: 13px; font-weight: 650; }
label .muted { font-size: 12px; font-weight: 400; }
input, select, textarea {
  width: 100%; min-width: 0; padding: 11px 12px; color: #f0f6ff;
  background: #071321; border: 1px solid #31506b; border-radius: 6px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #3cb371; outline-offset: 1px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 15px; color: #e4eff8; background: #16314a;
  border: 1px solid #31506b; border-radius: 6px; cursor: pointer; font-weight: 700;
  text-decoration: none;
}
.button:hover { color: white; background: #1b4059; border-color: #3cb371; text-decoration: none; }
.button.primary { color: #f3fff7; background: #187747; border-color: #3cb371; }
.button.primary:hover { background: #218d56; }
.button.subtle { min-height: 34px; padding: 6px 10px; color: #b4c7d8; background: transparent; border-color: transparent; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric, .panel { background: linear-gradient(145deg, #122640, #0c1a2a); border: 1px solid #294761; border-top: 2px solid #2c8a61; border-radius: 9px; }
.metric { display: grid; gap: 10px; padding: 20px; }
.metric span { color: #a9bfd3; font-size: 13px; }
.metric strong { font-size: 31px; }
.metric .metric-date { font-size: 21px; overflow-wrap: anywhere; }
.panel { padding: 22px; margin-bottom: 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; }
.section-heading h2 { margin-bottom: 16px; }
.repair-count { font-size: 13px; font-weight: 500; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th { padding: 11px 12px; color: #bfffd3; background: #142b42; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.sort-button { padding: 0; color: inherit; background: transparent; border: 0; font: inherit; text-align: left; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.sort-button::after { content: "↕"; margin-left: 7px; color: #7893a8; }
th[aria-sort="ascending"] .sort-button::after { content: "↑"; color: #8de9b1; }
th[aria-sort="descending"] .sort-button::after { content: "↓"; color: #8de9b1; }
.sort-button:focus-visible { outline: 2px solid #3cb371; outline-offset: 3px; }
td { padding: 12px; color: #d7e4f0; border-bottom: 1px solid #223b52; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #142e3d; }
.clickable-row:focus-visible { outline: 2px solid #3cb371; outline-offset: -2px; }
.badge { display: inline-block; max-width: 220px; padding: 4px 8px; overflow-wrap: anywhere; color: #b9f4ce; background: #153b32; border: 1px solid #285e46; border-radius: 99px; font-size: 11px; }
.badge-overdue { color: #ffe0da; background: #51251f; border-color: #a84e3f; }
.empty { padding: 32px 16px; color: #9bb0c4; text-align: center; }
.search { display: flex; gap: 10px; margin: 0 0 18px; }
.search input { flex: 1; }
.repair-filters { display: grid; gap: 16px; }
.repair-filter-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, .32fr); gap: 14px; align-items: end; }
.repair-status-filter { min-width: 0; margin: 0; padding: 0; border: 0; }
.repair-status-filter legend { margin-bottom: 9px; color: #c7d7e6; font-size: 13px; font-weight: 700; }
.repair-status-filter legend .muted { margin-left: 6px; font-size: 11px; font-weight: 400; }
.repair-status-options { display: flex; flex-wrap: wrap; gap: 8px; }
.repair-status-option { display: inline-flex; grid-auto-flow: column; align-items: center; gap: 7px; min-height: 38px; padding: 7px 11px; color: #b9cbd8; background: #0a1a29; border: 1px solid #294761; border-radius: 99px; cursor: pointer; }
.repair-status-option:has(input:checked) { color: #eafff3; background: #12372f; border-color: #45b980; }
.repair-status-option input[type="checkbox"] { flex: 0 0 auto; width: 17px; min-width: 0; height: 17px; min-height: 0; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; accent-color: #45e878; }
.repair-filter-actions { display: flex; justify-content: flex-end; gap: 10px; }
.section-tabs { display: flex; gap: 8px; margin: -8px 0 20px; padding: 0 2px; border-bottom: 1px solid #294761; }
.section-tab { padding: 10px 14px; color: #a9bfd3; border-bottom: 3px solid transparent; text-decoration: none; }
.section-tab:hover { color: #e5f2f7; text-decoration: none; }
.section-tab.active { color: #bfffd3; border-bottom-color: #3cb371; }
.price-list-upload { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.5fr) minmax(240px, 2fr) auto; align-items: end; gap: 14px; }
.price-list-upload input[type="file"] { padding: 8px; }
.manual-upload { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr) minmax(170px, 1fr) auto; align-items: end; gap: 14px; }
.manual-upload input[type="file"] { padding: 8px; }
.manual-actions { min-width: 170px; }
.manual-actions details { margin-bottom: 8px; }
.manual-actions summary { color: #85e5ad; cursor: pointer; }
.manual-edit { display: grid; gap: 10px; min-width: 220px; padding: 10px 0; }
.manual-actions form { margin-top: 6px; }
.record-form { padding: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.field-group { min-width: 0; margin: 0; padding: 16px; border: 1px solid #31506b; border-radius: 6px; }
.field-group legend { padding: 0 7px; color: #c7d7e6; font-size: 13px; font-weight: 700; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 22px; }
.account-actions { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.account-actions form { margin: 0; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.clipboard-status { min-height: 1.25rem; margin: -6px 0 10px; text-align: right; }
.detail-panel h2 { margin-bottom: 18px; color: #bfffd3; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 24px; margin: 0; }
.detail-grid > div { min-width: 0; }
.detail-grid dt { margin-bottom: 5px; color: #9bb0c4; font-size: 12px; font-weight: 700; }
.detail-grid dd { margin: 0; color: #e0eaf3; overflow-wrap: anywhere; white-space: pre-wrap; }
.reported-problems-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.workflow-panel .section-heading { gap: 14px; }
.workflow-panel .section-heading h2 { margin-bottom: 0; }
.workflow-progress { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin: 26px 0 0; padding: 0; list-style: none; }
.workflow-step { position: relative; min-width: 0; padding: 28px 12px 0 0; color: #9bb0c4; font-size: 12px; }
.workflow-step::before, .workflow-step::after { position: absolute; top: 5px; content: ""; }
.workflow-step::before { z-index: 1; left: 0; width: 12px; height: 12px; background: #0b1b2a; border: 2px solid #577086; border-radius: 50%; }
.workflow-step::after { left: 12px; right: 0; height: 2px; background: #294761; }
.workflow-step:last-child::after { display: none; }
.workflow-step.is-complete { color: #bfffd3; }
.workflow-step.is-complete::before { background: #3cb371; border-color: #8de9b1; }
.workflow-step.is-complete::after { background: #3cb371; }
.workflow-step.is-current { color: #f3fff7; font-weight: 750; }
.workflow-step.is-current::before { background: #59d58b; border-color: #c7ffdc; box-shadow: 0 0 12px #45e878aa; animation: workflow-activate 900ms ease-out 1; }
.workflow-step-label { display: block; overflow-wrap: anywhere; }
@keyframes workflow-activate {
  0% { box-shadow: 0 0 0 0 #45e878aa; transform: scale(.75); }
  65% { box-shadow: 0 0 0 9px #45e87800; transform: scale(1.2); }
  100% { box-shadow: 0 0 12px #45e878aa; transform: scale(1); }
}
.pdf-viewer-panel { padding: 10px; }
.pdf-viewer { display: block; width: 100%; height: min(78vh, 1000px); min-height: 480px; background: #fff; border: 0; border-radius: 5px; }
.account-panel { padding-bottom: 26px; }
.password-form { max-width: 620px; }
.account-picker { display: grid; gap: 12px; padding: 16px; border: 1px solid #31506b; border-radius: 6px; }
.account-picker legend { padding: 0 7px; color: #c7d7e6; font-size: 13px; font-weight: 700; }
.checkbox-label { display: flex; align-items: center; gap: 8px; }
.checkbox-label input { width: auto; }
.unread-indicator { display: inline-block; width: 9px; height: 9px; margin-left: 3px; vertical-align: 1px; background: #45e878; border: 1px solid #baffca; border-radius: 50%; box-shadow: 0 0 8px #45e878aa; }
.unread-badge { display: inline-block; padding: 3px 8px; color: #f3fff7; background: #187747; border: 1px solid #3cb371; border-radius: 99px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.conversation-list { display: grid; gap: 10px; }
.conversation-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px; color: #eaf3ff; background: #0b1b2a; border: 1px solid #294761; border-radius: 7px; }
.conversation-card:hover { background: #142e3d; border-color: #3cb371; text-decoration: none; }
.conversation-card-link { display: grid; min-width: 0; gap: 8px; color: inherit; }
.conversation-card-link:hover { text-decoration: none; }
.conversation-card form { margin: 0; }
.conversation-card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.conversation-preview { overflow: hidden; color: #a9bfd3; text-overflow: ellipsis; white-space: nowrap; }
.message-thread { display: grid; gap: 12px; max-height: 62vh; overflow-y: auto; }
.message { max-width: min(82%, 760px); padding: 12px 15px; background: #0b1b2a; border: 1px solid #294761; border-radius: 9px; }
.message-own { justify-self: end; background: #123226; border-color: #327b61; }
.message-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; color: #bfffd3; font-size: 12px; }
.message-meta time { color: #9bb0c4; font-size: 11px; }
.message-meta form { margin: 0 0 0 auto; }
.message p { margin: 8px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.message .read-receipt { margin-top: 10px; color: #8de9b1; font-size: 11px; }
.read-confirm-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.read-confirm-panel p { margin: 0; }
.message-compose textarea { margin-top: 8px; }
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.attachment-card { min-width: 0; overflow: hidden; background: #0b1b2a; border: 1px solid #294761; border-radius: 7px; }
.attachment-thumbnail { display: block; width: 100%; max-height: 230px; object-fit: cover; background: #071321; }
.attachment-info { display: grid; gap: 7px; padding: 12px; overflow-wrap: anywhere; }
.attachment-info p { margin: 0; color: #d7e4f0; white-space: pre-wrap; }
.attachment-info .small { margin: 0; }
.attachment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.attachment-actions form { margin: 0; }
.message-attachments { display: grid; gap: 8px; margin-top: 10px; }
.message-thumbnail { display: block; width: min(100%, 360px); max-height: 280px; object-fit: contain; border: 1px solid #31506b; border-radius: 5px; background: #071321; }
.message-attachments .attachment-actions { font-size: 12px; }
.message-compose .form-actions { justify-content: space-between; }
.text-button { padding: 3px; color: #85e5ad; background: none; border: 0; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.text-button.danger { color: #ffaaa8; }
.messages { display: grid; gap: 8px; margin-bottom: 18px; }
.notice { margin: 0; padding: 12px 14px; border: 1px solid #31506b; border-radius: 6px; background: #102238; }
.notice.error { color: #ffd0cf; border-color: #854a4a; background: #321b22; }
.notice.success { color: #c8f8d9; border-color: #327b61; background: #123226; }
.error-card { max-width: 620px; margin: 10vh auto; }
.error-card p { color: #b7cadb; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 780px) {
  .topbar { flex-wrap: wrap; gap: 10px 18px; padding: 12px 18px; }
  nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  nav a { padding: 8px; }
  .account { margin-left: auto; }
  .page { padding: 26px 16px 44px; }
  .metrics { gap: 10px; }
  .metric { padding: 14px; }
  .metric strong { font-size: 26px; }
  .manual-upload { grid-template-columns: 1fr 1fr; }
  .price-list-upload { grid-template-columns: 1fr 1fr; }
  .workflow-progress { grid-template-columns: 1fr; gap: 0; margin-top: 20px; }
  .workflow-step { min-height: 46px; padding: 0 0 14px 30px; }
  .workflow-step::before { top: 1px; left: 2px; }
  .workflow-step::after { top: 13px; bottom: 0; left: 7px; right: auto; width: 2px; height: auto; }
}
@media (max-width: 560px) {
  .metrics, .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { flex-wrap: wrap; }
  .detail-grid { grid-template-columns: 1fr; }
  .manual-upload { grid-template-columns: 1fr; }
  .price-list-upload { grid-template-columns: 1fr; }
  .section-tabs { overflow-x: auto; }
  .section-tab { white-space: nowrap; }
  .auth-card { padding: 25px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Futuristic workshop visual layer */
:root {
  color-scheme: dark;
  font-family: "Bahnschrift", "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  --cns-bg: #050b13;
  --cns-panel: #0b1724;
  --cns-panel-raised: #101f30;
  --cns-line: #243c50;
  --cns-line-bright: #31566b;
  --cns-text: #e5f2f7;
  --cns-muted: #92aab8;
  --cns-green: #62f0a0;
  --cns-cyan: #54d9ed;
  --cns-amber: #ffbf69;
  background: var(--cns-bg);
  color: var(--cns-text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html { min-height: 100%; scroll-behavior: smooth; }
body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  color: var(--cns-text);
  background:
    radial-gradient(ellipse at 12% -8%, #0b393b66 0, transparent 38rem),
    radial-gradient(ellipse at 100% 28%, #11325940 0, transparent 42rem),
    linear-gradient(155deg, #07111b 0%, #050b13 58%, #08121c 100%);
  font-size: 14px;
  line-height: 1.55;
}
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(#6ad9f008 1px, transparent 1px),
    linear-gradient(90deg, #6ad9f008 1px, transparent 1px);
  background-size: 44px 44px;
  content: "";
  pointer-events: none;
  mask-image: linear-gradient(to bottom, #000 0%, #0008 55%, transparent 100%);
}
a { color: var(--cns-green); transition: color 160ms ease, text-shadow 160ms ease; }
a:hover { color: #b9ffd6; text-shadow: 0 0 14px #62f0a044; }
::selection { color: #03120e; background: var(--cns-green); }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 76px;
  gap: 20px;
  padding-top: 11px;
  padding-bottom: 11px;
  background: #07121eeb;
  border-bottom: 1px solid #54d9ed2b;
  box-shadow: 0 10px 35px #0005, inset 0 -1px #62f0a00b;
  backdrop-filter: blur(18px) saturate(135%);
}
.topbar::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #54d9ed88 22%, #62f0a066 72%, transparent);
  content: "";
  pointer-events: none;
}
.brand { align-items: center; gap: 11px; }
.brand strong {
  color: var(--cns-green);
  font-family: "Bahnschrift", "Aptos Display", "Segoe UI Variable", sans-serif;
  font-size: 29px;
  letter-spacing: .055em;
  text-shadow: 0 0 22px #62f0a055;
}
.brand span {
  max-width: 165px;
  padding-left: 11px;
  color: #92afbd;
  border-left: 1px solid #54d9ed44;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
nav { min-width: 0; gap: 4px; }
nav a {
  position: relative;
  padding: 8px 10px;
  color: #bdd0d8;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .015em;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
nav a:hover {
  color: #eafff3;
  background: #102a35;
  border-color: #54d9ed35;
  box-shadow: inset 0 0 18px #54d9ed0c;
  text-decoration: none;
  text-shadow: none;
}
.account {
  padding: 5px 7px 5px 12px;
  color: #bbced6;
  background: #0b1925;
  border: 1px solid #243c50;
  border-radius: 8px;
}
.account > span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

.page {
  max-width: 1500px;
  padding-top: clamp(28px, 4vw, 52px);
  animation: cns-page-arrive 420ms cubic-bezier(.2, .75, .25, 1) both;
}
.auth-page { background: transparent; }
.auth-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 100% 0%, #54d9ed12, transparent 55%),
    linear-gradient(145deg, #101f30f5, #08131ef5);
  border: 1px solid #31566b;
  border-top: 1px solid #62f0a088;
  border-radius: 14px;
  box-shadow: 0 28px 90px #0008, 0 0 50px #54d9ed0b, inset 0 1px #ffffff09;
  animation: cns-card-arrive 520ms cubic-bezier(.2, .75, .25, 1) both;
}
.auth-card::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 110px;
  height: 110px;
  background: linear-gradient(135deg, transparent 49.5%, #54d9ed2d 50%, transparent 51%);
  content: "";
  pointer-events: none;
}
.eyebrow {
  color: var(--cns-cyan);
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 10px;
  letter-spacing: .16em;
}
h1, h2 { color: #e8f5f8; }
h1 {
  font-family: "Bahnschrift", "Aptos Display", "Segoe UI Variable", sans-serif;
  font-size: clamp(30px, 4.1vw, 42px);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.08;
  text-wrap: balance;
}
h2 { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.muted { color: var(--cns-muted); }
.small, .repair-count { font-family: "Cascadia Code", "Consolas", monospace; font-size: 11px; }

.page-heading {
  position: relative;
  align-items: flex-end;
  padding-bottom: 18px;
  border-bottom: 1px solid #54d9ed1a;
}
.page-heading::after {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: min(180px, 34%);
  height: 1px;
  background: linear-gradient(90deg, var(--cns-green), transparent);
  content: "";
}
.heading-actions { flex-wrap: wrap; }
.panel, .metric {
  background:
    linear-gradient(135deg, #ffffff06, transparent 36%),
    linear-gradient(145deg, #101f30f2, #091521f5);
  border: 1px solid var(--cns-line);
  border-top: 1px solid #54d9ed52;
  border-radius: 10px;
  box-shadow: 0 14px 38px #0002, inset 0 1px #ffffff06;
}
.panel { position: relative; padding: clamp(17px, 2.2vw, 25px); }
.panel > .section-heading:first-child { margin-bottom: 4px; }
.detail-panel h2 { color: #9ef4c1; }
.metric {
  position: relative;
  overflow: hidden;
  gap: 13px;
  padding: 22px;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.metric::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 82px;
  height: 82px;
  background: radial-gradient(circle at top right, #54d9ed20, transparent 72%);
  content: "";
  pointer-events: none;
}
.metric span {
  color: #a9c0cb;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.metric strong {
  color: #e9f9f4;
  font-family: "Bahnschrift", "Aptos Display", "Segoe UI Variable", sans-serif;
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 750;
  letter-spacing: -.04em;
  line-height: 1;
  text-shadow: 0 0 26px #54d9ed20;
}
.metric .metric-date { font-size: 23px; }
.metric:hover { transform: translateY(-3px); border-color: #54d9ed72; box-shadow: 0 18px 44px #0004, 0 0 25px #54d9ed0c; }
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 20px 22px;
  background: linear-gradient(110deg, #123c37, #102638 78%);
  border: 1px solid #3c9a78;
  border-radius: 10px;
  box-shadow: 0 12px 30px #0002;
}
.demo-banner h2 { margin: 3px 0 6px; color: #dcfff0; font-size: 19px; }
.demo-banner p:not(.eyebrow) { margin: 0; color: #bfd6d8; }
.demo-banner .eyebrow { margin: 0; color: #8fe2bc; }
.demo-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 6px;
  color: #c9ffe4;
  background: #14523e;
  border: 1px solid #3c9a78;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
  vertical-align: middle;
}

.button {
  position: relative;
  overflow: hidden;
  min-height: 42px;
  padding: 9px 15px;
  color: #d7e9ed;
  background: linear-gradient(145deg, #162b3a, #0d1b28);
  border: 1px solid #315064;
  border-radius: 7px;
  box-shadow: inset 0 1px #ffffff0a, 0 4px 12px #0002;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .015em;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.button:hover {
  color: #f2fffb;
  background: linear-gradient(145deg, #1b3946, #102331);
  border-color: #54d9ed8a;
  box-shadow: 0 0 20px #54d9ed15, inset 0 1px #ffffff14;
  text-decoration: none;
}
.button:active { transform: translateY(1px); }
.button.primary {
  color: #04140f;
  background: linear-gradient(135deg, #7dffb1, #42d990 68%, #29b979);
  border-color: #9bffc2;
  box-shadow: 0 5px 20px #42d99028, inset 0 1px #ffffff70;
}
.button.primary:hover {
  color: #03130e;
  background: linear-gradient(135deg, #a0ffc7, #62f0a0 68%, #3ad08a);
  border-color: #c3ffda;
  box-shadow: 0 0 28px #62f0a044, inset 0 1px #ffffff80;
}
.button.danger {
  color: #ffe2e0;
  background: linear-gradient(135deg, #7e3038, #52242d 68%, #351b25);
  border-color: #bc6269;
}
.button.danger:hover {
  color: #fff5f4;
  background: linear-gradient(135deg, #a53f48, #71303a 68%, #4b222b);
  border-color: #ef9295;
}
.button.subtle { color: #99b5c0; }
.button:focus-visible, .text-button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--cns-cyan);
  outline-offset: 3px;
}

input, select, textarea {
  color: #e7f3f5;
  background: #07121d;
  border: 1px solid #294457;
  border-radius: 7px;
  box-shadow: inset 0 1px 5px #0003;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
input:hover, select:hover, textarea:hover { border-color: #3e6377; }
input:focus, select:focus, textarea:focus {
  outline: none;
  background: #091824;
  border-color: var(--cns-cyan);
  box-shadow: 0 0 0 3px #54d9ed1b, 0 0 18px #54d9ed0d, inset 0 1px 5px #0003;
}
label { color: #bfd0d6; font-size: 12px; letter-spacing: .01em; }
input[type="file"] { color: var(--cns-muted); }
input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 7px 10px;
  color: #c8f9dd;
  background: #123329;
  border: 1px solid #2d7956;
  border-radius: 5px;
  cursor: pointer;
}

.table-wrap { border: 1px solid #20384b; border-radius: 7px; }
table { font-size: 12px; }
th {
  color: #8ee8ea;
  background: linear-gradient(180deg, #122839, #0d1e2c);
  border-bottom: 1px solid #31556a;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 9px;
  letter-spacing: .11em;
}
td { color: #d1e0e3; border-bottom-color: #203547; }
tbody tr { transition: background 140ms ease, box-shadow 140ms ease; }
tbody tr:hover td { background: #14304080; }
.clickable-row:hover td { background: #12343c; }
.badge {
  color: #aaf6ca;
  background: #12352c;
  border-color: #2c7050;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .015em;
}
.empty { border: 1px dashed #315064; border-radius: 7px; background: #08152180; }
.dashboard-heading { margin-bottom: 18px; }
.dashboard-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.dashboard-stats article { min-width: 145px; padding: 12px 15px; background: #0b1724; border: 1px solid var(--cns-line); border-radius: 8px; }
.dashboard-stats span { display: block; color: var(--cns-muted); font-family: "Cascadia Code", "Consolas", monospace; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-stats strong { display: block; margin-top: 2px; color: var(--cns-text); font-size: 24px; line-height: 1; }
.dashboard-stats .attention strong { color: var(--cns-amber); }
.dashboard-stats .ready strong { color: var(--cns-green); }
.dashboard-focus-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(235px, 1fr); align-items: start; gap: 16px; }
.dashboard-queue-panel { min-width: 0; }
.dashboard-queue-panel .section-heading { align-items: flex-start; gap: 16px; margin-bottom: 15px; }
.dashboard-queue-panel .section-heading h2, .dashboard-queue-panel .section-heading p { margin-bottom: 4px; }
.dashboard-queue-table { min-width: 820px; }
.dashboard-queue-table td:first-child { min-width: 175px; }
.dashboard-queue-table td:nth-child(2) { min-width: 150px; }
.dashboard-queue-table td:nth-child(4) { min-width: 230px; }
.dashboard-queue-table tr.queue-row-overdue td:first-child { box-shadow: inset 3px 0 #ffbf69; }
.dashboard-queue-table tr.queue-row-ready td:first-child { box-shadow: inset 3px 0 #62f0a0; }
.queue-note { display: block; margin-top: 4px; color: var(--cns-muted); font-size: 10px; }
.queue-note.overdue { color: #ffc979; font-weight: 700; }
.dashboard-status-form { display: grid; grid-template-columns: minmax(150px, 1fr) auto; align-items: center; gap: 7px; margin: 0; }
.dashboard-status-form select { min-height: 34px; padding: 6px 8px; font-size: 11px; }
.button.compact { min-height: 34px; padding: 6px 10px; font-size: 10px; }
.dashboard-attention-panel { display: grid; gap: 9px; }
.dashboard-attention-panel > .section-heading { margin-bottom: 2px; }
.dashboard-attention-panel > .section-heading h2 { margin-bottom: 0; }
.attention-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 10px; padding: 12px; color: var(--cns-text); background: #111d28; border: 1px solid #54452d; border-radius: 7px; }
.attention-item:hover { color: var(--cns-text); background: #172633; border-color: #8c6b37; text-decoration: none; }
.attention-item strong { grid-row: 1 / 3; align-self: center; min-width: 24px; color: var(--cns-amber); font-size: 22px; text-align: center; }
.attention-item span { font-size: 12px; font-weight: 700; }
.attention-item small { color: var(--cns-muted); font-size: 10px; }
.attention-item.ready { border-color: #2c7050; }
.attention-item.ready strong { color: var(--cns-green); }
.attention-item.is-clear { background: #0a1722; border-color: var(--cns-line); opacity: .7; }
.attention-item.is-clear strong { color: #7f98a5; }
.dashboard-permission-note { margin: 5px 2px 0; color: var(--cns-muted); font-size: 10px; line-height: 1.5; }
.search { align-items: center; }
.search input { min-height: 44px; }
.sort-button:focus-visible { outline-color: var(--cns-cyan); }

.conversation-card, .attachment-card {
  background: linear-gradient(145deg, #101f30, #091521);
  border-color: var(--cns-line);
  border-radius: 9px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.conversation-card:hover, .attachment-card:hover {
  transform: translateY(-2px);
  border-color: #54d9ed70;
  box-shadow: 0 12px 30px #0003, 0 0 22px #54d9ed0b;
}
.conversation-card { color: var(--cns-text); }
.conversation-card:hover { background: linear-gradient(145deg, #132b3b, #0b1a26); }
.message { background: linear-gradient(145deg, #101f30, #0a1723); border-color: #294457; }
.message-own { background: linear-gradient(145deg, #12392f, #0b241f); border-color: #2c795c; }
.message-meta { color: #9cf2bf; }
.attachment-thumbnail, .message-thumbnail { background: #050b13; }
.notice { background: #0e2030eF; border-color: #315064; border-radius: 8px; box-shadow: 0 8px 24px #0002; }
.notice.success { color: #c7ffdc; background: #0d2a22; border-color: #2d7956; }
.notice.error { color: #ffd4d1; background: #301b20; border-color: #874b54; }
.unread-indicator { background: var(--cns-green); box-shadow: 0 0 12px #62f0a0a0; }
.unread-badge { color: #03130e; background: var(--cns-green); border-color: #a0ffc7; }
.workflow-step.is-current::before { background: var(--cns-green); box-shadow: 0 0 16px #62f0a077; }
.workflow-step.is-complete::before { background: #35ca87; }
.workflow-step.is-complete::after { background: #35ca87; }
.text-button { color: var(--cns-green); }
.text-button.danger { color: #ff9692; }
.pdf-viewer { box-shadow: 0 0 0 1px #315064, 0 12px 38px #0005; }
.quote-sheet { max-width: 1050px; margin-right: auto; margin-left: auto; padding: clamp(22px, 4vw, 48px); }
.quote-brand { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid #315064; }
.quote-brand img { display: block; width: 260px; height: 135px; object-fit: contain; object-position: center; border: 2px solid #2f5aa8; border-radius: 4px; background: #fff; }
.quote-brand span { color: #2f5aa8; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: 17px; letter-spacing: .04em; text-transform: uppercase; }
.quote-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 28px 0; }
.quote-title-row h2 { margin: 0; font-size: 25px; }
.quote-meta, .quote-machine, .quote-issues { display: grid; gap: 12px 22px; margin: 0; }
.quote-meta { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
.quote-machine { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quote-issues { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quote-meta dt, .quote-machine dt, .quote-issues dt { margin-bottom: 3px; color: var(--cns-muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.quote-meta dd, .quote-machine dd, .quote-issues dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.quote-block { margin-top: 26px; }
.quote-block h3 { margin: 0 0 12px; color: #9ef4c1; font-size: 13px; letter-spacing: .04em; }
.quote-block > p { margin: 0; white-space: pre-wrap; }
.quote-block .section-heading { align-items: baseline; }
.quote-block .section-heading h3 { margin-bottom: 12px; }
.quote-parts-table { min-width: 760px; }
.quote-totals { display: grid; justify-content: end; gap: 8px; margin-top: 16px; }
.quote-totals > div { display: flex; justify-content: space-between; gap: 24px; min-width: 280px; padding: 10px 13px; background: #0b1a25; border: 1px solid #294457; border-radius: 6px; }
.quote-totals span { color: var(--cns-muted); }
.quote-totals strong { color: #c7ffdc; font-family: "Cascadia Code", "Consolas", monospace; }
.quote-labor { padding: 15px; background: #0b1b23; border-left: 2px solid var(--cns-cyan); }
.quote-labor p { font-size: 17px; font-weight: 750; }
.quote-labor .muted { font-size: 12px; }
.quote-disclaimer { margin: 28px 0 0; padding-top: 14px; color: var(--cns-muted); border-top: 1px solid #294457; font-size: 11px; }
.customer-edit-panel > h2 { margin-bottom: 10px; }
.customer-action-form { display: grid; max-width: 650px; gap: 14px; }
.customer-action-form > p { margin: 0; }
@media (max-width: 780px) {
  .dashboard-focus-grid { grid-template-columns: 1fr; }
  .dashboard-attention-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-attention-panel > .section-heading, .dashboard-permission-note { grid-column: 1 / -1; }
  .quote-machine { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .dashboard-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-stats article { min-width: 0; padding: 10px; }
  .dashboard-stats strong { font-size: 21px; }
  .dashboard-attention-panel { grid-template-columns: 1fr; }
  .demo-banner { align-items: flex-start; flex-direction: column; }
  .quote-title-row { flex-direction: column; }
  .quote-meta, .quote-issues { grid-template-columns: 1fr; }
}
@media print {
  @page { margin: 16mm; }
  body { color: #15212a; background: white; font: 10pt/1.4 "Segoe UI", sans-serif; }
  body::before, .topbar, .quote-actions, .clipboard-status, .messages { display: none !important; }
  .page { max-width: none; padding: 0; animation: none; }
  .quote-sheet { max-width: none; padding: 0; overflow: visible; color: #15212a; background: white; border: 0; box-shadow: none; }
  .quote-brand { border-color: #aab8c0; }
  .quote-brand span, .quote-block h3, .quote-totals strong { color: #145d42; }
  .quote-title-row h2, .quote-machine dd, .quote-issues dd, .quote-meta dd { color: #15212a; }
  .quote-meta dt, .quote-machine dt, .quote-issues dt, .quote-disclaimer, .quote-labor .muted { color: #52636c; }
  .quote-labor { background: #f1f7f8; border-left-color: #217c87; }
  .quote-totals > div { background: white; border-color: #aab8c0; }
  .quote-totals span { color: #394b55; }
  .table-wrap { overflow: visible; border-color: #aab8c0; }
  .quote-parts-table { min-width: 0; font-size: 8pt; }
  .quote-parts-table th { color: #143e4a; background: #e9f1f2; }
  .quote-parts-table td { color: #15212a; border-color: #d1dade; }
  .quote-block, .quote-totals, .quote-labor { break-inside: avoid; }
}
@keyframes cns-page-arrive {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cns-card-arrive {
  from { opacity: 0; transform: translateY(12px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  nav { gap: 2px; }
  nav a { padding: 8px; font-size: 11px; }
}
@media (max-width: 780px) {
  .topbar { position: relative; gap: 10px 14px; background: #07121ef5; }
  nav { padding: 3px 0 2px; scrollbar-color: #31566b transparent; }
  nav a { flex: 0 0 auto; }
  .page { padding-top: 28px; }
  .metric:hover, .conversation-card:hover, .attachment-card:hover { transform: none; }
}
@media (max-width: 560px) {
  .brand span { font-size: 9px; letter-spacing: .08em; }
  .account { gap: 7px; padding-left: 8px; }
  .account > span { max-width: 90px; }
  .page-heading { padding-bottom: 14px; }
  .panel { padding: 16px; }
  .button { min-height: 40px; }
  .conversation-card { grid-template-columns: 1fr; }
  .conversation-card form { justify-self: end; }
  .read-confirm-panel { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile app shell */
.mobile-menu-toggle, .mobile-menu-sheet, .mobile-nav-backdrop, .mobile-tabbar { display: none; }
.desktop-nav a[aria-current="page"] {
  color: #edfff5;
  background: #12372f;
  border-color: #32956b;
  box-shadow: inset 0 -2px #62f0a0;
}

@media screen and (min-width: 781px) {
  .topbar {
    padding-right: max(18px, calc((100vw - 1680px) / 2));
    padding-left: max(18px, calc((100vw - 1680px) / 2));
  }
  .topbar > .brand, .topbar > .account { flex: 0 0 auto; }
  .desktop-nav {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .desktop-nav::-webkit-scrollbar { display: none; }
  .desktop-nav a { flex: 0 0 auto; }
}

@media screen and (min-width: 781px) and (max-width: 1550px) {
  .topbar > .brand span { display: none; }
}

@media screen and (max-width: 780px) {
  html { background: #050b13; }
  body { min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.mobile-nav-open { overflow: hidden; }
  body::before { background-size: 34px 34px; opacity: .7; }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: calc(64px + env(safe-area-inset-top));
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 12px;
    padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
    background: #07121ef2;
    border-bottom-color: #31566b;
    box-shadow: 0 8px 24px #0008;
  }
  .topbar .desktop-nav, .topbar .account { display: none; }
  .topbar > .brand { flex: 1; width: auto; }
  .brand img { width: 82px; height: 46px; border-width: 1px; border-radius: 7px; }
  .brand span {
    display: block;
    max-width: 170px;
    padding-left: 9px;
    overflow: visible;
    border-left-color: #54d9ed33;
    font-size: 9px;
    line-height: 1.35;
    text-overflow: clip;
    white-space: normal;
  }
  .mobile-menu-toggle {
    display: grid;
    width: 44px;
    height: 44px;
    place-content: center;
    gap: 5px;
    padding: 0;
    color: var(--cns-text);
    background: #102230;
    border: 1px solid #315064;
    border-radius: 12px;
  }
  .mobile-menu-toggle span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 99px; }

  .mobile-nav-backdrop {
    position: fixed;
    z-index: 48;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    background: #01070db8;
    border: 0;
    opacity: 0;
    backdrop-filter: blur(3px);
    transition: opacity 180ms ease;
    pointer-events: none;
  }
  .mobile-menu-sheet {
    position: fixed;
    z-index: 50;
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex;
    width: min(88vw, 370px);
    padding: 18px;
    overflow-y: auto;
    flex-direction: column;
    background: linear-gradient(155deg, #13283a, #07131f 72%);
    border: 1px solid #3c6276;
    border-radius: 18px;
    box-shadow: -18px 0 60px #000b, inset 0 1px #ffffff12;
    opacity: 0;
    transform: translateX(calc(100% + 24px));
    transition: transform 220ms cubic-bezier(.22, .8, .25, 1), opacity 180ms ease;
    pointer-events: none;
  }
  .mobile-nav-open .mobile-nav-backdrop { display: block; opacity: 1; pointer-events: auto; }
  .mobile-nav-open .mobile-menu-sheet { opacity: 1; transform: translateX(0); pointer-events: auto; }
  .mobile-menu-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 2px 2px 16px; border-bottom: 1px solid #315064; }
  .mobile-menu-heading .eyebrow { display: block; margin-bottom: 2px; }
  .mobile-menu-heading strong { font-size: 17px; overflow-wrap: anywhere; }
  .mobile-menu-close {
    width: 44px;
    height: 44px;
    padding: 0;
    color: #d5e8ee;
    background: #142838;
    border: 1px solid #315064;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
  }
  .mobile-menu-nav { display: grid; gap: 5px; margin: 14px 0; }
  .mobile-menu-nav a {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    padding: 11px 13px;
    color: #c9dbe2;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
  }
  .mobile-menu-nav a[aria-current="page"] { color: #eafff3; background: #12372f; border-color: #2d7956; }
  .mobile-menu-nav a:hover { text-decoration: none; }
  .mobile-signout { margin-top: auto; padding-top: 14px; border-top: 1px solid #294457; }
  .mobile-signout .button { width: 100%; min-height: 46px; }

  .mobile-tabbar {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: #07121ef5;
    border-top: 1px solid #31566b;
    box-shadow: 0 -12px 30px #0008;
    backdrop-filter: blur(18px) saturate(140%);
  }
  .mobile-tabbar a, .mobile-tabbar button {
    display: grid;
    min-width: 0;
    min-height: 52px;
    place-items: center;
    align-content: center;
    gap: 1px;
    padding: 3px 2px;
    color: #8fa9b5;
    background: transparent;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
  }
  .mobile-tabbar a > span, .mobile-tabbar button > span { font-size: 21px; line-height: 1; }
  .mobile-tabbar small { font-size: 9px; letter-spacing: .02em; }
  .mobile-tabbar a[aria-current="page"], .mobile-tabbar button[aria-expanded="true"] { color: var(--cns-green); background: #123329; }
  .mobile-tabbar .mobile-new-repair { color: #04140f; }
  .mobile-new-repair > span {
    display: grid;
    width: 40px;
    height: 40px;
    margin-top: -18px;
    place-items: center;
    color: #04140f;
    background: linear-gradient(135deg, #86ffb7, #3bd38b);
    border: 2px solid #b7ffd1;
    border-radius: 50%;
    box-shadow: 0 7px 22px #45e87855;
    font-size: 28px !important;
  }
  .mobile-new-repair small { color: #a8c0ca; }

  .page { width: 100%; padding: 20px 12px 34px; }
  .messages { margin-bottom: 12px; }
  .notice { padding: 11px 12px; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 14px; margin-bottom: 18px; padding-bottom: 14px; }
  .page-heading h1 { font-size: clamp(27px, 8vw, 34px); }
  .heading-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .heading-actions .button { width: 100%; min-height: 44px; }
  .heading-actions .button.primary:last-child { grid-column: 1 / -1; }
  .panel { padding: 15px; margin-bottom: 14px; border-radius: 12px; }
  .metric { padding: 14px; }
  .section-heading { gap: 10px; }
  .section-heading h2 { margin-bottom: 12px; }
  input, select, textarea { min-height: 46px; padding: 11px 12px; font-size: 16px; }
  textarea { min-height: 104px; }
  .button, button, summary { touch-action: manipulation; }
  .button { min-height: 44px; }
  .search { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .search input { min-height: 46px; }
  .repair-filter-top { grid-template-columns: 1fr; }
  .repair-status-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .repair-status-option { border-radius: 10px; }
  .repair-filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .repair-filter-actions .button { width: 100%; }
  .table-wrap { margin-right: -4px; margin-left: -4px; border-radius: 9px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .form-grid { gap: 14px; }
  .record-form { padding: 15px; }
  .field-group { padding: 12px; }
  .record-form > .form-actions {
    position: sticky;
    z-index: 8;
    bottom: calc(72px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 20px -8px -8px;
    padding: 10px;
    background: #091724ed;
    border: 1px solid #315064;
    border-radius: 12px;
    box-shadow: 0 8px 26px #0009;
    backdrop-filter: blur(14px);
  }
  .record-form > .form-actions .button { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; gap: 14px; }
  .attachment-grid { grid-template-columns: 1fr; }
  .manual-upload, .price-list-upload { grid-template-columns: 1fr; }
  .manual-upload .button, .price-list-upload .button { width: 100%; }
  .section-tabs { margin-right: -12px; margin-left: -12px; padding: 0 12px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .section-tab { min-height: 44px; scroll-snap-align: start; }

  .dashboard-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .dashboard-stats article { min-width: 0; padding: 11px 9px; }
  .dashboard-stats span { font-size: 8px; }
  .dashboard-stats strong { font-size: 23px; }
  .dashboard-attention-panel { grid-template-columns: 1fr; }
  .dashboard-attention-panel > .section-heading, .dashboard-permission-note { grid-column: auto; }
  .dashboard-queue-panel .table-wrap { overflow: visible; border: 0; }
  .dashboard-queue-table, .dashboard-queue-table tbody, .dashboard-queue-table tr, .dashboard-queue-table td { display: block; width: 100%; min-width: 0; }
  .dashboard-queue-table thead { display: none; }
  .dashboard-queue-table tbody { display: grid; gap: 10px; }
  .dashboard-queue-table tr {
    overflow: hidden;
    background: #0a1824;
    border: 1px solid #294457;
    border-radius: 10px;
    box-shadow: 0 8px 20px #0003;
  }
  .dashboard-queue-table tr.queue-row-overdue { border-left: 3px solid var(--cns-amber); }
  .dashboard-queue-table tr.queue-row-ready { border-left: 3px solid var(--cns-green); }
  .dashboard-queue-table tr.queue-row-overdue td:first-child, .dashboard-queue-table tr.queue-row-ready td:first-child { box-shadow: none; }
  .dashboard-queue-table td { min-width: 0 !important; padding: 10px 12px; border-bottom: 1px solid #203547; }
  .dashboard-queue-table td::before { display: block; margin-bottom: 3px; color: #75909d; font-family: "Cascadia Code", "Consolas", monospace; font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
  .dashboard-queue-table td:nth-child(1)::before { content: "Customer"; }
  .dashboard-queue-table td:nth-child(2)::before { content: "Machine"; }
  .dashboard-queue-table td:nth-child(3)::before { content: "Received"; }
  .dashboard-queue-table td:nth-child(4)::before { content: "Workflow"; }
  .dashboard-queue-table td:nth-child(5) { padding: 0; border-bottom: 0; }
  .dashboard-queue-table td:nth-child(5)::before { display: none; }
  .dashboard-queue-table td:nth-child(5) > a { display: flex; min-height: 44px; align-items: center; justify-content: center; background: #102a35; }
  .dashboard-status-form { grid-template-columns: 1fr auto; }
  .dashboard-status-form select, .dashboard-status-form .button { min-height: 44px; }
  .workflow-step { min-height: 50px; }
  .message-thread { max-height: none; }
  .message { max-width: 92%; }
}

@media screen and (max-width: 390px) {
  .brand span { max-width: 135px; font-size: 8px; }
  .heading-actions { grid-template-columns: 1fr; }
  .heading-actions .button.primary:last-child { grid-column: auto; }
  .dashboard-stats span { min-height: 24px; }
  .repair-status-options { grid-template-columns: 1fr; }
}

@media (display-mode: standalone) and (max-width: 780px) {
  .topbar { box-shadow: 0 5px 20px #0007; }
}

/* RTX skin — the glossy glass look from the app icon, applied across the app.
   Wrapped in `screen` so printed quotes and reports stay on white paper. */
@media screen {
  html { background: #05121f; }
  body {
    background:
      radial-gradient(130% 55% at 50% -8%, #1a5790 0%, #0c2c4e 42%, #05121f 100%)
      fixed,
      #05121f;
  }
  body::before { opacity: .4; }

  .topbar {
    background: linear-gradient(180deg, #113a63f5, #081f36ee);
    border-bottom: 1px solid #3f9ae6;
    box-shadow: 0 1px 0 #cfeaff3d inset, 0 0 22px #2b86d940, 0 10px 28px #00060db3;
  }
  .brand img { border-color: #5fb2f0; box-shadow: 0 0 16px #2f8fe066; }
  .brand span { color: #dcefff; border-left-color: #5fb2f073; }
  .desktop-nav a[aria-current="page"] { box-shadow: 0 0 16px #45e87840; }

  .page-heading { border-bottom-color: #2a689f; }
  .page-heading h1 { color: #eef7ff; text-shadow: 0 0 22px #4fb4ff59; }
  .eyebrow { color: #83d6ff; text-shadow: 0 0 14px #4fb4ff4d; }

  .panel, .record-form, .field-group, .metric, .dashboard-stats article,
  .detail-panel, .mobile-menu-sheet {
    background-color: #0b2744;
    background-image:
      linear-gradient(180deg, #ffffff1a, #ffffff00 38%),
      linear-gradient(180deg, #10355c 0%, #0a2137 100%);
    border: 1px solid #3f9ae6;
    box-shadow: 0 1px 0 #cfeaff40 inset, 0 0 22px #2b86d94d, 0 16px 34px #00060dad;
  }
  .field-group legend { color: #a8dcff; text-shadow: 0 0 12px #4fb4ff4d; }
  .panel h2, .detail-panel h2 { text-shadow: 0 0 16px #45e87840; }

  input, select, textarea {
    color: #eef7ff;
    background: linear-gradient(180deg, #04121f, #08203a);
    border: 1px solid #2f7cc4;
    box-shadow: inset 0 3px 9px #000000a6, 0 0 12px #2f7cc433;
  }
  input:focus, select:focus, textarea:focus {
    border-color: #7fdcff;
    box-shadow: inset 0 3px 9px #000000a6, 0 0 0 1px #7fdcff6b, 0 0 20px #39b9ff6b;
    outline: none;
  }
  label { color: #f4faff; }

  .button {
    color: #e3f2ff;
    background: linear-gradient(180deg, #18507f, #0d2d4d);
    border: 1px solid #3f9ae6;
    box-shadow: 0 1px 0 #cfeaff3d inset, 0 0 14px #2b86d93d, 0 6px 16px #00060d8c;
  }
  .button:hover { border-color: #7fdcff; box-shadow: 0 1px 0 #cfeaff52 inset, 0 0 20px #2b86d966, 0 6px 16px #00060d8c; }
  .button.primary {
    color: #042015;
    background: linear-gradient(180deg, #a6ffcb, #32d089);
    border: 1px solid #d6ffe8;
    box-shadow: 0 1px 0 #ffffffc2 inset, 0 0 26px #35ff9b4d, 0 8px 20px #2ad98a5c;
  }
  .button.primary:hover { box-shadow: 0 1px 0 #ffffffd6 inset, 0 0 34px #35ff9b6b, 0 8px 22px #2ad98a73; }
  .button.subtle {
    color: #cfe7fb;
    background: linear-gradient(180deg, #0f2f4f8c, #0a20368c);
    border-color: #2f7cc47a;
    box-shadow: 0 0 12px #2b86d92e;
  }
  .button.subtle:hover { color: #eef7ff; border-color: #7fdcff; }

  .table-wrap { border-color: #2f7cc4; box-shadow: 0 0 18px #2b86d933; }
  thead th { color: #a8dcff; }
  tbody tr:hover { background: #10355c66; }

  .dashboard-queue-table tr {
    background-color: #0b2744;
    background-image: linear-gradient(180deg, #ffffff12, #ffffff00 42%);
    border-color: #3f9ae6;
    box-shadow: 0 1px 0 #cfeaff2e inset, 0 0 16px #2b86d93d, 0 10px 22px #00060d8c;
  }

  .workflow-step.is-complete::before { box-shadow: 0 0 12px #45e87866; }
}

/* Mobile-only pieces: the floating tab bar and the spacing that depends on it. */
@media screen and (max-width: 780px) {
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }

  .record-form > .form-actions {
    bottom: calc(70px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, #10355cee, #081f36f7);
    border-color: #3f9ae6;
    box-shadow: 0 1px 0 #cfeaff3d inset, 0 0 22px #2b86d94d, 0 14px 30px #00060dd1;
  }

  /* Anchored flush to the bottom edge -- no floating gap for page content to
     show through. The safe-area inset only pads the icon row up off the home
     indicator, capped so it never becomes the dead band it used to be. */
  .mobile-tabbar {
    right: 0;
    bottom: 0;
    left: 0;
    /* The generic `nav { overflow-x: auto }` rules for the topbar also match this
       nav, and an auto x-axis forces the y-axis to auto too -- which clipped the
       raised New button flat against the top edge of the bar. */
    overflow: visible;
    min-height: 58px;
    padding: 4px 8px max(6px, calc(env(safe-area-inset-bottom) - 20px));
    background: linear-gradient(180deg, #10355cf0, #081f36f7);
    border: 1px solid #3f9ae6;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 1px 0 #cfeaff4d inset, 0 0 24px #2b86d966, 0 -10px 30px #00060dd1;
  }
  .mobile-tabbar a, .mobile-tabbar button { min-height: 48px; color: #a9cde8; }
  .mobile-tabbar a[aria-current="page"], .mobile-tabbar button[aria-expanded="true"] {
    color: var(--cns-green);
    background: linear-gradient(180deg, #15452f, #0c2c20);
    border: 1px solid #39a473;
    box-shadow: 0 0 18px #45e8783d, 0 1px 0 #bdf3d433 inset;
  }
  .mobile-new-repair > span {
    border-color: #d7ffe8;
    box-shadow: 0 1px 0 #ffffffcc inset, 0 8px 22px #45e8786b, 0 0 28px #45e87866;
  }
  /* Draw the RTX plus geometrically so font metrics cannot pull it off-centre.
     Studio Yoke keeps its existing text glyph. */
  html:not([data-theme="yoke"]) .mobile-new-repair > span {
    position: relative;
    color: transparent;
    font-size: 0 !important;
  }
  html:not([data-theme="yoke"]) .mobile-new-repair > span::before,
  html:not([data-theme="yoke"]) .mobile-new-repair > span::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    content: "";
    background: #04140f;
    border-radius: 999px;
    transform: translate(-50%, -50%);
  }
  html:not([data-theme="yoke"]) .mobile-new-repair > span::after {
    transform: translate(-50%, -50%) rotate(90deg);
  }
}


/* Salesman build: four tabs instead of five, and no raised New button. */
@media screen and (max-width: 780px) {
  .mobile-tabbar-salesman { grid-template-columns: repeat(4, 1fr); }
}
/* Salesman checkboxes on the repair intake form. */
.salesman-options { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.salesman-options .choice { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; }
/* The generic input skin paints every input, checkboxes included, so a plain
   checkbox comes out as a full-width slab. Undo it for these. */
.salesman-options input[type="checkbox"] {
  flex: 0 0 auto;
  width: 19px;
  min-width: 0;
  height: 19px;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  accent-color: #45e878;
}
/* Per-account app version control on the User accounts page. */
.app-view-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.app-view-form select { min-width: 120px; padding: 5px 7px; font-size: 12px; }
