:root {
  color-scheme: light;
  --accent: oklch(62% 0.135 272);
  --accent-hover: oklch(57% 0.145 272);
  --accent-active: oklch(49% 0.135 272);
  --accent-soft: oklch(94.7% 0.03 272);
  --accent-faint: oklch(97.8% 0.013 272);
  --canvas: oklch(98% 0.008 92);
  --surface: oklch(99.4% 0.004 92);
  --surface-raised: oklch(98.7% 0.008 92);
  --surface-muted: oklch(96% 0.01 92);
  --sidebar: oklch(96.3% 0.022 266);
  --sidebar-hover: oklch(92.2% 0.036 268);
  --sidebar-ink: oklch(30% 0.035 266);
  --ink: oklch(25% 0.025 265);
  --ink-soft: oklch(39% 0.022 265);
  --muted: oklch(55% 0.018 265);
  --muted-light: oklch(70% 0.014 265);
  --border: oklch(90% 0.014 265);
  --border-strong: oklch(83% 0.021 265);
  --success: oklch(59% 0.12 151);
  --success-soft: oklch(95.5% 0.03 151);
  --warning: oklch(72% 0.12 78);
  --warning-soft: oklch(96.5% 0.04 82);
  --danger: oklch(61% 0.15 24);
  --danger-soft: oklch(96% 0.03 24);
  --info: oklch(63% 0.105 240);
  --info-soft: oklch(95.5% 0.028 240);
  --shadow-float: 0 18px 50px oklch(30% 0.025 265 / 0.11);
  --shadow-menu: 0 10px 30px oklch(30% 0.02 265 / 0.09);
  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar-width: 88px;
  --topbar-height: 68px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid oklch(72% 0.12 272 / 0.5);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: oklch(98.5% 0.006 285);
  background: var(--accent);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
}

.brand-mark-large {
  width: 48px;
  height: 48px;
  margin-bottom: 34px;
  border-radius: 14px;
  font-size: 23px;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  background: var(--surface);
}

.login-intro {
  display: flex;
  min-height: 100vh;
  padding: clamp(48px, 8vw, 112px);
  flex-direction: column;
  justify-content: center;
  color: var(--ink);
  background: oklch(94% 0.032 270);
}

.login-intro h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.login-intro .eyebrow {
  color: var(--accent-active);
}

.login-intro-copy {
  max-width: 550px;
  margin: 30px 0 44px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.65;
}

.login-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  color: var(--ink-soft);
  font-size: 13px;
}

.login-proof span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.login-proof i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: oklch(75% 0.17 150);
  box-shadow: 0 0 0 4px oklch(75% 0.17 150 / 0.12);
}

.login-panel {
  display: grid;
  padding: 48px;
  place-items: center;
  background: var(--surface);
}

.login-form {
  display: grid;
  width: min(100%, 410px);
  gap: 22px;
}

.login-form h2 {
  margin: 0 0 7px;
  font-size: 30px;
  letter-spacing: -0.035em;
}

.login-form p {
  margin-top: 0;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.field > small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.field > span em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 550;
}

.field input,
.field select,
.field textarea,
.control,
.search-control input,
.filter-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface);
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), background 160ms var(--ease-out);
}

.field input,
.field select,
.field textarea,
.control {
  padding: 10px 12px;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.control:hover,
.search-control input:hover,
.filter-select:hover {
  border-color: var(--border-strong);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.control:focus,
.search-control input:focus,
.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

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

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
}

.form-error {
  margin: -8px 0 0 !important;
  padding: 10px 12px;
  border: 1px solid oklch(84% 0.07 25);
  border-radius: var(--radius-sm);
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 13px;
}

.demo-note {
  padding-top: 17px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.demo-note strong {
  color: var(--ink-soft);
}

.button {
  display: inline-flex;
  min-height: 42px;
  padding: 0 16px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 120ms var(--ease-out);
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-primary {
  color: oklch(98.5% 0.006 285);
  background: var(--accent);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.button-primary:active:not(:disabled) {
  background: var(--accent-active);
}

.button-secondary {
  border-color: var(--border);
  color: var(--ink-soft);
  background: var(--surface);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.button-ghost {
  color: var(--ink-soft);
  background: transparent;
}

.button-ghost:hover {
  background: var(--surface-muted);
}

.button-danger {
  border-color: oklch(86% 0.055 25);
  color: var(--danger);
  background: var(--danger-soft);
}

.button-wide {
  width: 100%;
  min-height: 48px;
}

.button-loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid oklch(98% 0 0 / 0.35);
  border-top-color: oklch(98% 0 0);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.is-loading .button-loader {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.icon-button,
.notification-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: transparent;
  transition: color 150ms var(--ease-out), background 150ms var(--ease-out);
}

.icon-button:hover,
.notification-button:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.icon-button svg,
.notification-button svg,
.button svg,
.nav-item svg,
.metric-icon svg,
.empty-icon svg,
.source-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

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

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  padding: 14px 10px;
  flex-direction: column;
  color: var(--sidebar-ink);
  background: var(--sidebar);
}

.sidebar-head {
  display: flex;
  min-height: 54px;
  padding: 0;
  justify-content: center;
  align-items: center;
  gap: 11px;
}

.sidebar-head > div:nth-child(2) {
  display: none;
  flex-direction: column;
  line-height: 1.1;
}

.sidebar-head strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.sidebar-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.sidebar-close {
  display: none;
  margin-left: auto;
  color: var(--sidebar-ink);
}

.sidebar-close:hover {
  background: var(--sidebar-hover);
}

.main-nav {
  display: grid;
  margin-top: 22px;
  gap: 7px;
}

.nav-label {
  display: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  width: 100%;
  position: relative;
  min-height: 58px;
  padding: 7px 4px 6px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  transition: background 150ms var(--ease-out), color 150ms var(--ease-out);
}

.nav-item:hover {
  color: var(--ink);
  background: var(--sidebar-hover);
}

.nav-item.is-active {
  color: var(--accent-active);
  background: oklch(90.8% 0.052 272);
}

.nav-item .nav-count {
  position: absolute;
  top: 5px;
  right: 7px;
  min-width: 17px;
  margin-left: 0;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--accent-active);
  background: var(--surface);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.sidebar-foot {
  margin-top: auto;
}

.sidebar-signal {
  display: none;
  min-height: 38px;
  padding: 0 11px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}

.signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: oklch(71% 0.18 151);
}

.profile-button {
  display: flex;
  width: 100%;
  min-height: 52px;
  padding: 8px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--sidebar-ink);
  background: var(--surface);
  text-align: left;
}

.profile-button:hover {
  background: var(--sidebar-hover);
}

.avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-active);
  background: oklch(90% 0.05 272);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.avatar-small {
  width: 32px;
  height: 32px;
}

.profile-copy {
  display: none;
  min-width: 0;
}

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

.profile-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.profile-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.profile-exit {
  display: none;
}

.profile-exit svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: var(--topbar-height);
  padding: 0 30px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: oklch(99.4% 0.004 92 / 0.94);
  backdrop-filter: blur(12px);
}

.menu-button {
  display: none;
  margin-right: 7px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumbs strong {
  color: var(--ink-soft);
  font-weight: 680;
}

.topbar-actions {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 5px;
}

.notification-button {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 3px;
  right: 2px;
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 99px;
  color: oklch(98% 0.005 285);
  background: var(--danger);
  font-size: 9px;
  font-weight: 800;
}

.main-content {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 24px 26px 50px;
}

.page {
  animation: page-in 180ms var(--ease-out);
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  min-height: 66px;
  margin-bottom: 25px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.page-header h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 730;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.page-header p {
  max-width: 68ch;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.metric-rail {
  display: grid;
  margin-bottom: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
  display: grid;
  min-height: 122px;
  padding: 23px 24px;
  align-content: space-between;
  border-right: 1px solid var(--border);
}

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

.metric-top {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric-icon {
  display: inline-grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
}

.metric-icon svg {
  width: 15px;
  height: 15px;
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.metric-value strong {
  font-size: 26px;
  font-weight: 730;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}

.metric-delta {
  color: var(--success);
  font-size: 11px;
  font-weight: 750;
}

.dashboard-grid {
  display: grid;
  margin-bottom: 26px;
  gap: 18px;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

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

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -0.015em;
}

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

.chart-wrap {
  height: 248px;
  padding: 22px 20px 16px;
}

.chart-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2.5;
}

.chart-label {
  fill: var(--muted);
  font-size: 10px;
}

.status-list {
  display: grid;
  padding: 8px 20px 17px;
  gap: 1px;
}

.status-row {
  display: grid;
  min-height: 46px;
  align-items: center;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

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

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-color, var(--muted));
}

.status-row span:nth-child(2) {
  color: var(--ink-soft);
  font-size: 12px;
}

.status-row strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.table-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.table-toolbar {
  display: flex;
  min-height: 68px;
  padding: 12px 16px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.search-control {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
}

.search-control input {
  padding: 9px 12px 9px 39px;
}

.search-control svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.filter-select {
  width: auto;
  min-width: 160px;
  padding: 9px 34px 9px 12px;
}

.results-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.data-table th {
  height: 42px;
  padding: 0 14px;
  color: var(--muted);
  background: var(--surface-raised);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.065em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  height: 64px;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 12px;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 140ms var(--ease-out);
}

.data-table tbody tr:hover {
  background: var(--accent-faint);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row.is-locked {
  background: color-mix(in oklch, var(--warning-soft) 72%, var(--surface));
}

.order-reference,
.source-cell {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.source-cell small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 190px;
  color: var(--accent-active);
  font-weight: 700;
  text-decoration: none;
}

.site-link svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.site-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-link:hover {
  text-decoration: underline;
}

.site-missing {
  color: var(--muted);
  font-weight: 650;
}

.order-lock {
  display: inline-flex;
  width: fit-content;
  max-width: 116px;
  min-height: 18px;
  padding: 2px 6px;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  border-radius: 99px;
  color: oklch(43% 0.09 72);
  background: var(--warning-soft);
  font-size: 8px;
  font-weight: 720;
  white-space: nowrap;
}

.order-lock.is-own {
  color: var(--accent-active);
  background: var(--accent-soft);
}

.order-lock svg {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.order-lock span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-id {
  color: var(--accent);
  font-weight: 750;
  white-space: nowrap;
}

.customer-cell {
  display: grid;
  min-width: 150px;
}

.customer-cell strong {
  color: var(--ink);
  font-size: 12px;
}

.customer-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.product-cell {
  display: grid;
  min-width: 170px;
}

.product-cell small,
.secondary-line {
  color: var(--muted);
  font-size: 10px;
}

.product-id {
  display: inline-flex;
  width: fit-content;
  min-width: 42px;
  padding: 4px 9px;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--accent-active);
  background: var(--accent-soft);
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.money {
  color: var(--ink);
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.status-chip,
.role-chip,
.source-chip {
  display: inline-flex;
  min-height: 25px;
  padding: 3px 9px;
  align-items: center;
  gap: 6px;
  border: 1px solid color-mix(in oklch, var(--status-color, var(--border)) 62%, var(--surface));
  border-radius: 999px;
  color: color-mix(in oklch, var(--status-text, var(--ink-soft)) 62%, oklch(20% 0.015 285));
  background: color-mix(in oklch, var(--status-color, var(--surface-muted)) 56%, var(--surface));
  font-size: 10px;
  font-weight: 720;
  white-space: nowrap;
}

.status-chip::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-color, var(--muted));
  content: "";
}

.status-new { --status-color: var(--accent); --status-bg: var(--accent-soft); --status-text: var(--accent-active); }
.status-contacting { --status-color: var(--info); --status-bg: var(--info-soft); --status-text: oklch(44% 0.13 240); }
.status-confirmed { --status-color: oklch(58% 0.15 204); --status-bg: oklch(95% 0.035 204); --status-text: oklch(42% 0.11 204); }
.status-packing { --status-color: var(--warning); --status-bg: var(--warning-soft); --status-text: oklch(48% 0.11 72); }
.status-shipped { --status-color: oklch(58% 0.16 270); --status-bg: oklch(95% 0.035 270); --status-text: oklch(43% 0.13 270); }
.status-delivered { --status-color: var(--success); --status-bg: var(--success-soft); --status-text: oklch(41% 0.12 152); }
.status-returned,
.status-cancelled { --status-color: var(--danger); --status-bg: var(--danger-soft); --status-text: oklch(44% 0.17 25); }

.role-chip {
  color: var(--accent-active);
  background: var(--accent-soft);
}

.source-chip {
  color: var(--ink-soft);
  background: var(--surface-muted);
}

.mobile-order-list {
  display: none;
}

.empty-state {
  display: grid;
  min-height: 250px;
  padding: 40px 24px;
  place-items: center;
  text-align: center;
}

.empty-state > div {
  max-width: 380px;
}

.empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 15px;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-soft);
}

.empty-state h3 {
  margin: 0 0 7px;
  font-size: 15px;
}

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

.stock-summary {
  display: flex;
  margin-bottom: 18px;
  padding: 0 3px;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 12px;
}

.stock-summary strong {
  margin-right: 4px;
  color: var(--ink);
  font-size: 14px;
}

.stock-meter {
  display: grid;
  min-width: 120px;
  gap: 6px;
}

.stock-meter-track {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-muted);
}

.stock-meter-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.stock-meter.is-low .stock-meter-fill {
  background: var(--danger);
}

.stock-number {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.stock-number strong {
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.stock-number small {
  color: var(--muted);
  font-size: 10px;
}

.team-role-strip {
  display: grid;
  margin-bottom: 18px;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--border);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.team-role-stat {
  min-height: 86px;
  padding: 18px 20px;
  background: var(--surface);
}

.team-role-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.team-role-stat strong {
  display: block;
  margin-top: 7px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.employee-cell {
  display: flex;
  min-width: 190px;
  align-items: center;
  gap: 10px;
}

.employee-cell > span:last-child {
  display: grid;
}

.employee-cell strong {
  color: var(--ink);
}

.employee-cell small {
  color: var(--muted);
  font-size: 10px;
}

.access-summary {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.access-summary strong {
  color: var(--ink);
  font-size: 14px;
}

.office-badge {
  display: inline-flex;
  min-height: 24px;
  padding: 0 8px;
  align-items: center;
  border: 1px solid color-mix(in oklch, var(--accent) 25%, var(--border));
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-faint);
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.office-name {
  display: block;
  max-width: 120px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.office-id-card {
  display: grid;
  padding: 14px 16px;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--accent-faint);
}

.office-id-card span,
.office-id-card small {
  color: var(--muted);
  font-size: 10px;
}

.office-id-card strong {
  color: var(--accent-strong);
  font-size: 16px;
}

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

.office-option {
  display: flex;
  min-height: 54px;
  padding: 10px;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.office-option:has(input:checked) {
  border-color: color-mix(in oklch, var(--accent) 45%, var(--border));
  background: var(--accent-faint);
}

.office-option.is-inactive {
  opacity: .65;
}

.office-option input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.office-option span,
.office-option strong,
.office-option small {
  display: block;
  min-width: 0;
}

.office-option strong {
  color: var(--ink);
  font-size: 11px;
}

.office-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.permission-picker {
  min-width: 0;
  margin: 2px 0 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.permission-picker legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.permission-picker > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
}

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

.permission-option {
  display: flex;
  min-width: 0;
  min-height: 60px;
  padding: 10px;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.permission-option:has(input:checked) {
  border-color: color-mix(in oklch, var(--accent) 45%, var(--border));
  background: var(--accent-faint);
}

.permission-option input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.permission-option span,
.permission-option strong,
.permission-option small {
  display: block;
  min-width: 0;
}

.permission-option strong {
  color: var(--ink);
  font-size: 10px;
}

.permission-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
  line-height: 1.35;
}

.state-text {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
}

.state-text::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.state-text.is-offline {
  color: var(--muted);
}

.integration-layout {
  display: grid;
  align-items: start;
  gap: 18px;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.7fr);
}

.integration-guide {
  padding: 22px;
}

.guide-step {
  display: grid;
  padding: 18px 0;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 13px;
  border-bottom: 1px solid var(--border);
}

.guide-step:last-child {
  border-bottom: 0;
}

.step-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent-active);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 800;
}

.guide-step h3 {
  margin: 2px 0 5px;
  font-size: 13px;
}

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

.code-block {
  position: relative;
  margin-top: 12px;
  padding: 16px;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  background: oklch(95.7% 0.02 266);
  font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
}

.copy-code {
  position: absolute;
  top: 7px;
  right: 7px;
  color: var(--muted);
  background: var(--surface);
}

.source-list {
  display: grid;
}

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

.source-item:last-child {
  border-bottom: 0;
}

.source-row {
  display: grid;
  min-height: 74px;
  padding: 13px 18px;
  align-items: center;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  gap: 11px;
}

.source-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
}

.source-copy {
  display: grid;
  min-width: 0;
}

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

.source-copy strong {
  font-size: 12px;
}

.source-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.source-key-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 10px;
}

.source-key-button svg {
  width: 14px;
  height: 14px;
}

.source-key-reveal {
  display: grid;
  margin: 0 18px 16px 67px;
  padding: 14px;
  gap: 12px;
  border: 1px solid oklch(82% 0.08 153);
  border-radius: var(--radius-md);
  background: oklch(97.2% 0.025 153);
}

.source-key-message {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.source-key-message > span:last-child {
  display: grid;
  gap: 3px;
}

.source-key-message strong {
  color: oklch(37% 0.1 153);
  font-size: 12px;
}

.source-key-message small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.source-key-check {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  color: oklch(49% 0.13 153);
}

.source-key-check svg {
  width: 19px;
  height: 19px;
}

.source-key-reveal .field {
  margin: 0;
}

.source-key-reveal input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.source-key-dismiss {
  width: max-content;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.source-key-dismiss:hover {
  color: var(--ink);
}

.detail-drawer {
  position: fixed;
  z-index: 50;
  inset: 0 0 0 auto;
  width: min(470px, 100vw);
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  transform: translateX(105%);
  transition: transform 220ms var(--ease-out);
}

.detail-drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  min-height: 75px;
  padding: 16px 20px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: oklch(99.2% 0.004 285 / 0.96);
  backdrop-filter: blur(12px);
}

.drawer-head > div {
  min-width: 0;
}

.drawer-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.drawer-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.drawer-head .icon-button {
  margin-left: auto;
}

.drawer-body {
  padding: 22px 20px 34px;
}

.drawer-section {
  padding: 19px 0;
  border-bottom: 1px solid var(--border);
}

.drawer-section:first-child {
  padding-top: 0;
}

.drawer-section:last-child {
  border-bottom: 0;
}

.drawer-section h3 {
  margin: 0 0 13px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-grid {
  display: grid;
  gap: 14px 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-item {
  display: grid;
  gap: 3px;
}

.detail-item span {
  color: var(--muted);
  font-size: 10px;
}

.detail-item strong,
.detail-item a {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.detail-item a:hover {
  color: var(--accent);
}

.order-line-item {
  display: grid;
  padding: 13px 0;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

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

.order-line-item strong,
.order-line-item small {
  display: block;
}

.order-line-item strong {
  font-size: 12px;
}

.order-line-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.order-total {
  display: flex;
  padding-top: 14px;
  align-items: center;
  justify-content: space-between;
}

.order-total span {
  color: var(--muted);
  font-size: 11px;
}

.order-total strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.drawer-form {
  display: grid;
  gap: 16px;
}

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

.drawer-actions {
  display: flex;
  padding-top: 7px;
  justify-content: flex-end;
  gap: 8px;
}

.drawer-actions .button-danger {
  margin-right: auto;
}

.activity-list {
  display: grid;
  gap: 0;
}

.activity-item {
  position: relative;
  display: grid;
  min-height: 54px;
  padding: 0 0 15px 26px;
}

.activity-item::before {
  position: absolute;
  top: 5px;
  left: 3px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  content: "";
}

.activity-item::after {
  position: absolute;
  top: 17px;
  bottom: 0;
  left: 7px;
  width: 1px;
  background: var(--border);
  content: "";
}

.activity-item:last-child::after {
  display: none;
}

.activity-item strong {
  font-size: 11px;
}

.activity-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.mobile-overlay {
  position: fixed;
  z-index: 29;
  inset: 0;
  visibility: hidden;
  background: oklch(18% 0.03 285 / 0.48);
  opacity: 0;
  transition: opacity 180ms var(--ease-out), visibility 180ms;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(360px, calc(100vw - 32px));
  gap: 8px;
}

.toast {
  display: grid;
  min-height: 52px;
  padding: 12px 15px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  background: var(--surface);
  box-shadow: var(--shadow-menu);
  font-size: 12px;
  animation: toast-in 190ms var(--ease-out);
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 11px;
}

.toast::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  content: "";
}

.toast.is-error::before {
  background: var(--danger);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  color: transparent !important;
  background: var(--surface-muted);
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, oklch(99% 0.004 285 / 0.8), transparent);
  transform: translateX(-100%);
  animation: skeleton 1.2s infinite;
  content: "";
}

@keyframes skeleton {
  to { transform: translateX(100%); }
}

/* Operator-focused orders and analytics workspace */
.orders-page .page-header,
.stats-page .page-header {
  min-height: 54px;
  margin-bottom: 16px;
  align-items: center;
}

.orders-page .page-header h1,
.stats-page .page-header h1 {
  font-size: 22px;
}

.order-status-tabs {
  display: flex;
  min-height: 48px;
  margin-bottom: 10px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  scrollbar-width: thin;
}

.order-status-tab {
  position: relative;
  display: inline-flex;
  min-width: max-content;
  min-height: 46px;
  padding: 0 14px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-right: 1px solid var(--border);
  color: var(--muted);
  background: color-mix(in oklch, var(--status-color, var(--accent)) 6%, var(--surface));
  font-size: 11px;
  font-weight: 650;
}

.order-status-tab:last-child {
  border-right: 0;
}

.order-status-tab::after {
  position: absolute;
  inset: auto 10px 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--status-color, var(--accent));
  opacity: 0.32;
  content: "";
}

.order-status-tab:hover {
  color: var(--status-text, var(--ink-soft));
  background: color-mix(in oklch, var(--status-color, var(--accent)) 13%, var(--surface));
}

.order-status-tab.is-active {
  color: color-mix(in oklch, var(--status-text, var(--ink)) 72%, var(--ink));
  background: color-mix(in oklch, var(--status-color, var(--accent)) 22%, var(--surface));
}

.order-status-tab.is-active::after {
  opacity: 1;
}

.order-status-tab strong {
  color: var(--ink-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.orders-table-panel {
  border-radius: var(--radius-md);
}

.orders-table-panel .table-toolbar {
  min-height: 58px;
  padding: 8px 10px;
}

.orders-table-panel .search-control {
  max-width: 520px;
}

.orders-table-panel .search-control input,
.orders-table-panel .filter-select {
  min-height: 38px;
}

.orders-table-wrap {
  max-height: calc(100vh - 290px);
  min-height: 360px;
  overflow: auto;
}

.operations-table {
  min-width: 1910px;
  table-layout: fixed;
}

.operations-table thead {
  position: sticky;
  z-index: 4;
  top: 0;
}

.operations-table th {
  height: 36px;
  padding: 0 10px;
  border-right: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.operations-table td {
  height: 43px;
  padding: 5px 10px;
  border-right: 1px solid var(--border);
  font-size: 11px;
}

.operations-table th:last-child,
.operations-table td:last-child {
  border-right: 0;
}

.operations-table th:nth-child(1) { width: 82px; }
.operations-table th:nth-child(2) { width: 128px; }
.operations-table th:nth-child(3) { width: 70px; }
.operations-table th:nth-child(4) { width: 150px; }
.operations-table th:nth-child(5) { width: 146px; }
.operations-table th:nth-child(6) { width: 180px; }
.operations-table th:nth-child(7) { width: 105px; }
.operations-table th:nth-child(8) { width: 210px; }
.operations-table th:nth-child(9) { width: 210px; }
.operations-table th:nth-child(10) { width: 132px; }
.operations-table th:nth-child(11) { width: 146px; }
.operations-table th:nth-child(12) { width: 130px; }
.operations-table th:nth-child(13) { width: 130px; }

.operations-table .status-chip {
  width: 100%;
  min-height: 27px;
  max-width: 116px;
  justify-content: center;
  overflow: hidden;
  border-color: color-mix(in oklch, var(--status-color) 78%, var(--surface));
  border-radius: 8px;
  color: color-mix(in oklch, var(--status-text) 58%, oklch(17% 0.018 285));
  background: color-mix(in oklch, var(--status-color) 72%, var(--surface));
  font-weight: 800;
  text-overflow: ellipsis;
}

.operations-table .status-chip::before {
  display: none;
}

.country-cell,
.date-cell,
.dense-primary,
.phone-link,
.truncate-cell {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.dense-primary {
  color: var(--ink);
  font-weight: 650;
}

.phone-link {
  color: var(--ink-soft);
  text-decoration: none;
}

.phone-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.address-cell {
  display: grid;
  min-width: 0;
}

.address-cell span,
.address-cell small,
.operations-table .product-cell span,
.operations-table .product-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-cell small {
  color: var(--muted);
  font-size: 9px;
}

.operations-table .product-cell {
  min-width: 0;
}

.stats-toolbar {
  display: flex;
  min-height: 52px;
  margin-bottom: 10px;
  padding: 7px 10px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.stats-mode {
  display: flex;
  padding: 3px;
  border-radius: 7px;
  background: var(--surface-muted);
}

.stats-mode-button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.stats-mode-button:hover {
  color: var(--ink-soft);
}

.stats-mode-button.is-active {
  color: var(--accent-active);
  background: var(--surface);
  box-shadow: 0 1px 2px oklch(20% 0.03 285 / 0.08);
}

.stats-filter-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.date-range {
  display: flex;
  min-height: 34px;
  padding: 0 11px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.date-range label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.date-range input {
  width: 118px;
  min-height: 30px;
  padding: 0 4px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
}

.stats-apply {
  min-height: 34px;
}

.stats-toolbar > .results-count {
  margin-left: auto;
}

.stats-workspace {
  display: grid;
  min-height: 590px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  grid-template-columns: 210px minmax(0, 1fr);
}

.stats-filters {
  padding: 10px;
  border-right: 1px solid var(--border);
  background: var(--surface-raised);
}

.stats-filter-head {
  display: flex;
  min-height: 38px;
  padding: 0 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stats-filter-row {
  display: grid;
  width: 100%;
  min-height: 39px;
  padding: 0 8px;
  align-items: center;
  grid-template-columns: 15px 8px minmax(0, 1fr) auto;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 10px;
  text-align: left;
}

.stats-filter-row input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--status-color, var(--accent));
}

.stats-filter-row:hover {
  color: var(--ink);
  background: color-mix(in oklch, var(--status-color, var(--accent)) 10%, var(--surface));
}

.stats-filter-row.is-active {
  color: var(--ink);
  background: color-mix(in oklch, var(--status-color, var(--accent)) 16%, var(--surface));
}

.stats-filter-row strong {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.stats-filter-row.is-active .status-dot {
  background: var(--status-color, var(--accent));
}

.stats-report {
  min-width: 0;
}

.stats-report-head {
  display: flex;
  min-height: 72px;
  padding: 14px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

.stats-report-head h2 {
  margin: 0;
  font-size: 14px;
}

.stats-report-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.report-total {
  display: grid;
  text-align: right;
}

.report-total span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.report-total strong {
  margin-top: 2px;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.report-chart {
  height: 360px;
  padding: 16px 18px 8px;
  overflow-x: auto;
}

.report-chart svg {
  min-width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-axis-label {
  fill: var(--muted-light);
  font-size: 9px;
}

.chart-segment {
  fill: var(--segment-color);
  stroke: var(--surface);
  stroke-width: 1;
}

.chart-segment:hover {
  filter: brightness(0.94) saturate(1.08);
}

.chart-empty-bar {
  fill: var(--border-strong);
}

.chart-total-label {
  fill: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.report-summary {
  display: grid;
  border-top: 1px solid var(--border);
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.summary-group {
  display: grid;
  min-height: 145px;
  padding: 16px 18px;
  align-content: start;
  border-right: 1px solid var(--border);
}

.summary-group:last-child {
  border-right: 0;
}

.summary-title {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.summary-value {
  margin: 4px 0 10px;
  color: var(--ink);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.summary-row {
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
}

.summary-row strong {
  color: var(--ink-soft);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.integration-connectors {
  display: grid;
  margin-bottom: 18px;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.connector-panel {
  overflow: hidden;
}

.connector-head {
  display: grid;
  min-height: 78px;
  padding: 14px 18px;
  align-items: center;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.connector-head h2,
.connector-head p {
  margin: 0;
}

.connector-head h2 {
  font-size: 14px;
}

.connector-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.connector-form {
  display: grid;
  padding: 18px;
  gap: 15px;
}

.connector-form > .button {
  justify-self: start;
}

.switch-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  color: var(--ink-soft);
  cursor: pointer;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.switch-row span {
  display: grid;
}

.switch-row strong {
  font-size: 11px;
}

.switch-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.copy-field {
  position: relative;
  display: block;
}

.connector-note {
  margin: 0;
  padding: 12px 13px;
  border: 1px solid color-mix(in oklch, var(--info) 24%, var(--border));
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: color-mix(in oklch, var(--info) 7%, var(--surface));
  font-size: 11px;
  line-height: 1.55;
}

.connector-note strong {
  color: var(--ink);
}

.copy-field input {
  padding-right: 45px;
}

.copy-field .icon-button {
  position: absolute;
  top: 2px;
  right: 2px;
}

.call-log-panel {
  margin-bottom: 18px;
}

.quality-panel {
  margin-bottom: 18px;
}

.quality-count,
.quality-badge {
  display: inline-flex;
  min-height: 24px;
  padding: 0 9px;
  align-items: center;
  border-radius: 99px;
  color: oklch(39% 0.08 153);
  background: oklch(94% 0.045 153);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.quality-badge.is-pending {
  color: oklch(42% 0.09 76);
  background: var(--warning-soft);
}

.quality-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 10px;
  white-space: nowrap;
}

.quality-action svg {
  width: 14px;
  height: 14px;
}

.quality-empty {
  display: flex;
  min-height: 88px;
  padding: 18px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.quality-empty > svg {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  color: var(--accent);
}

.quality-empty span,
.quality-empty strong,
.quality-empty small {
  display: block;
}

.quality-empty strong {
  color: var(--ink-soft);
  font-size: 11px;
}

.quality-empty small {
  margin-top: 2px;
  font-size: 9px;
}

.compact-table td {
  height: 46px;
}

.text-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.integrations-page .integration-layout {
  margin-top: 18px;
}

.inline-status-form {
  display: grid;
  padding: 16px 18px;
  align-items: end;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  grid-template-columns: minmax(220px, 1fr) 110px auto;
}

.color-field input[type="color"] {
  width: 100%;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-field input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 7px;
}

.inline-status-form .button {
  min-height: 44px;
}

.status-admin-list {
  display: grid;
}

.status-admin-row {
  display: grid;
  width: 100%;
  min-height: 58px;
  padding: 9px 18px;
  align-items: center;
  grid-template-columns: minmax(180px, 1fr) 100px 28px;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 11px;
  text-align: left;
}

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

.status-admin-row:hover {
  background: var(--accent-faint);
}

.status-admin-row svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.phone-link,
.inline-phone {
  padding: 0;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
  text-decoration: none;
}

.phone-link:hover,
.inline-phone:hover {
  color: var(--accent);
  text-decoration: underline;
}

.drawer-call {
  min-height: 36px;
  padding: 0 10px;
}

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

.shipping-current {
  display: flex;
  margin-top: 10px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shipping-current small {
  color: var(--muted);
  font-size: 9px;
}

.upsell-form {
  display: grid;
  gap: 12px;
}

.upsell-form > .button {
  justify-self: start;
}

.upsell-label {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 99px;
  color: var(--accent-active);
  background: var(--accent-soft);
  font-size: 8px;
  font-style: normal;
  vertical-align: middle;
}

.mobile-order-shipping {
  display: flex;
  align-items: center;
  color: var(--info);
  font-size: 9px;
}

.shipping-status {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.shipping-status-icon {
  display: inline-grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: currentColor;
  background: color-mix(in oklch, currentColor 12%, var(--surface));
}

.shipping-status-icon svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.shipping-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shipping-status-success { color: var(--success); }
.shipping-status-info { color: var(--info); }
.shipping-status-warning { color: oklch(52% 0.11 76); }
.shipping-status-danger { color: var(--danger); }
.shipping-status-neutral { color: var(--muted); }

.shipping-status.is-compact {
  max-width: 180px;
  font-size: 9px;
}

.shipping-status.is-compact .shipping-status-icon {
  width: 16px;
  height: 16px;
}

.shipping-status.is-large {
  color: var(--success);
  font-size: 11px;
  font-weight: 750;
}

.shipping-status.is-large .shipping-status-icon {
  width: 25px;
  height: 25px;
}

.mobile-order-source {
  color: var(--muted);
  font-size: 9px;
}

.mobile-order-bottom small {
  color: var(--muted);
  font-size: 8px;
}

@media (max-width: 1100px) {
  .metric-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .dashboard-grid,
  .integration-layout,
  .integration-connectors {
    grid-template-columns: 1fr;
  }

  .inline-status-form {
    grid-template-columns: 1fr 1fr;
  }

  .stats-workspace {
    grid-template-columns: 184px minmax(0, 1fr);
  }

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

  .summary-group:nth-child(even) {
    border-right: 0;
  }

  .summary-group:nth-child(-n + 4) {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: min(290px, 86vw);
    padding: 18px 14px;
    box-shadow: var(--shadow-float);
    transform: translateX(-105%);
    transition: transform 220ms var(--ease-out);
  }

  .sidebar-head {
    padding: 0 8px;
    justify-content: flex-start;
  }

  .sidebar-head > div:nth-child(2) {
    display: flex;
  }

  .main-nav {
    margin-top: 35px;
    gap: 5px;
  }

  .nav-label {
    display: block;
  }

  .nav-item {
    min-height: 43px;
    padding: 0 11px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    font-size: 13px;
    text-align: left;
  }

  .nav-item .nav-count {
    position: static;
    min-width: 23px;
    margin-left: auto;
  }

  .sidebar-signal {
    display: flex;
  }

  .profile-button {
    min-height: 58px;
    justify-content: flex-start;
  }

  .profile-copy {
    display: grid;
  }

  .profile-exit {
    display: block;
    margin-left: auto;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close,
  .menu-button {
    display: inline-grid;
  }

  .app-shell.menu-open .mobile-overlay {
    visibility: visible;
    opacity: 1;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    padding: 0 18px;
  }

  .main-content {
    padding: 25px 22px 48px;
  }
}

@media (max-width: 680px) {
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .drawer-actions {
    flex-wrap: wrap;
  }

  .drawer-actions .button-danger {
    width: 100%;
    margin-right: 0;
  }
  :root {
    --topbar-height: 60px;
  }

  body {
    font-size: 13px;
  }

  .login-shell {
    display: block;
    background: var(--surface);
  }

  .login-intro {
    min-height: auto;
    padding: 44px 24px 38px;
    justify-content: flex-start;
  }

  .brand-mark-large {
    margin-bottom: 28px;
  }

  .login-intro h1 {
    font-size: 40px;
  }

  .login-intro-copy {
    margin: 20px 0 24px;
    font-size: 14px;
  }

  .login-proof {
    display: grid;
    gap: 9px;
  }

  .login-panel {
    padding: 36px 24px 52px;
  }

  .topbar {
    padding: 0 12px;
  }

  .breadcrumbs span:first-child,
  .topbar-actions > .icon-button,
  .topbar-actions .avatar {
    display: none;
  }

  .main-content {
    padding: 21px 14px 42px;
  }

  .page-header {
    min-height: auto;
    margin-bottom: 20px;
    flex-direction: column;
    gap: 14px;
  }

  .page-header h1 {
    font-size: 22px;
  }

  .page-actions {
    width: 100%;
    justify-content: stretch;
  }

  .page-actions .button {
    flex: 1;
  }

  .orders-page .page-actions .button-primary {
    flex-basis: 100%;
  }

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

  .orders-page .page-header,
  .stats-page .page-header {
    align-items: stretch;
  }

  .order-status-tabs {
    margin-right: -14px;
    margin-left: -14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .order-status-tab {
    min-height: 48px;
    padding: 0 12px;
  }

  .stats-toolbar {
    flex-wrap: wrap;
  }

  .stats-mode {
    width: 100%;
  }

  .stats-mode-button {
    flex: 1;
    min-height: 38px;
  }

  .stats-filter-label {
    display: none;
  }

  .date-range {
    flex: 1;
    min-height: 38px;
    justify-content: center;
  }

  .date-range label {
    flex: 1;
  }

  .date-range input {
    width: 100%;
    min-width: 102px;
  }

  .stats-apply {
    flex: 1 0 100%;
  }

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

  .stats-filters {
    display: flex;
    padding: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .stats-filter-head {
    display: none;
  }

  .stats-filter-row {
    display: inline-flex;
    width: auto;
    min-width: max-content;
    min-height: 38px;
  }

  .stats-report-head {
    min-height: 68px;
    padding: 12px 14px;
  }

  .report-total strong {
    font-size: 14px;
  }

  .report-chart {
    height: 280px;
    padding: 10px 7px 2px;
    overflow-x: auto;
  }

  .report-chart svg {
    min-width: 620px;
  }

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

  .report-summary .summary-group:last-child {
    grid-column: 1 / -1;
    border-right: 0;
  }

  .summary-group {
    min-height: 138px;
    padding: 14px 12px;
  }

  .summary-value {
    font-size: 14px;
  }

  .connector-head {
    padding: 13px 14px;
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .connector-head .state-text {
    grid-column: 2;
  }

  .source-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .source-key-button {
    grid-column: 2 / -1;
    width: 100%;
  }

  .source-key-reveal {
    margin: 0 14px 14px;
  }

  .connector-form {
    padding: 15px;
  }

  .connector-form .form-row,
  .inline-status-form {
    grid-template-columns: 1fr;
  }

  .inline-status-form {
    padding: 14px;
  }

  .status-admin-row {
    min-height: 68px;
    padding: 10px 14px;
    grid-template-columns: minmax(0, 1fr) 24px;
  }

  .status-admin-row > span:nth-child(2) {
    display: none;
  }

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

  .drawer-call {
    width: 36px;
    padding: 0;
    font-size: 0;
  }

  .ttn-row {
    grid-template-columns: 1fr;
  }

  .ttn-row .button {
    width: 100%;
  }

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

  .metric {
    min-height: 104px;
    padding: 17px 15px;
  }

  .metric-value strong {
    font-size: 20px;
  }

  .metric-top span:last-child {
    font-size: 10px;
  }

  .panel-head {
    min-height: 61px;
    padding: 14px 15px;
  }

  .chart-wrap {
    height: 215px;
    padding: 18px 13px 12px;
  }

  .table-toolbar {
    padding: 11px;
    flex-wrap: wrap;
  }

  .search-control {
    flex-basis: 100%;
    max-width: none;
  }

  .filter-select {
    min-width: 0;
    flex: 1;
  }

  .results-count {
    margin-left: 0;
  }

  .orders-table-wrap {
    display: none;
  }

  .mobile-order-list {
    display: grid;
  }

  .mobile-order {
    display: grid;
    min-height: 126px;
    padding: 15px;
    gap: 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    text-align: left;
  }

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

  .mobile-order:active {
    background: var(--accent-faint);
  }

  .mobile-order-top,
  .mobile-order-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-order-customer {
    display: grid;
  }

  .mobile-order-customer strong {
    color: var(--ink);
    font-size: 13px;
  }

  .mobile-order-customer span,
  .mobile-order-product,
  .mobile-order-source,
  .mobile-order-office {
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-order-bottom .money {
    margin-left: auto;
  }

  .table-panel:not(.orders-table-panel) .table-scroll {
    margin-bottom: -1px;
  }

  .stock-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

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

  .team-role-stat {
    min-height: 76px;
    padding: 14px 15px;
  }

  .detail-drawer {
    top: auto;
    width: 100%;
    max-height: calc(100vh - 24px);
    border-top: 1px solid var(--border);
    border-left: 0;
    border-radius: 18px 18px 0 0;
    transform: translateY(105%);
  }

  .detail-drawer.is-open {
    transform: translateY(0);
  }

  .drawer-head {
    min-height: 68px;
  }

  .drawer-body {
    padding: 19px 17px calc(30px + env(safe-area-inset-bottom));
  }

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

  .toast-region {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

@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;
  }
}
