:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f8fbff;
  --surface-blue: #eef6ff;
  --surface-teal: #effbf8;
  --ink: #101c38;
  --muted: #5e6e8b;
  --border: #d8e2ef;
  --border-strong: #bfd2e8;
  --blue: #1463f3;
  --blue-dark: #0b4fd2;
  --whatsapp: #0b9b83;
  --instagram: #d62976;
  --phone: #1769e8;
  --teal: #0c8d7d;
  --teal-soft: #e8f8f5;
  --coral: #e5694f;
  --coral-soft: #fff1ed;
  --amber: #a96908;
  --amber-soft: #fff7e5;
  --violet: #7556c9;
  --violet-soft: #f3efff;
  --shadow: 0 18px 48px rgba(25, 61, 107, .12);
  --radius: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

body.dialog-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

button {
  color: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(38px, 5vw, 68px);
  line-height: .99;
  letter-spacing: -.055em;
}

h2 {
  margin-bottom: 8px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -.025em;
}

h3 {
  margin-bottom: 9px;
  font-size: 15px;
}

h4 {
  margin-bottom: 5px;
  font-size: 13px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

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

.brand-logo {
  width: 168px;
  height: auto;
  display: block;
}

.demo-badge,
.workspace-name span,
.compact-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 25px;
  padding: 3px 8px;
  color: #174f9e;
  background: var(--surface-blue);
  border: 1px solid #c6dbf4;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 750;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #fff;
  font-weight: 750;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: block;
}

.ui-icon-small {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}

.channel-brand-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.channel-filter-icon {
  width: 19px;
  height: 19px;
  flex-basis: 19px;
}

.icon-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-forward {
  transform: rotate(180deg);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(25, 61, 107, .1);
}

.button:focus-visible,
.nav-button:focus-visible,
.filter-chip:focus-visible,
.enquiry-row:focus-visible,
.order-row:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(20, 99, 243, .22);
  outline-offset: 2px;
}

.button-primary {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 4px 12px rgba(20, 99, 243, .18);
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-quiet {
  color: #263957;
}

.button-danger {
  color: #c94831;
  border-color: #ef8c7b;
}

.button-full {
  width: 100%;
}

.button-small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 13px;
}

.button[disabled] {
  opacity: .52;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Login */

.login-view {
  min-height: 100vh;
  background:
    linear-gradient(#dce8f6 1px, transparent 1px),
    linear-gradient(90deg, #dce8f6 1px, transparent 1px),
    #f8fbff;
  background-size: 42px 42px;
}

.login-header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 76px);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--border);
}

.login-main {
  min-height: calc(100vh - 82px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, .68fr);
  align-items: center;
  gap: clamp(50px, 8vw, 130px);
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 62px 0;
}

.login-intro {
  max-width: 660px;
}

.login-intro h1 {
  max-width: 650px;
  margin-bottom: 26px;
}

.login-copy {
  max-width: 590px;
  margin-bottom: 28px;
  color: #465a7b;
  font-size: 19px;
}

.login-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  max-width: 590px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.login-points li {
  position: relative;
  padding: 12px 14px 12px 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  color: #29405f;
  font-weight: 700;
}

.login-points li::before {
  content: "✓";
  position: absolute;
  left: 14px;
  top: 11px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}

.login-card {
  padding: 30px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.login-card-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.login-card-heading h2 {
  margin-bottom: 0;
  font-size: 25px;
}

.login-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 850;
}

.demo-notice {
  padding: 12px 14px;
  margin-bottom: 18px;
  color: #28528c;
  background: var(--surface-blue);
  border: 1px solid #c7ddf8;
  border-radius: 8px;
}

.demo-notice strong {
  display: block;
}

.login-card label,
dialog label,
.order-editor label {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  color: #273a5b;
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
}

textarea {
  resize: vertical;
}

.login-footnote {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.form-error {
  padding: 9px 10px;
  color: #aa3f2d;
  background: var(--coral-soft);
  border: 1px solid #f4c5bc;
  border-radius: 6px;
  font-size: 12px;
}

/* App shell */

.app-shell {
  min-height: 100vh;
  background: #fff;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.brand-cluster,
.topbar-actions {
  display: flex;
  align-items: center;
}

.brand-cluster {
  gap: 15px;
  min-width: 0;
}

.brand-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

.workspace-name {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.workspace-name strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-name span {
  min-height: 20px;
  padding-block: 1px;
}

.topbar-actions {
  gap: 9px;
}

.demo-date {
  margin-right: 4px;
  color: var(--muted);
  font-size: 12px;
}

.safety-banner {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 24px;
  color: #174f9e;
  background: #edf6ff;
  border-bottom: 1px solid #c8dcf5;
  font-size: 13px;
}

.safety-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  display: grid;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 850;
}

.model-status {
  margin-left: auto;
  color: #6b7890;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.model-status.connected {
  color: #087c6d;
}

.model-status.simulation {
  color: #8a5b19;
}

.main-nav {
  height: 56px;
  display: flex;
  align-items: stretch;
  gap: 3px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.nav-button {
  position: relative;
  min-width: 92px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  color: #32415f;
  background: transparent;
  border: 0;
  font-weight: 700;
  cursor: pointer;
}

.nav-button::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 3px;
  background: transparent;
}

.nav-button.active {
  color: var(--blue);
}

.nav-button.active::after {
  background: var(--blue);
}

.nav-button span[id]:not(:empty) {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  margin-left: 4px;
  padding-inline: 4px;
  color: #fff;
  background: var(--coral);
  border-radius: 10px;
  font-size: 10px;
}

.view-root {
  min-height: calc(100vh - 176px);
}

/* Inbox */

.inbox-workspace {
  height: calc(100vh - 176px);
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(330px, .9fr) minmax(390px, 1.03fr) minmax(390px, .98fr);
  overflow: hidden;
}

.queue-panel,
.detail-panel,
.draft-panel {
  min-width: 0;
  overflow-y: auto;
}

.queue-panel,
.detail-panel {
  border-right: 1px solid var(--border);
}

.detail-panel,
.draft-panel {
  padding: 25px 26px 32px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.queue-heading {
  padding: 20px 20px 12px;
}

.queue-heading h2,
.detail-panel h2,
.draft-panel h2 {
  margin-bottom: 0;
}

.queue-heading .button {
  min-height: 42px;
  padding-inline: 16px;
  border-radius: 8px;
}

.filter-row {
  display: flex;
  gap: 7px;
  padding: 0 20px 11px;
  overflow-x: auto;
}

.filter-chip {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 13px;
  color: #32415f;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.filter-chip.active {
  color: #0f58cb;
  background: #eef5ff;
  border-color: #77a9f8;
  box-shadow: inset 0 0 0 1px rgba(20, 99, 243, .08);
}

.filter-chip[data-channel="whatsapp"]:hover {
  color: #087d6c;
  background: #f0fbf8;
  border-color: #8bd4c8;
}

.filter-chip[data-channel="instagram"]:hover {
  color: #a71d5b;
  background: #fff5f9;
  border-color: #e7b0c9;
}

.filter-chip[data-channel="phone"]:hover {
  color: #1558b4;
  background: #f3f7ff;
  border-color: #a8c7f3;
}

.queue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 20px 12px;
  color: var(--muted);
  font-size: 11px;
}

.queue-toolbar select {
  width: auto;
  min-width: 118px;
  padding: 6px 28px 6px 8px;
  font-size: 11px;
}

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

.enquiry-row {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 5px 11px;
  padding: 14px 18px;
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.enquiry-row:hover {
  background: #f9fbfe;
}

.enquiry-row.selected {
  padding-left: 14px;
  background: linear-gradient(90deg, #edf6ff, #fff 82%);
  border-left: 4px solid var(--blue);
}

.initials {
  grid-row: 1 / span 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #145dd6;
  background: #eaf3ff;
  border: 1px solid #bcd6fb;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 850;
}

.initials.instagram {
  color: #7556c9;
  background: var(--violet-soft);
  border-color: #d6c9ff;
}

.initials.phone {
  color: #98630b;
  background: var(--amber-soft);
  border-color: #f0d499;
}

.enquiry-name {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enquiry-time {
  color: #77849b;
  font-size: 11px;
  white-space: nowrap;
}

.enquiry-message {
  grid-column: 2 / -1;
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #34435f;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.row-meta {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.source-chip,
.status-label,
.payment-label,
.order-status-label {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 750;
}

.source-chip {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
}

.status-label {
  min-height: 27px;
  padding: 4px 8px;
  font-size: 11px;
}

.source-whatsapp {
  color: #087d6c;
  background: #f1fbf8;
  border-color: #a6ddd4;
}

.source-instagram {
  color: #26395c;
  background: #fff;
  border-color: #d6deeb;
}

.source-phone {
  color: #174f9e;
  background: #f5f8ff;
  border-color: #c5d8f4;
}

.source-whatsapp .ui-icon {
  color: var(--whatsapp);
}

.source-instagram .ui-icon {
  color: var(--instagram);
}

.source-phone .ui-icon {
  color: var(--phone);
}

.status-needs-review {
  color: #bd4d35;
  background: var(--coral-soft);
  border-color: #ffc6b9;
}

.status-approved {
  color: #087c6d;
  background: var(--teal-soft);
  border-color: #bde8df;
}

.status-rejected {
  color: #a63f37;
  background: #fff0ee;
  border-color: #f6c0b9;
}

.detail-block {
  padding: 17px 0;
  border-top: 1px solid var(--border);
}

.detail-block:first-of-type {
  padding-top: 18px;
  border-top: 0;
}

.meta-grid,
.order-facts {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 8px 12px;
  margin: 0;
}

.meta-grid dt,
.order-facts dt {
  color: var(--muted);
}

.meta-grid dd,
.order-facts dd {
  margin: 0;
  font-weight: 650;
}

.message-box,
.source-box,
.notice-box,
.draft-editor,
.approval-note,
.rejection-note {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.message-box {
  padding: 14px;
  background: var(--surface-blue);
}

.message-box p:last-child {
  margin-bottom: 0;
}

.intent-label {
  display: inline-block;
  padding: 4px 8px;
  color: #1559bd;
  background: #eaf3ff;
  border: 1px solid #c6ddff;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 750;
}

.detail-list {
  padding-left: 19px;
  margin: 0;
}

.detail-list li {
  margin: 5px 0;
}

.missing-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.missing-list li {
  position: relative;
  padding-left: 17px;
  margin: 6px 0;
}

.missing-list li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 7px;
  width: 6px;
  height: 6px;
  border: 2px solid var(--coral);
  border-radius: 50%;
}

.source-box {
  padding: 12px 14px;
  color: #356a67;
  background: #f0fbf9;
  border-color: #c7ebe4;
  font-size: 12px;
}

.source-box strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  color: #176b62;
}

.notice-box {
  display: flex;
  gap: 9px;
  padding: 12px;
  margin: 17px 0 13px;
  color: #28528c;
  background: #edf6ff;
  border-color: #c7ddf8;
  font-size: 12px;
}

.notice-box .safety-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  font-size: 10px;
}

.notice-box > .ui-icon {
  color: var(--blue);
}

.draft-editor {
  min-height: 310px;
  padding: 15px;
  color: #32415d;
  line-height: 1.52;
}

.draft-meta {
  display: grid;
  gap: 0;
  margin-top: 13px;
  border-top: 1px solid var(--border);
}

.draft-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.draft-meta-row span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.draft-meta-row strong {
  text-align: right;
}

.draft-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.draft-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.draft-footnote {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.approval-note,
.rejection-note {
  padding: 12px;
  margin-top: 13px;
  font-size: 12px;
}

.approval-note {
  color: #176b62;
  background: var(--teal-soft);
  border-color: #bde8df;
}

.rejection-note {
  color: #a63f37;
  background: var(--coral-soft);
  border-color: #f4c5bc;
}

.mobile-back,
.mobile-review-bar {
  display: none;
}

.empty-state {
  padding: 50px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  color: var(--ink);
}

/* Today */

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 54px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.page-heading h1 {
  margin-bottom: 7px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: -.04em;
}

.page-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.metric {
  padding: 17px 18px;
  background: #fff;
  border-right: 1px solid var(--border);
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 25px;
}

.page-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 20px;
  margin-top: 20px;
}

.section-card {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.section-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--border);
}

.section-card-heading h2 {
  margin-bottom: 2px;
  font-size: 18px;
}

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

.task-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.task-row:last-child {
  border-bottom: 0;
}

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}

.priority-dot.normal {
  background: var(--blue);
}

.priority-dot.done {
  background: var(--teal);
}

.task-row strong {
  display: block;
  font-size: 13px;
}

.task-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.fulfilment-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.fulfilment-row:last-child {
  border-bottom: 0;
}

.time-block {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.fulfilment-row strong {
  display: block;
  font-size: 13px;
}

.fulfilment-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

/* Orders */

.orders-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
  gap: 20px;
  align-items: start;
}

.orders-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px;
  gap: 10px;
  margin-bottom: 12px;
}

.order-table {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.order-table-header,
.order-row {
  display: grid;
  grid-template-columns: 1.05fr 1.2fr .85fr .85fr .85fr;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
}

.order-table-header {
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.order-row {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.order-row:last-child {
  border-bottom: 0;
}

.order-row:hover,
.order-row.selected {
  background: var(--surface-blue);
}

.order-row.selected {
  box-shadow: inset 3px 0 var(--blue);
}

.order-cell strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-cell span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.order-status-label {
  color: #1559bd;
  background: #eaf3ff;
  border-color: #c6ddff;
}

.order-status-ready,
.order-status-completed {
  color: #087c6d;
  background: var(--teal-soft);
  border-color: #bde8df;
}

.order-status-waiting-details,
.order-status-advance-pending {
  color: #9b5a09;
  background: var(--amber-soft);
  border-color: #f1d49a;
}

.order-status-cancelled {
  color: #a63f37;
  background: var(--coral-soft);
  border-color: #f4c5bc;
}

.payment-paid {
  color: #087c6d;
  background: var(--teal-soft);
  border-color: #bde8df;
}

.payment-part-paid {
  color: #1559bd;
  background: #eaf3ff;
  border-color: #c6ddff;
}

.payment-unpaid {
  color: #9b5a09;
  background: var(--amber-soft);
  border-color: #f1d49a;
}

.order-editor {
  position: sticky;
  top: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.order-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.order-editor-heading h2 {
  margin-bottom: 4px;
}

.order-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.order-summary div {
  padding: 10px;
  background: var(--surface);
  border-radius: 7px;
}

.order-summary span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.order-summary strong {
  display: block;
  margin-top: 2px;
}

.advance-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.order-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
}

/* History */

.history-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.timeline {
  position: relative;
  max-width: 850px;
  padding-left: 24px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border-strong);
}

.history-event {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 22px;
  padding: 0 0 22px;
}

.history-event::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 5px;
  width: 9px;
  height: 9px;
  background: #fff;
  border: 3px solid var(--blue);
  border-radius: 50%;
}

.history-event.approval::before,
.history-event.payment::before {
  border-color: var(--teal);
}

.history-event.rejection::before {
  border-color: var(--coral);
}

.history-time {
  color: var(--muted);
  font-size: 11px;
}

.history-body {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.history-body strong {
  display: block;
  font-size: 13px;
}

.history-body p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.history-actor {
  display: inline-block;
  margin-top: 7px;
  color: #526582;
  font-size: 10px;
  font-weight: 750;
}

/* Dialog and feedback */

dialog {
  width: min(570px, calc(100% - 28px));
  padding: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(13, 28, 54, .48);
}

dialog form {
  padding: 23px;
}

.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.dialog-heading h2 {
  margin-bottom: 4px;
}

.dialog-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.icon-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.phone-note {
  padding: 10px 12px;
  color: #6e5319;
  background: var(--amber-soft);
  border: 1px solid #f1d49a;
  border-radius: 7px;
  font-size: 11px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 19px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: 360px;
  padding: 12px 15px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1160px) {
  .inbox-workspace {
    grid-template-columns: 310px minmax(360px, 1fr) minmax(350px, .95fr);
  }

  .detail-panel,
  .draft-panel {
    padding-inline: 20px;
  }

  .demo-date {
    display: none;
  }
}

@media (max-width: 980px) {
  .login-main {
    grid-template-columns: 1fr minmax(340px, .8fr);
    gap: 42px;
  }

  .inbox-workspace {
    height: auto;
    min-height: calc(100vh - 176px);
    grid-template-columns: 310px 1fr;
    overflow: visible;
  }

  .queue-panel,
  .detail-panel,
  .draft-panel {
    overflow: visible;
  }

  .detail-panel {
    border-right: 0;
  }

  .draft-panel {
    grid-column: 2;
    border-top: 1px solid var(--border);
  }

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

  .order-editor {
    position: static;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .login-header {
    height: 68px;
    padding: 0 17px;
  }

  .login-header .brand-logo {
    width: 143px;
  }

  .login-header .demo-badge {
    display: none;
  }

  .login-main {
    min-height: calc(100vh - 68px);
    display: block;
    width: min(100% - 30px, 500px);
    padding: 37px 0;
  }

  .login-intro {
    margin-bottom: 28px;
  }

  .login-intro h1 {
    margin-bottom: 17px;
    font-size: 42px;
  }

  .login-copy {
    margin-bottom: 20px;
    font-size: 16px;
  }

  .login-points {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .login-points li {
    padding-block: 9px;
  }

  .login-points li::before {
    top: 8px;
  }

  .login-card {
    padding: 22px 18px;
  }

  .topbar {
    height: 68px;
    padding: 0 14px;
  }

  .topbar .brand-logo {
    width: 126px;
  }

  .brand-divider,
  .workspace-name strong,
  .reset-button {
    display: none;
  }

  .workspace-name span {
    font-size: 9px;
  }

  .topbar-actions .button {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 11px;
  }

  .safety-banner {
    min-height: 62px;
    align-items: flex-start;
    padding: 10px 14px;
    font-size: 11px;
  }

  .model-status {
    display: none;
  }

  .main-nav {
    height: 52px;
    justify-content: space-between;
    gap: 0;
    padding: 0 7px;
    overflow-x: auto;
  }

  .nav-button {
    min-width: auto;
    padding: 0 10px;
    font-size: 12px;
  }

  .nav-button span[id]:not(:empty) {
    display: none;
  }

  .view-root {
    min-height: calc(100vh - 182px);
  }

  .inbox-workspace {
    min-height: 0;
    display: block;
  }

  .queue-panel,
  .detail-panel {
    border-right: 0;
  }

  .queue-panel {
    padding-bottom: 84px;
  }

  .detail-panel,
  .draft-panel {
    display: none;
    padding: 19px 16px 28px;
    border-bottom: 1px solid var(--border);
  }

  .inbox-workspace.mobile-review-open .queue-panel {
    display: none;
  }

  .inbox-workspace.mobile-review-open .detail-panel,
  .inbox-workspace.mobile-review-open .draft-panel {
    display: block;
  }

  .queue-heading {
    display: block;
    padding: 20px 15px 12px;
  }

  .queue-heading h2 {
    margin-bottom: 12px;
    font-size: 25px;
  }

  .queue-heading .button {
    width: 100%;
  }

  .filter-row,
  .queue-toolbar {
    padding-inline: 15px;
  }

  .filter-row {
    padding-bottom: 12px;
  }

  .filter-chip {
    min-height: 42px;
    padding-inline: 12px;
  }

  .enquiry-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    padding: 16px 15px;
  }

  .enquiry-row.selected {
    padding-left: 11px;
  }

  .initials {
    width: 44px;
    height: 44px;
  }

  .enquiry-name {
    font-size: 15px;
  }

  .enquiry-message {
    font-size: 13px;
  }

  .mobile-review-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 14px;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(25, 61, 107, .08);
  }

  .mobile-review-bar .button {
    flex: 1;
  }

  .inbox-workspace.mobile-review-open .mobile-review-bar {
    display: none;
  }

  .mobile-back {
    display: inline-flex;
    margin-bottom: 13px;
  }

  .draft-editor {
    min-height: 285px;
  }

  .page {
    width: min(100% - 28px, 620px);
    padding: 24px 0 42px;
  }

  .page-heading {
    display: block;
    margin-bottom: 18px;
  }

  .page-heading h1 {
    font-size: 30px;
  }

  .page-heading .button {
    width: 100%;
    margin-top: 14px;
  }

  .metric-strip {
    grid-template-columns: 1fr 1fr;
  }

  .metric {
    border-bottom: 1px solid var(--border);
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(3),
  .metric:nth-child(4) {
    border-bottom: 0;
  }

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

  .task-row {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .task-row .button {
    grid-column: 2;
    justify-self: start;
  }

  .fulfilment-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .fulfilment-row .order-status-label {
    grid-column: 2;
  }

  .orders-toolbar {
    grid-template-columns: 1fr;
  }

  .order-table-header {
    display: none;
  }

  .order-row {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    padding: 14px;
  }

  .order-row .order-cell:nth-child(2) {
    grid-column: 1;
  }

  .order-row .order-cell:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
  }

  .order-row .order-cell:nth-child(4),
  .order-row .order-cell:nth-child(5) {
    grid-column: auto;
  }

  .order-summary {
    grid-template-columns: 1fr 1fr;
  }

  .history-event {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .history-time {
    font-size: 10px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  dialog form {
    padding: 19px 17px;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions .button {
    width: 100%;
  }

  .toast {
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
