:root {
  color-scheme: dark;
  --ink: #0b0c0d;
  --panel: #151817;
  --panel-2: #1c201e;
  --line: #303631;
  --paper: #f2efe6;
  --acid: #c9ff3d;
  --signal: #f05b45;
  --muted: #8d938b;
  --mono: "Courier New", Courier, monospace;
  --sans: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(480px, 0.9fr);
}

.auth-brand {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(34px, 7vw, 90px);
  background: var(--acid);
  color: var(--ink);
}

.auth-brand h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(64px, 9vw, 134px);
  line-height: 0.82;
  letter-spacing: -0.085em;
}

.auth-brand p {
  max-width: 520px;
  margin: 25px 0 0;
  font-size: 15px;
  line-height: 1.6;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 900;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 10px;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 30px;
}

.auth-card {
  width: min(450px, 100%);
}

.kicker,
.label,
.meta,
.eyebrow {
  font: 700 9px/1.35 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kicker,
.eyebrow {
  color: var(--acid);
}

.auth-card h2 {
  margin: 15px 0 10px;
  font-size: 42px;
  letter-spacing: -0.06em;
}

.auth-card > p {
  color: var(--muted);
  line-height: 1.6;
}

.stack {
  display: grid;
  gap: 16px;
}

.auth-card .stack {
  margin-top: 32px;
}

.field {
  display: grid;
  gap: 8px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--paper);
  padding: 12px 13px;
}

.field textarea {
  min-height: 125px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid var(--acid);
  background: var(--acid);
  color: var(--ink);
  padding: 0 18px;
  font: 800 9px/1 var(--mono);
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.button:hover,
.button:focus-visible {
  outline: 0;
  background: var(--paper);
  border-color: var(--paper);
}

.button-dark {
  background: var(--panel);
  border-color: var(--line);
  color: var(--paper);
}

.button-signal {
  background: var(--signal);
  border-color: var(--signal);
  color: #fff;
}

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: #0e100f;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.sidebar .brand-mark {
  border: 0;
  background: var(--acid);
  color: var(--ink);
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin-top: 52px;
}

.sidebar-nav a {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid transparent;
  color: #b5bab3;
  font-size: 12px;
  text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  border-color: var(--line);
  background: var(--panel);
  color: #fff;
}

.sidebar-nav b {
  min-width: 25px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #282d29;
  color: var(--acid);
  font: 700 9px/1 var(--mono);
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.sidebar-footer form,
.sidebar-footer .button {
  width: 100%;
}

.workspace {
  min-width: 0;
  padding: clamp(28px, 5vw, 70px);
}

.workspace-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 35px;
}

.workspace-head h1 {
  margin: 10px 0 0;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.9;
  letter-spacing: -0.075em;
}

.workspace-head p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  background: var(--line);
}

.stat {
  min-height: 124px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background: var(--panel);
}

.stat small {
  color: var(--muted);
  font: 700 9px/1 var(--mono);
  text-transform: uppercase;
}

.stat strong {
  font-size: 38px;
  letter-spacing: -0.05em;
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(150px, 180px)) auto;
  gap: 10px;
  margin-bottom: 18px;
}

.filters input,
.filters select {
  min-height: 46px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--paper);
  padding: 0 13px;
}

.request-list {
  border-top: 1px solid var(--line);
}

.request-row {
  display: grid;
  grid-template-columns: 120px minmax(220px, 1.5fr) minmax(170px, 0.8fr) 120px 130px 20px;
  gap: 18px;
  align-items: center;
  padding: 21px 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: 150ms ease;
}

.request-row:hover,
.request-row:focus-visible {
  outline: 0;
  background: var(--panel);
  box-shadow: inset 4px 0 0 var(--acid);
}

.request-ref {
  color: var(--muted);
  font: 700 9px/1.4 var(--mono);
}

.request-subject {
  min-width: 0;
}

.request-subject strong,
.request-subject span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-subject strong {
  font-size: 14px;
}

.request-subject span,
.request-customer {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.category-pill,
.department-pill,
.status-pill {
  display: inline-flex;
  width: max-content;
  padding: 7px 9px;
  border: 1px solid var(--line);
  font: 700 8px/1 var(--mono);
  text-transform: uppercase;
}

.category-sales {
  border-color: #789d28;
  color: var(--acid);
}

.category-technical {
  border-color: #5d83ba;
  color: #9cc4ff;
}

.category-general {
  border-color: #aa6d63;
  color: #ff9f8f;
}

.department-sales {
  border-color: #789d28;
  color: var(--acid);
}

.department-technical {
  border-color: #5d83ba;
  color: #9cc4ff;
}

.department-repairs {
  border-color: #b18235;
  color: #ffd28a;
}

.department-accounts {
  border-color: #8d68b4;
  color: #d8b3ff;
}

.department-general {
  border-color: #7e7360;
  color: #d8cbb5;
}

.status-new {
  background: var(--signal);
  border-color: var(--signal);
  color: #fff;
}

.status-accepted,
.status-paid {
  background: var(--acid);
  border-color: var(--acid);
  color: var(--ink);
}

.empty {
  padding: 70px 20px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.alert {
  margin-bottom: 22px;
  padding: 14px 16px;
  border: 1px solid #577327;
  background: #1a2412;
  color: #d9ffa1;
  font-size: 12px;
  line-height: 1.5;
}

.alert-error {
  border-color: #814137;
  background: #2b1714;
  color: #ffb9ad;
}

.detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 35px;
  align-items: start;
  margin-bottom: 32px;
}

.detail-top h1 {
  margin: 10px 0 16px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.detail-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(390px, 0.8fr);
  gap: 22px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.panel-body {
  padding: 22px;
}


.ticket-customer-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}

.ticket-customer-item {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.ticket-customer-item .label {
  color: var(--muted);
}

.ticket-customer-wide {
  grid-column: 1 / -1;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.conversation {
  display: grid;
  gap: 12px;
}

.message {
  max-width: 86%;
  padding: 15px;
  border: 1px solid var(--line);
  background: #101211;
}

.message-admin {
  margin-left: auto;
  border-color: #617a2a;
  background: #1d2614;
}

.message p {
  margin: 10px 0 0;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.6;
}

.message .meta {
  color: var(--muted);
}

.message-admin .meta {
  color: var(--acid);
}

.message-internal {
  border-style: dashed;
  border-color: #7e7360;
  background: #24211b;
}

.message-email {
  margin-top: 9px;
  color: var(--muted);
  font: 700 8px/1 var(--mono);
  text-transform: uppercase;
}

.compose {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.compose-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.compose-actions .field {
  flex: 1;
}

.quote-builder {
  display: grid;
  gap: 12px;
}

.quote-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 120px;
  gap: 8px;
}

.quote-line input {
  min-width: 0;
}

.quote-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quote-summary {
  display: grid;
  gap: 10px;
}

.quote-card {
  padding: 15px;
  border: 1px solid var(--line);
  background: #101211;
}

.quote-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.quote-card strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
}

.quote-card a {
  color: var(--acid);
  font: 700 9px/1 var(--mono);
}

.quote-review {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.quote-review form {
  flex: 1;
}

.quote-review .button {
  width: 100%;
}

.status-form {
  min-width: 190px;
  display: grid;
  gap: 8px;
}

.department-routing-panel .panel-head {
  align-items: flex-start;
}

.department-routing-form textarea {
  min-height: 90px;
}

.department-history {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.department-history-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #101211;
}

.department-history-item strong {
  font-size: 12px;
}

.department-history-item span {
  color: var(--muted);
  font: 700 8px/1.4 var(--mono);
  text-transform: uppercase;
}

.department-history-item p {
  margin: 3px 0 0;
  color: var(--paper);
  font-size: 11px;
  line-height: 1.5;
}

.settings-panel {
  margin-top: 22px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.muted {
  color: var(--muted);
}

.full {
  width: 100%;
}

.customer-filters {
  grid-template-columns: minmax(0, 1fr) auto;
}

.customer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.customer-card {
  position: relative;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
  transition: 160ms ease;
}

.customer-card:hover,
.customer-card:focus-visible {
  outline: 0;
  border-color: var(--acid);
  transform: translateY(-4px);
}

.customer-card h2 {
  margin: 32px 0 8px;
  font-size: 25px;
  letter-spacing: -0.05em;
}

.customer-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.customer-card .meta {
  margin-top: auto;
  padding-top: 24px;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.customer-arrow {
  position: absolute;
  right: 20px;
  bottom: 20px;
  color: var(--acid);
}

.customer-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-span {
  grid-column: 1 / -1;
}

.danger-panel {
  border-color: #71352c;
}

.request-delete-panel {
  margin-top: 22px;
}

.request-delete-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 18px;
}

.request-delete-form .button {
  min-height: 47px;
}

.team-create {
  display: grid;
  grid-template-columns: 1fr 1.2fr 160px 1fr auto;
  gap: 10px;
  align-items: end;
}

.team-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.team-edit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.team-edit .button {
  align-self: end;
}

.team-delete {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.status-lead {
  border-color: #aa6d63;
  color: #ff9f8f;
}

.status-active,
.status-won,
.status-quoted {
  border-color: #789d28;
  color: var(--acid);
}

.status-inactive {
  color: var(--muted);
}

@media (max-width: 700px) {
  .request-delete-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .dashboard {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 13px;
  }

  .sidebar-brand span:last-child,
  .sidebar-nav span,
  .sidebar-footer a span,
  .sidebar-footer button span {
    display: none;
  }

  .sidebar-nav a {
    justify-content: center;
    padding-inline: 6px;
  }

  .sidebar-nav b {
    background: var(--panel);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .customer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-create,
  .team-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 360px;
  }

  .dashboard {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    overflow-x: auto;
  }

  .sidebar-brand span:last-child,
  .sidebar-nav span {
    display: inline;
  }

  .sidebar-nav {
    display: flex;
    margin: 0;
  }

  .sidebar-nav a {
    justify-content: flex-start;
    white-space: nowrap;
  }

  .sidebar-footer {
    display: flex;
    margin: 0 0 0 auto;
  }

  .sidebar-footer > a {
    display: none;
  }

  .sidebar-footer form,
  .sidebar-footer .button {
    width: auto;
  }

  .sidebar-footer .button {
    min-width: 42px;
    padding-inline: 12px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .request-row {
    grid-template-columns: 100px minmax(180px, 1fr) 120px 20px;
  }

  .request-customer,
  .request-row .status-pill {
    display: none;
  }

  .team-create {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .workspace {
    padding: 24px 16px 60px;
  }

  .workspace-head,
  .detail-top {
    grid-template-columns: 1fr;
    align-items: flex-start;
    flex-direction: column;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .request-row {
    grid-template-columns: 1fr 20px;
    gap: 8px;
  }

  .request-row > *:not(.request-subject):not(:last-child) {
    display: none;
  }

  .quote-line,
  .quote-settings,
  .settings-grid,
  .customer-form,
  .team-create,
  .team-list,
  .team-edit {
    grid-template-columns: 1fr;
  }

  .field-span {
    grid-column: auto;
  }

  .customer-grid {
    grid-template-columns: 1fr;
  }

  .compose-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .message {
    max-width: 94%;
  }
}

@media (max-width: 620px) {
  .ticket-customer-details { grid-template-columns: 1fr; }
  .ticket-customer-wide { grid-column: auto; }
}

.sidebar-account {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--paper);
  text-decoration: none;
  transition: 160ms ease;
}

.sidebar-account:hover,
.sidebar-account:focus-visible,
.sidebar-account.active {
  outline: 0;
  border-color: var(--acid);
}

.sidebar-account-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.sidebar-account-copy strong,
.sidebar-account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account-copy strong {
  font-size: 11px;
}

.sidebar-account-copy small {
  color: var(--muted);
  font: 700 8px/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.account-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--acid);
  color: var(--ink);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.account-avatar-small {
  width: 36px;
  height: 36px;
  font-size: 11px;
}

.account-avatar-large {
  width: 112px;
  height: 112px;
  font-size: 30px;
}

.account-heading {
  align-items: flex-end;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.account-side {
  display: grid;
  gap: 18px;
}

.profile-preview {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.profile-preview div {
  display: grid;
  gap: 6px;
}

.profile-preview strong {
  font-size: clamp(24px, 4vw, 40px);
  letter-spacing: -0.05em;
}

.profile-preview span:not(.account-avatar) {
  color: var(--muted);
  font: 700 9px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.account-form,
.account-password-form {
  display: grid;
  gap: 14px;
}

.account-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-form .button {
  justify-self: start;
}

.field-help {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--acid);
}

.account-meta {
  display: grid;
  gap: 0;
  padding-top: 8px;
  padding-bottom: 8px;
}

.account-meta div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.account-meta div:last-child {
  border-bottom: 0;
}

.account-meta span {
  color: var(--muted);
  font: 700 9px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.account-meta strong {
  overflow-wrap: anywhere;
  font-size: 12px;
  text-align: right;
}

@media (max-width: 1120px) {
  .sidebar-account-copy,
  .sidebar-account > span:last-child {
    display: none;
  }

  .sidebar-account {
    display: flex;
    justify-content: center;
    padding-inline: 6px;
  }

  .account-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .sidebar-account-copy,
  .sidebar-account > span:last-child {
    display: none;
  }

  .sidebar-account {
    flex: 0 0 auto;
    padding: 4px;
  }
}

@media (max-width: 620px) {
  .account-form {
    grid-template-columns: 1fr;
  }

  .profile-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-meta div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .account-meta strong {
    text-align: left;
  }
}

/* Authorised supplier catalogue */
.catalogue-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(18rem, .8fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}
.catalogue-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.catalogue-settings-form .field-span { grid-column: 1 / -1; }
.catalogue-settings-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 15rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .76rem;
  line-height: 1.55;
}
.catalogue-status-card > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 0;
  border-top: 1px solid var(--line);
}
.catalogue-status-card > div span { color: var(--muted); }
.cron-card code {
  display: block;
  overflow-wrap: anywhere;
  padding: .85rem;
  border: 1px solid var(--line);
  background: #f4f3ed;
  font-size: .72rem;
  line-height: 1.5;
}
.catalogue-products-panel,
.catalogue-log-panel { margin-top: 1rem; }
.catalogue-products-heading { align-items: flex-end; }
.catalogue-product-filters {
  display: grid;
  grid-template-columns: minmax(18rem, 2fr) repeat(3, minmax(10rem, 1fr)) auto;
  gap: .75rem;
  align-items: end;
  padding: 1rem;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}
.catalogue-product-filters .field { margin: 0; }
.catalogue-filter-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.catalogue-filter-actions .button { white-space: nowrap; }
.catalogue-scroll-note {
  margin: 0;
  padding: .7rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
}
.catalogue-product-table {
  max-height: min(68vh, 52rem);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-top: 1px solid var(--line);
}
.catalogue-product-table:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }
.catalogue-product-row {
  display: grid;
  grid-template-columns: minmax(20rem, 2.3fr) minmax(10rem, 1.1fr) minmax(7rem, .65fr) minmax(7rem, .65fr) minmax(8rem, .7fr);
  gap: 1rem;
  align-items: center;
  min-width: 62rem;
  padding: .85rem 1rem;
  border-top: 1px solid var(--line);
}
.catalogue-product-head {
  position: sticky;
  top: 0;
  z-index: 3;
  border-top: 0;
  background: #f4f3ed;
  box-shadow: 0 1px 0 var(--line);
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: .7rem;
  font-weight: 800;
}
.catalogue-product-row > span { min-width: 0; }
.catalogue-product-row strong,
.catalogue-product-row small { display: block; }
.catalogue-product-row small { color: var(--muted); margin-top: .2rem; }
.catalogue-product-name {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.catalogue-product-name img {
  flex: 0 0 auto;
  width: 3.25rem;
  height: 3.25rem;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
}
.catalogue-product-row form { margin: 0; }
.catalogue-product-row .button { width: 100%; min-height: 2.2rem; padding: .55rem .75rem; }
.catalogue-visibility-actions { display: grid; gap: .4rem; margin-top: .55rem; }
.catalogue-log-list { display: grid; gap: .65rem; }
.catalogue-log-list > div {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: center;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--line);
}
.catalogue-log-list small { color: var(--muted); white-space: nowrap; }
@media (max-width: 1250px) {
  .catalogue-product-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalogue-search-field { grid-column: 1 / -1; }
  .catalogue-filter-actions { align-self: end; }
}
@media (max-width: 1100px) {
  .catalogue-admin-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .catalogue-settings-form { grid-template-columns: 1fr; }
  .catalogue-product-filters { grid-template-columns: 1fr; }
  .catalogue-search-field { grid-column: auto; }
  .catalogue-filter-actions { flex-wrap: wrap; }
  .catalogue-settings-form .field-span { grid-column: auto; }
  .catalogue-log-list > div { grid-template-columns: 1fr; }
}
.catalogue-pricing-note {
  display: grid;
  gap: .35rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--panel-2);
  line-height: 1.5;
}
.catalogue-pricing-note span { color: var(--muted); }

.panel-head-actions,
.thread-status-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.thread-live-status {
  color: var(--muted);
  font: 700 8px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thread-live-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #d4a72c;
  vertical-align: 1px;
}

.thread-live-status[data-state="online"]::before {
  background: var(--acid);
  box-shadow: 0 0 10px rgba(195, 255, 51, 0.55);
}

.thread-live-status[data-state="offline"]::before {
  background: #e46d5f;
  box-shadow: none;
}

.ticket-product {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  background: #0d0f0e;
}

.ticket-product-main {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.ticket-product-image {
  display: grid;
  place-items: center;
  min-height: 130px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f1efe7;
}

.ticket-product-image img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: contain;
}

.ticket-product-copy {
  min-width: 0;
}

.ticket-product-copy h3 {
  margin: 8px 0 10px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.ticket-product-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.ticket-product-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.ticket-product-facts > div {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ticket-product-facts span,
.ticket-product-specs dt {
  color: var(--muted);
  font: 700 8px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ticket-product-facts strong,
.ticket-product-specs dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ticket-product-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}

.ticket-product-specs > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.42fr) minmax(0, 0.58fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 720px) {
  .ticket-product-main {
    grid-template-columns: 1fr;
  }

  .ticket-product-image {
    max-width: 240px;
  }

  .ticket-product-facts,
  .ticket-product-specs {
    grid-template-columns: 1fr;
  }
}

.employee-catalogue-table .catalogue-product-row {
  grid-template-columns: minmax(20rem, 2.4fr) minmax(12rem, 1.2fr) minmax(10rem, .8fr) minmax(9rem, .7fr);
  min-width: 54rem;
}
.employee-catalogue-panel { margin-top: 0; }
.employee-catalogue-filters { grid-template-columns: minmax(18rem, 2fr) repeat(3, minmax(10rem, 1fr)) auto; }
@media (max-width: 1250px) { .employee-catalogue-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .employee-catalogue-filters { grid-template-columns: 1fr; } }

/* Responsive browser-fit ticket layout — 2026-08-03 */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.dashboard,
.workspace,
.panel,
.ticket-primary,
.ticket-tools {
  min-width: 0;
}

.dashboard {
  width: 100%;
  max-width: 100vw;
}

.workspace {
  width: 100%;
  max-width: 100%;
}

.ticket-customer-panel {
  margin-bottom: 22px;
}

.ticket-customer-panel .panel-head {
  padding: 14px 18px;
}

.ticket-customer-details {
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 1fr);
  gap: 0;
  padding: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-gutter: stable;
}

.ticket-customer-item {
  min-width: 0;
  min-height: 94px;
  align-content: start;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  scroll-snap-align: start;
}

.ticket-customer-item:last-child {
  border-right: 0;
}

.ticket-customer-wide {
  grid-column: auto;
  min-width: 260px;
  padding-top: 16px;
  border-top: 0;
}

.ticket-detail-grid {
  align-items: start;
}

.ticket-conversation-panel,
.ticket-primary,
.ticket-tools {
  width: 100%;
}

.department-routing-horizontal .panel-head {
  align-items: center;
  padding-block: 14px;
}

.department-routing-horizontal .panel-body {
  padding: 16px 18px;
}

.department-routing-horizontal .department-routing-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(280px, 1.25fr) auto;
  gap: 12px;
  align-items: end;
}

.department-routing-horizontal .department-routing-form .field {
  min-width: 0;
}

.department-routing-horizontal .department-routing-form textarea {
  min-height: 50px;
  height: 50px;
  resize: vertical;
}

.department-routing-horizontal .department-routing-form .button {
  width: auto;
  min-height: 50px;
  white-space: nowrap;
}

.department-routing-horizontal .department-history {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.department-routing-horizontal .department-history > .label {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .department-routing-horizontal .department-routing-form {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }

  .department-routing-horizontal .department-routing-form .button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    padding: 9px 12px;
    background: rgba(14, 16, 15, 0.98);
  }

  .sidebar-brand,
  .sidebar-footer {
    flex: 0 0 auto;
  }

  .sidebar-nav {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .workspace {
    max-width: 100vw;
  }
}

@media (max-width: 620px) {
  .detail-top {
    gap: 18px;
    margin-bottom: 20px;
  }

  .detail-top h1 {
    font-size: clamp(32px, 12vw, 48px);
  }

  .status-form {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .ticket-customer-panel {
    margin-bottom: 16px;
  }

  .ticket-customer-panel .panel-head,
  .department-routing-horizontal .panel-head,
  .ticket-conversation-panel .panel-head {
    flex-wrap: wrap;
    padding: 13px 14px;
  }

  .ticket-customer-details {
    grid-template-columns: none;
    grid-auto-columns: minmax(160px, 82vw);
  }

  .ticket-customer-item,
  .ticket-customer-wide {
    grid-column: auto;
    min-height: 88px;
    min-width: 0;
    padding: 14px;
    border-top: 0;
  }

  .ticket-customer-wide {
    min-width: 78vw;
  }

  .ticket-detail-grid {
    gap: 16px;
  }

  .department-routing-horizontal .department-routing-form {
    grid-template-columns: 1fr;
  }

  .department-routing-horizontal .department-routing-form .button {
    grid-column: auto;
  }

  .department-routing-horizontal .department-history {
    grid-template-columns: 1fr;
  }

  .panel-body {
    padding: 16px 14px;
  }

  .panel-head-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .sidebar {
    flex-wrap: wrap;
  }

  .sidebar-brand span:last-child {
    display: none;
  }

  .sidebar-nav {
    order: 3;
    width: 100%;
  }

  .sidebar-nav a {
    min-height: 42px;
    padding: 10px 12px;
  }

  .workspace {
    padding-top: 20px;
  }
}

/* ============================================================
   Responsive and print pass - 10 September 2026
   The dashboard is used on a phone as often as a desk, and it
   had no print stylesheet: printing a request carried the whole
   interface with it.
   ============================================================ */

/* Tap targets and field sizing on a phone. 16px on inputs also
   stops iOS zooming the page whenever a field takes focus. */
@media (max-width: 640px) {
  .button,
  button,
  .panel-body a.button,
  select {
    min-height: 44px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .quote-line {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .quote-line .label { font-size: 11px; }
  .custom-invoice-lines,
  .custom-invoice-lines tbody,
  .custom-invoice-lines tr {
    display: block;
    width: 100%;
  }
  .custom-invoice-lines thead { display: none; }
  .custom-invoice-lines td {
    display: block;
    width: 100%;
    padding: 3px 0;
  }
  .custom-invoice-lines input { width: 100%; }
}

/* Wide tables should scroll inside themselves rather than
   pushing the whole page sideways. */
.panel-body table { display: block; overflow-x: auto; max-width: 100%; }

@media print {
  .dashboard-nav,
  .site-header,
  nav,
  form,
  .button,
  button,
  .custom-invoice-panel,
  .quote-cancel-panel,
  .quote-revise-panel,
  .danger-panel,
  .catalogue-products-panel,
  .catalogue-log-panel,
  .browser-agent-panel,
  .account-profile-panel,
  .account-summary {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .panel {
    border: 1px solid #999;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 10px;
  }
  .panel-body table { display: table; overflow: visible; }
}

/* ============================================================
   2026 palette - 10 September 2026
   The dashboard stays dark; only the hues move onto the new
   brand. This is a token swap on purpose - every rule below
   already reads its colour from a token, so nothing about the
   layout or the components needs to change.
   ============================================================ */

:root {
  --ink: #0d0a14;
  --panel: #17121f;
  --panel-2: #1e1729;
  --line: #322a42;
  --paper: #f3effa;
  /* --acid was a bright green doing two jobs: accent text on a
     dark panel, and a background under dark text. A light violet
     is the one value that still reads in both places. */
  --acid: #b98cff;
  --signal: #f0119b;
  --muted: #9990ad;
  --violet: #7b2ff7;
  --magenta: #f0119b;
  --grad: linear-gradient(90deg, #7b2ff7 0%, #f0119b 100%);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

::selection { background: var(--violet); color: #fff; }

input, select, textarea, button { accent-color: var(--violet); }
