:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --ink: #16213a;
  --muted: #657386;
  --line: #e3e8f0;
  --line-strong: #cfd7e4;
  --nav: #191d25;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --cyan: #0e94a5;
  --green: #0d8a64;
  --orange: #b96505;
  --red: #c9343d;
  --violet: #7155d9;
  --shadow: 0 14px 38px rgba(22, 33, 58, 0.08);
  --radius: 14px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

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

button,
select {
  cursor: pointer;
  touch-action: manipulation;
}

button {
  color: inherit;
}

a {
  color: inherit;
  touch-action: manipulation;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 24px rgba(22, 33, 58, 0.045);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  width: min(1600px, 100%);
  min-height: 72px;
  margin: 0 auto;
  padding: 0 30px;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  height: 100dvh;
  padding: 23px 15px 18px;
  overflow-y: auto;
  color: #d6dce7;
  background: var(--nav);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 7px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(145deg, #2563eb, #16b9cc 58%, #e5484d);
  box-shadow: 0 9px 22px rgba(37, 99, 235, 0.26);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.94);
}

.brand-mark::before {
  top: 11px;
  left: 10px;
  width: 18px;
  height: 4px;
  transform: rotate(-20deg);
}

.brand-mark::after {
  top: 11px;
  left: 18px;
  width: 4px;
  height: 18px;
  transform: rotate(24deg);
}

.brand-mark span {
  right: 7px;
  bottom: 8px;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.62);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand span {
  margin-top: 2px;
  color: #8792a4;
  font-size: 11px;
}

.app-header .brand {
  padding: 0;
}

.app-header .brand strong {
  color: var(--ink);
  font-size: 15px;
}

.app-header .brand span {
  color: var(--muted);
}

.top-nav {
  display: flex;
  min-width: 0;
  justify-content: center;
  gap: 2px;
}

.top-nav button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.top-nav button:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

.top-nav button.is-current {
  background: #edf4ff;
  color: var(--brand-strong);
  box-shadow: inset 0 -2px var(--brand);
}

.top-nav svg {
  width: 17px;
  height: 17px;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-sync {
  margin: 0;
  padding: 8px 10px;
  border-color: var(--line);
  background: var(--panel-soft);
}

.header-sync > div {
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
}

.header-sync p {
  display: none;
}

.header-create {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.header-create:hover {
  border-color: var(--brand);
  background: #f6f9ff;
}

.header-create svg {
  width: 15px;
  height: 15px;
}

.nav-label {
  margin: 0 0 8px;
  padding: 0 11px;
  color: #697487;
  font-size: 10px;
  letter-spacing: 0.13em;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.side-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #aeb8c8;
  font-size: 13px;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.side-nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.side-nav button.is-current {
  color: #fff;
  background: rgba(37, 99, 235, 0.2);
  box-shadow: inset 3px 0 #5f9bff;
}

.side-nav svg {
  width: 17px;
  height: 17px;
}

.sidebar-actions {
  display: grid;
  gap: 8px;
  margin-top: -9px;
}

.side-create {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: #cbd4e1;
}

.side-create:hover {
  background: rgba(255, 255, 255, 0.08);
}

.side-create.is-primary {
  border-color: rgba(88, 145, 255, 0.42);
  background: rgba(37, 99, 235, 0.18);
  color: #ecf3ff;
}

.side-create svg {
  width: 16px;
  height: 16px;
}

.sync-card {
  margin-top: auto;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.sync-card > div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.sync-card p {
  margin: 7px 0 0;
  color: #7d8899;
  font-size: 10px;
  line-height: 1.55;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8b96a7;
  box-shadow: 0 0 0 4px rgba(139, 150, 167, 0.1);
}

.sync-dot.is-live {
  background: #32d296;
  box-shadow: 0 0 0 4px rgba(50, 210, 150, 0.12);
}

.sync-dot.is-local {
  background: #f4ad3d;
  box-shadow: 0 0 0 4px rgba(244, 173, 61, 0.12);
}

.back-workbench {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: -17px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  color: #8792a4;
  font-size: 10px;
  text-decoration: none;
}

.back-workbench:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #d5dbe5;
}

.back-workbench svg {
  width: 13px;
  height: 13px;
}

.main {
  min-width: 0;
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 28px 30px 44px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 23px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 2.7vw, 33px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.subhead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.top-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(22, 33, 58, 0.025);
  font-size: 12px;
  transition: border-color 150ms ease, background 150ms ease, transform 120ms ease;
}

.btn:hover {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

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

.btn:focus-visible,
.icon-button:focus-visible,
.top-nav button:focus-visible,
.header-create:focus-visible,
.app-header .brand:focus-visible,
.side-nav button:focus-visible,
.appointment-card:focus-visible,
.order-row:focus-visible,
.kanban-card:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.23);
  outline-offset: 2px;
}

.btn-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}

.btn-danger {
  border-color: rgba(201, 52, 61, 0.22);
  background: rgba(201, 52, 61, 0.05);
  color: var(--red);
}

.btn-small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.icon-button:hover {
  background: var(--panel-soft);
}

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

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 11px;
}

.metric-card {
  position: relative;
  min-height: 113px;
  overflow: hidden;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 2px 9px rgba(22, 33, 58, 0.025);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -27px;
  bottom: -37px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--metric-tone, var(--brand)) 9%, transparent);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.metric-label span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--metric-tone, var(--brand));
}

.metric-card strong {
  display: block;
  margin-top: 17px;
  font-size: clamp(24px, 2.4vw, 31px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 3px 12px rgba(22, 33, 58, 0.025);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px 13px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

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

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

.task-list {
  display: grid;
}

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

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

.task-row-main {
  min-width: 0;
}

.task-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.task-primary strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.task-row .btn {
  min-height: 33px;
  padding: 0 10px;
  font-size: 10px;
}

.tag,
.status-chip,
.source-chip {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.tag.is-blue,
.status-chip.is-blue,
.source-chip.online {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.065);
  color: var(--brand);
}

.tag.is-green,
.status-chip.is-green {
  border-color: rgba(13, 138, 100, 0.18);
  background: rgba(13, 138, 100, 0.065);
  color: var(--green);
}

.tag.is-orange,
.status-chip.is-orange,
.source-chip.onsite {
  border-color: rgba(185, 101, 5, 0.18);
  background: rgba(185, 101, 5, 0.065);
  color: var(--orange);
}

.tag.is-red,
.status-chip.is-red {
  border-color: rgba(201, 52, 61, 0.18);
  background: rgba(201, 52, 61, 0.06);
  color: var(--red);
}

.tag.is-violet,
.status-chip.is-violet {
  border-color: rgba(113, 85, 217, 0.18);
  background: rgba(113, 85, 217, 0.06);
  color: var(--violet);
}

.appointment-list,
.attention-list,
.order-list,
.kanban-list {
  display: grid;
}

.appointment-card {
  position: relative;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 78px;
  padding: 12px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.appointment-card:hover,
.order-row:hover,
.kanban-card:hover {
  background: #fafbfd;
}

.appointment-card.is-urgent {
  box-shadow: inset 3px 0 0 var(--red);
  background: linear-gradient(90deg, rgba(201, 52, 61, 0.035), transparent 34%);
}

.appointment-card:last-child {
  border-bottom: 0;
}

.appointment-time {
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.appointment-time strong,
.appointment-time span {
  display: block;
}

.appointment-time strong {
  font-size: 16px;
  font-weight: 600;
}

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

.appointment-copy {
  min-width: 0;
}

.appointment-copy strong {
  display: block;
  font-size: 12px;
}

.appointment-copy p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.chevron {
  color: #9aa6b6;
  font-size: 18px;
}

.empty-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.empty-state p {
  max-width: 360px;
  margin: 6px auto 0;
  font-size: 11px;
  line-height: 1.6;
}

.pipeline-summary {
  display: grid;
  gap: 12px;
}

.pipeline-row {
  display: grid;
  grid-template-columns: 85px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
}

.pipeline-row span,
.pipeline-row b {
  font-size: 10px;
  font-weight: 500;
}

.pipeline-row b {
  color: var(--muted);
  text-align: right;
}

.pipeline-track {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--panel-soft);
}

.pipeline-track i {
  display: block;
  width: var(--track-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--track-tone, var(--brand));
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-tabs button {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.filter-tabs button:hover {
  background: var(--panel-soft);
}

.filter-tabs button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.search-field {
  position: relative;
  min-width: 240px;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-field input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 35px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 11px;
}

.order-list-head,
.order-row {
  grid-template-columns: minmax(180px, 1.2fr) 125px 105px 130px 120px 115px;
}

.order-list-head {
  display: grid;
  gap: 10px;
  padding: 11px 17px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 10px;
}

.order-row {
  display: grid;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 71px;
  padding: 11px 17px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

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

.order-customer {
  min-width: 0;
}

.order-customer strong {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-customer small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-money strong,
.order-money small,
.order-date strong,
.order-date small {
  display: block;
}

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

.order-money small,
.order-date small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.order-date strong {
  font-size: 10px;
  font-weight: 500;
}

.order-next {
  min-width: 0;
}

.order-next .btn {
  max-width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 11px;
  align-items: start;
}

.kanban-column {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.48);
}

.kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
}

.kanban-head strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
}

.kanban-head strong::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--column-tone, var(--brand));
}

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

.kanban-list {
  gap: 8px;
  padding: 9px;
}

.kanban-card {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  text-align: left;
  box-shadow: 0 2px 6px rgba(22, 33, 58, 0.025);
}

.kanban-card strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card p {
  margin: 5px 0 9px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.kanban-card-foot b {
  font-size: 11px;
}

.kanban-card-foot small {
  color: var(--muted);
  font-size: 9px;
}

.kanban-empty {
  padding: 26px 10px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.tracking-external {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line-strong);
}

.tracking-external > .section-heading {
  margin-bottom: 16px;
}

.tracking-external > .section-heading > p {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: right;
}

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

.platform-card {
  position: relative;
  display: grid;
  gap: 13px;
  min-height: 150px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.platform-card::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -48px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--platform-tone, var(--brand)) 7%, transparent);
}

.platform-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.platform-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.platform-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--platform-tone, var(--brand)) 11%, var(--panel));
  color: var(--platform-tone, var(--brand));
  font-size: 15px;
  font-weight: 700;
}

.platform-title strong,
.platform-title small {
  display: block;
}

.platform-title strong {
  font-size: 13px;
}

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

.platform-count {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.platform-card-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.platform-card-foot p {
  max-width: 230px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.connector-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 10px;
}

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

.connector-note a {
  text-decoration: none;
}

.connector-note a:hover {
  text-decoration: underline;
}

.external-job-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.external-job-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
}

.external-job-card.is-exception {
  border-color: rgba(201, 52, 61, 0.3);
  background: linear-gradient(145deg, rgba(201, 52, 61, 0.035), var(--panel) 55%);
}

.external-job-head,
.external-job-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.external-job-head strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.external-job-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.external-job-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 12px;
}

.external-job-body span,
.external-job-body b {
  display: block;
}

.external-job-body span {
  color: var(--muted);
  font-size: 9px;
}

.external-job-body b {
  margin-top: 3px;
  overflow: hidden;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.external-job-foot {
  align-items: center;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.external-job-foot .inline-actions {
  justify-content: flex-end;
}

.external-job-foot .btn {
  min-height: 32px;
  padding: 0 9px;
  font-size: 10px;
}

.sync-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.sync-source::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #98a3b2;
}

.sync-source.is-api::before {
  background: var(--green);
}

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

.catalog-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-soft);
}

.catalog-card strong {
  display: block;
  font-size: 12px;
}

.catalog-card p {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.catalog-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.catalog-card b {
  font-size: 12px;
}

.app-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(14, 22, 40, 0.28);
}

.app-dialog::backdrop {
  background: rgba(10, 15, 25, 0.52);
  backdrop-filter: blur(3px);
}

.app-dialog[open] {
  display: flex;
  flex-direction: column;
}

.app-dialog form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

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

.dialog-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.dialog-head p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.dialog-body {
  min-height: 0;
  padding: 20px 22px;
  overflow-y: auto;
}

.dialog-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.form-section + .form-section {
  margin-top: 22px;
  padding-top: 21px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.section-no {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand);
  font-size: 9px;
  font-weight: 700;
}

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

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

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

.span-2 {
  grid-column: span 2;
}

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

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field > span {
  color: #4e5d71;
  font-size: 10px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea,
.inline-actions select {
  width: 100%;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

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

.field input::placeholder,
.field textarea::placeholder {
  color: #9ba6b5;
}

.money-input,
.suffix-input {
  display: flex;
  align-items: center;
  min-height: 39px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.money-input span,
.suffix-input span {
  flex: 0 0 auto;
  padding: 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.money-input input,
.suffix-input input {
  min-width: 0;
  min-height: 37px;
  padding-left: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.suffix-input input {
  padding-left: 10px;
}

.line-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.line-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  table-layout: fixed;
}

.line-table th,
.line-table td {
  padding: 8px 7px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.line-table th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  text-align: left;
}

.line-table tr:last-child td {
  border-bottom: 0;
}

.line-table th:nth-child(1) { width: 21%; }
.line-table th:nth-child(2) { width: 24%; }
.line-table th:nth-child(3) { width: 8%; }
.line-table th:nth-child(4) { width: 8%; }
.line-table th:nth-child(5) { width: 13%; }
.line-table th:nth-child(6) { width: 13%; }
.line-table th:nth-child(7) { width: 44px; }

.line-table input {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
}

.line-table input:hover,
.line-table input:focus {
  border-color: var(--line-strong);
  background: #fff;
}

.line-table .num {
  text-align: right;
}

.row-delete {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a0af;
}

.row-delete:hover {
  background: rgba(201, 52, 61, 0.07);
  color: var(--red);
}

.mobile-line-hint {
  display: none;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
}

.cost-list {
  display: grid;
  gap: 8px;
}

.cost-row {
  display: grid;
  grid-template-columns: 120px minmax(160px, 1fr) 120px 140px 38px;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
}

.cost-row select,
.cost-row input {
  width: 100%;
  min-height: 35px;
  padding: 7px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
}

.check-inline {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.check-inline input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 11px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
}

.check-row input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}

.check-row strong,
.check-row small {
  display: block;
}

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

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

.field-important input {
  border-color: rgba(37, 99, 235, 0.42);
  background: #f8fbff;
  box-shadow: inset 3px 0 0 var(--brand);
  font-weight: 600;
}

.appointment-time-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 10px;
}

.appointment-time-alert strong {
  color: var(--ink);
  font-size: 10px;
  white-space: nowrap;
}

.appointment-time-alert.is-urgent {
  border-color: rgba(201, 52, 61, 0.24);
  background: rgba(201, 52, 61, 0.055);
}

.appointment-time-alert.is-urgent strong,
.appointment-time-alert.is-danger strong {
  color: var(--red);
}

.appointment-time-alert.is-warning {
  border-color: rgba(185, 101, 5, 0.22);
  background: rgba(185, 101, 5, 0.055);
}

.appointment-time-alert.is-warning strong {
  color: var(--orange);
}

.appointment-time-alert.is-normal {
  border-color: rgba(13, 138, 100, 0.18);
  background: rgba(13, 138, 100, 0.05);
}

.appointment-time-alert.is-normal strong {
  color: var(--green);
}

.appointment-confirm-time {
  margin-top: 0;
  background: #fbfcfe;
}

.order-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-soft);
}

.order-summary div {
  padding: 5px 8px;
  border-right: 1px solid var(--line);
}

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

.order-summary span,
.order-summary strong {
  display: block;
}

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

.order-summary strong {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
}

.order-summary .is-total strong {
  color: var(--brand);
  font-size: 18px;
}

.timeline-preview {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.timeline-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.timeline-preview-head strong {
  font-size: 11px;
}

.timeline-preview-head span {
  color: var(--muted);
  font-size: 9px;
}

.timeline-preview-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 9px;
}

.timeline-preview-row span {
  color: var(--muted);
}

.timeline-preview-row b {
  font-weight: 500;
}

.catalog-input {
  width: 100%;
  min-height: 35px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
}

.catalog-card > .catalog-input + .catalog-input {
  margin-top: 7px;
}

.catalog-card > div {
  margin-top: 7px;
}

.catalog-card label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.catalog-number {
  width: 84px;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 10px;
}

.form-error {
  min-height: 17px;
  margin: 8px 0 0;
  color: var(--red);
  font-size: 10px;
}

.quote-dialog {
  width: min(990px, calc(100vw - 32px));
}

.appointment-dialog {
  width: min(790px, calc(100vw - 32px));
}

.appointment-doc-dialog {
  width: min(900px, calc(100vw - 32px));
}

.quote-scroll {
  min-height: 0;
  padding: 22px;
  overflow: auto;
  background: #e8edf5;
}

.quote-paper {
  width: min(794px, 100%);
  min-height: 1030px;
  margin: 0 auto;
  padding: 44px 48px;
  background: #fff;
  color: #172033;
  box-shadow: 0 10px 35px rgba(22, 33, 58, 0.12);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.quote-mobile-view {
  display: none;
}

.quote-paper.is-mobile-preview {
  width: min(430px, 100%);
  min-height: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.quote-paper.is-mobile-preview .quote-desktop-view {
  display: none;
}

.quote-paper.is-mobile-preview .quote-mobile-view {
  display: block;
}

.mobile-quote-sheet {
  overflow: hidden;
  border: 1px solid #dce3ec;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(22, 33, 58, 0.12);
}

.mobile-quote-brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 18px 14px;
  background: #172033;
  color: #fff;
}

.mobile-quote-brand strong,
.mobile-quote-brand span {
  display: block;
}

.mobile-quote-brand strong {
  font-size: 16px;
}

.mobile-quote-brand div span {
  margin-top: 4px;
  color: #b7c1cf;
  font-size: 11px;
}

.mobile-quote-version {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #d9e1ec;
  font-size: 10px;
}

.mobile-quote-sheet > h1 {
  margin: 22px 18px 0;
  color: #172033;
  font-size: 22px;
  letter-spacing: 0;
  text-align: left;
}

.quote-paper .mobile-quote-sheet > h1 {
  margin: 22px 18px 0;
  font-size: 22px;
  letter-spacing: 0;
  text-align: left;
}

.mobile-quote-subtitle {
  margin: 8px 18px 0;
  color: #657386;
  font-size: 12px;
  line-height: 1.65;
}

.mobile-quote-number {
  margin: 12px 18px 18px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f6f8fb;
  color: #586579;
  font-family: "Consolas", monospace;
  font-size: 11px;
}

.mobile-quote-card,
.mobile-quote-terms,
.mobile-quote-sign {
  margin: 0 14px 12px;
  padding: 14px;
  border: 1px solid #e3e8f0;
  border-radius: 12px;
}

.mobile-quote-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.mobile-quote-section-title span {
  font-size: 14px;
  font-weight: 700;
}

.mobile-quote-section-title b {
  color: #2563eb;
  font-size: 10px;
  font-weight: 600;
}

.mobile-quote-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 10px;
  margin: 0;
}

.mobile-quote-info div {
  min-width: 0;
}

.mobile-quote-info dt {
  color: #8792a4;
  font-size: 10px;
}

.mobile-quote-info dd {
  margin: 4px 0 0;
  color: #172033;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.mobile-quote-address {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e3e8f0;
}

.mobile-quote-address span,
.mobile-quote-address b {
  display: block;
}

.mobile-quote-address span {
  color: #8792a4;
  font-size: 10px;
}

.mobile-quote-address b {
  margin-top: 4px;
  color: #172033;
  font-size: 12px;
  line-height: 1.55;
}

.mobile-quote-items,
.mobile-quote-costs {
  display: grid;
  gap: 10px;
}

.mobile-quote-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf0f5;
}

.mobile-quote-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.mobile-item-index {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: #eef4ff;
  color: #2563eb;
  font-size: 10px;
  font-weight: 700;
}

.mobile-item-main {
  min-width: 0;
}

.mobile-item-main strong {
  display: block;
  font-size: 13px;
  line-height: 1.45;
}

.mobile-item-main p {
  margin: 4px 0 0;
  color: #657386;
  font-size: 11px;
  line-height: 1.5;
}

.mobile-item-main span {
  display: block;
  margin-top: 5px;
  color: #8792a4;
  font-size: 10px;
}

.mobile-quote-item > b {
  color: #172033;
  font-size: 12px;
  white-space: nowrap;
}

.mobile-quote-costs div,
.mobile-quote-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-quote-costs div {
  padding-bottom: 8px;
  border-bottom: 1px solid #edf0f5;
  color: #586579;
  font-size: 11px;
}

.mobile-quote-costs div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.mobile-quote-costs b,
.mobile-quote-summary b {
  color: #172033;
  font-size: 12px;
}

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

.mobile-quote-summary span {
  color: #657386;
  font-size: 11px;
}

.mobile-quote-summary .is-total {
  margin: 3px -14px -14px;
  padding: 14px;
  border-radius: 0 0 12px 12px;
  background: #f7faff;
}

.mobile-quote-summary .is-total span,
.mobile-quote-summary .is-total b {
  color: #172033;
  font-size: 14px;
  font-weight: 700;
}

.mobile-quote-summary .is-total b {
  font-size: 21px;
}

.mobile-quote-pay {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 14px 12px;
}

.mobile-quote-pay div {
  padding: 12px;
  border: 1px solid #dce3ec;
  border-radius: 10px;
  background: #f8fafc;
}

.mobile-quote-pay span,
.mobile-quote-pay b {
  display: block;
}

.mobile-quote-pay span {
  color: #657386;
  font-size: 10px;
}

.mobile-quote-pay b {
  margin-top: 5px;
  font-size: 14px;
}

.mobile-quote-terms strong {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
}

.mobile-quote-terms p {
  margin: 0 0 9px;
  color: #586579;
  font-size: 11px;
  line-height: 1.7;
}

.mobile-quote-terms p:last-child {
  margin-bottom: 0;
}

.mobile-quote-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
  margin-bottom: 18px;
  padding-top: 24px;
}

.mobile-quote-sign div {
  padding-top: 10px;
  border-top: 1px solid #8d98a8;
}

.mobile-quote-sign strong,
.mobile-quote-sign span {
  display: block;
}

.mobile-quote-sign strong {
  font-size: 10px;
}

.mobile-quote-sign span {
  margin-top: 7px;
  color: #657386;
  font-size: 9px;
}

.mobile-quote-sheet.is-compact {
  border-radius: 12px;
}

.mq-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 2px solid #172033;
}

.mq-brand-copy,
.mq-code {
  min-width: 0;
}

.mq-brand-copy strong,
.mq-brand-copy span,
.mq-code span,
.mq-code b {
  display: block;
}

.mq-brand-copy strong {
  font-size: 17px;
}

.mq-brand-copy span {
  margin-top: 3px;
  color: #657386;
  font-size: 10px;
}

.mq-code {
  text-align: right;
}

.mq-code span {
  color: #172033;
  font-family: "Consolas", monospace;
  font-size: 10px;
  font-weight: 700;
}

.mq-code b {
  margin-top: 4px;
  color: #657386;
  font-size: 9px;
  font-weight: 500;
}

.mq-heading {
  padding: 16px 16px 11px;
}

.quote-paper .mq-heading h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
  text-align: left;
}

.mq-heading p {
  margin: 5px 0 0;
  color: #657386;
  font-size: 10px;
}

.mq-block {
  margin: 0 12px 8px;
  padding: 10px 12px;
  border: 1px solid #dce3ec;
  border-radius: 9px;
}

.mq-key-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}

.mq-key-grid div {
  min-width: 0;
}

.mq-key-grid span,
.mq-key-grid b {
  display: block;
}

.mq-key-grid span {
  color: #8792a4;
  font-size: 9px;
}

.mq-key-grid b {
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 500;
}

.mq-address-lines {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #edf0f5;
}

.mq-address-lines div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 7px;
  font-size: 9px;
  line-height: 1.5;
}

.mq-address-lines span {
  color: #8792a4;
}

.mq-address-lines b {
  font-weight: 500;
}

.mq-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.mq-block-head strong {
  font-size: 12px;
}

.mq-block-head span {
  color: #2563eb;
  font-size: 9px;
}

.mq-item-block,
.mq-calculation {
  padding-top: 10px;
  padding-bottom: 4px;
}

.mq-item-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #edf0f5;
}

.mq-item-index {
  color: #8792a4;
  font-size: 10px;
  text-align: center;
}

.mq-item-copy {
  min-width: 0;
}

.mq-item-copy strong,
.mq-item-copy small {
  display: block;
}

.mq-item-copy strong {
  font-size: 11px;
  line-height: 1.4;
}

.mq-item-copy small {
  margin-top: 2px;
  color: #657386;
  font-size: 9px;
  line-height: 1.4;
}

.mq-item-price b {
  font-size: 11px;
  white-space: nowrap;
}

.mq-cost-row,
.mq-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid #edf0f5;
  color: #586579;
  font-size: 10px;
}

.mq-cost-row b,
.mq-summary-row b {
  color: #172033;
  font-size: 10px;
}

.mq-summary-row.is-total {
  margin: 4px -12px -4px;
  padding: 11px 12px;
  border-top: 2px solid #172033;
  border-radius: 0 0 9px 9px;
  background: #f8fafc;
}

.mq-summary-row.is-total span,
.mq-summary-row.is-total b {
  color: #172033;
  font-size: 14px;
  font-weight: 700;
}

.mq-summary-row.is-total b {
  font-size: 20px;
}

.mq-pay {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 0 12px 8px;
}

.mq-pay div {
  padding: 9px 10px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #fafbfd;
}

.mq-pay span,
.mq-pay b {
  display: block;
}

.mq-pay span {
  color: #8792a4;
  font-size: 9px;
}

.mq-pay b {
  margin-top: 3px;
  font-size: 12px;
}

.mq-note {
  margin: 0 12px 8px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #f7f9fc;
}

.mq-note p {
  margin: 0;
  color: #586579;
  font-size: 9px;
  line-height: 1.65;
}

.mq-note p + p {
  margin-top: 3px;
}

.mq-note strong {
  margin-right: 5px;
  color: #172033;
}

.mq-sign {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 12px 18px;
  padding-top: 9px;
  border-top: 1px solid #8d98a8;
  color: #657386;
  font-size: 9px;
}

.quote-address-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 10px 0 0;
  border: 1px solid #dce3ec;
}

.quote-address-row div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 36px;
  border-right: 1px solid #dce3ec;
}

.quote-address-row div:last-child {
  border-right: 0;
}

.quote-address-row span,
.quote-address-row b {
  padding: 9px 10px;
  font-size: 9px;
}

.quote-address-row span {
  background: #f6f8fb;
  color: #657386;
}

.quote-address-row b {
  font-weight: 500;
}

.appointment-paper {
  width: min(760px, 100%);
  min-height: 960px;
  margin: 0 auto;
  padding: 46px 48px;
  background: #fff;
  color: #172033;
  box-shadow: 0 10px 35px rgba(22, 33, 58, 0.12);
}

.appointment-paper-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 2px solid #172033;
}

.appointment-paper-head strong,
.appointment-paper-head span {
  display: block;
}

.appointment-paper-head strong {
  font-size: 20px;
}

.appointment-paper-head span {
  margin-top: 5px;
  color: #657386;
  font-size: 10px;
}

.appointment-paper-head .appointment-doc-code {
  text-align: right;
}

.appointment-paper h1 {
  margin: 28px 0 0;
  font-size: 25px;
  letter-spacing: 0.08em;
  text-align: center;
}

.appointment-paper-subtitle {
  margin: 8px 0 24px;
  color: #657386;
  font-size: 11px;
  text-align: center;
}

.appointment-time-highlight {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  align-items: center;
  gap: 3px 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #dce3ec;
  background: #f7faff;
}

.appointment-time-highlight span {
  color: #657386;
  font-size: 9px;
}

.appointment-time-highlight strong {
  font-size: 16px;
}

.appointment-time-highlight small {
  grid-column: 2;
  color: #657386;
  font-size: 9px;
}

.appointment-time-highlight.is-urgent,
.appointment-time-highlight.is-danger {
  border-color: rgba(201, 52, 61, 0.24);
  background: #fff8f8;
}

.appointment-time-highlight.is-warning {
  border-color: rgba(185, 101, 5, 0.24);
  background: #fffcf5;
}

.appointment-paper-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #dce3ec;
}

.appointment-paper-grid div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  min-height: 42px;
  border-right: 1px solid #dce3ec;
  border-bottom: 1px solid #dce3ec;
  font-size: 10px;
}

.appointment-paper-grid div:nth-child(2n) {
  border-right: 0;
}

.appointment-paper-grid div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.appointment-paper-grid span,
.appointment-paper-grid b {
  padding: 11px 12px;
}

.appointment-paper-grid span {
  background: #f6f8fb;
  color: #657386;
}

.appointment-paper-grid b {
  font-weight: 500;
}

.appointment-paper-note {
  min-height: 116px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #dce3ec;
}

.appointment-paper-note strong {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
}

.appointment-paper-note p {
  margin: 0;
  color: #586579;
  font-size: 10px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.appointment-paper-tip {
  margin-top: 20px;
  padding: 12px 14px;
  border-left: 3px solid #2563eb;
  background: #f7faff;
  color: #586579;
  font-size: 10px;
  line-height: 1.75;
}

.appointment-paper-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  margin-top: 62px;
}

.appointment-paper-sign div {
  min-height: 70px;
  padding-top: 9px;
  border-top: 1px solid #7d8899;
  color: #586579;
  font-size: 9px;
}

.appointment-paper-sign strong {
  display: block;
  margin-bottom: 8px;
  color: #172033;
  font-size: 10px;
}

.quote-paper h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.quote-paper .quote-subtitle {
  margin: 8px 0 0;
  color: #657386;
  font-size: 12px;
  text-align: center;
}

.quote-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 2px solid #172033;
}

.quote-brand-row strong {
  display: block;
  font-size: 18px;
}

.quote-brand-row span {
  display: block;
  margin-top: 4px;
  color: #657386;
  font-size: 11px;
}

.quote-brand-row .quote-code {
  text-align: right;
}

.quote-brand-row .quote-code b {
  display: block;
  font-size: 14px;
}

.quote-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 18px;
  border: 1px solid #dce3ec;
}

.quote-meta-grid div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  min-height: 35px;
  border-right: 1px solid #dce3ec;
  border-bottom: 1px solid #dce3ec;
  font-size: 12px;
}

.quote-meta-grid div:nth-child(2n) {
  border-right: 0;
}

.quote-meta-grid div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.quote-meta-grid span,
.quote-meta-grid b {
  padding: 9px 10px;
}

.quote-meta-grid span {
  background: #f6f8fb;
  color: #657386;
}

.quote-meta-grid b {
  font-weight: 500;
}

.quote-section-title {
  margin: 22px 0 8px;
  font-size: 13px;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.quote-table th,
.quote-table td {
  padding: 8px;
  border: 1px solid #dce3ec;
  font-size: 11px;
  text-align: center;
  vertical-align: top;
}

.quote-table th {
  background: #f6f8fb;
  color: #586579;
  font-weight: 600;
  text-align: center;
}

.quote-table td.num,
.quote-table th.num {
  text-align: center;
}

.quote-table th:nth-child(1) {
  width: 7%;
}

.quote-table th:nth-child(2) {
  width: 22%;
}

.quote-table th:nth-child(3) {
  width: 34%;
}

.quote-table th:nth-child(4) {
  width: 10%;
}

.quote-table th:nth-child(5) {
  width: 13%;
}

.quote-table th:nth-child(6) {
  width: 14%;
}

.quote-total-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 245px;
  gap: 18px;
  margin-top: 14px;
}

.quote-terms {
  color: #586579;
  font-size: 11px;
  line-height: 1.8;
}

.quote-terms strong {
  color: #172033;
}

.quote-totals {
  border-top: 1px solid #dce3ec;
}

.quote-totals div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #dce3ec;
  font-size: 12px;
}

.quote-totals .grand-total {
  padding: 10px 0;
  border-bottom-color: #172033;
  font-size: 12px;
  font-weight: 700;
}

.quote-totals .grand-total strong {
  font-size: 17px;
}

.quote-payment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.quote-payment div {
  padding: 10px;
  border: 1px solid #dce3ec;
  background: #f8fafc;
  font-size: 11px;
}

.quote-payment strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.quote-signature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 45px;
  margin-top: 42px;
}

.quote-signature div {
  min-height: 72px;
  padding-top: 8px;
  border-top: 1px solid #7d8899;
  color: #586579;
  font-size: 11px;
}

.quote-signature strong {
  display: block;
  margin-bottom: 8px;
  color: #172033;
  font-size: 11px;
}

.action-dialog {
  width: min(600px, calc(100vw - 32px));
}

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

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

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

.toast {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: #1b2331;
  color: #f5f8fd;
  box-shadow: 0 12px 32px rgba(13, 20, 33, 0.25);
  font-size: 11px;
  line-height: 1.55;
  animation: toast-in 180ms ease both;
}

.toast.is-error {
  background: #6e252a;
}

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

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

@media (max-width: 1260px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .order-list-head,
  .order-row {
    grid-template-columns: minmax(170px, 1.2fr) 115px 95px 120px 105px;
  }

  .order-list-head > :nth-child(4),
  .order-row > :nth-child(4) {
    display: none;
  }

  .kanban {
    grid-template-columns: repeat(3, minmax(210px, 1fr));
  }
}

@media (max-width: 1020px) {
  .header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 10px 18px 0;
  }

  .app-header .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .top-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0 -18px;
    padding: 4px 14px 8px;
    overflow-x: auto;
    border-top: 1px solid var(--line);
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .top-nav button {
    flex: 1 0 auto;
  }

  .main {
    padding: 21px 20px 36px;
  }

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

  .kanban {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

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

}

@media (max-width: 720px) {
  .header-inner {
    gap: 8px;
    padding: 8px 10px 0;
  }

  .app-header .brand span,
  .header-create {
    display: none;
  }

  .header-tools {
    justify-self: end;
  }

  .header-sync {
    min-height: 40px;
    padding: 7px 9px;
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0 -10px;
    padding: 4px 8px 7px;
    overflow: visible;
  }

  .top-nav button {
    min-width: 0;
    min-height: 44px;
    padding: 0 3px;
    font-size: 12px;
  }

  .top-nav svg {
    display: none;
  }

  .main {
    padding: 18px 13px 30px;
  }

  .tracking-external > .section-heading > p {
    text-align: left;
  }

  .topbar {
    display: grid;
    gap: 14px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .top-actions .btn,
  .dialog-foot .btn {
    min-height: 44px;
  }

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

  .metric-card {
    min-height: 105px;
  }

  .metric-card:last-child {
    grid-column: 1 / -1;
  }

  .appointment-card {
    grid-template-columns: 52px minmax(0, 1fr);
    padding: 13px;
  }

  .appointment-card > .chevron {
    display: none;
  }

  .filter-bar {
    align-items: stretch;
  }

  .search-field {
    min-width: 100%;
  }

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

  .order-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 88px;
    padding: 13px;
  }

  .order-row > :nth-child(2),
  .order-row > :nth-child(4),
  .order-row > :nth-child(5) {
    display: none;
  }

  .order-row > :nth-child(3) {
    justify-self: end;
  }

  .order-row > :nth-child(6) {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

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

  .external-job-list {
    grid-template-columns: 1fr;
  }

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

  .app-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .dialog-head,
  .dialog-body,
  .dialog-foot {
    padding-right: 15px;
    padding-left: 15px;
  }

  .dialog-foot {
    position: sticky;
    bottom: 0;
    z-index: 2;
  }

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

  .field input,
  .field select,
  .field textarea,
  .inline-actions select,
  .money-input input,
  .suffix-input input,
  .line-table input,
  .cost-row select,
  .cost-row input,
  .catalog-input,
  .catalog-number {
    min-height: 44px;
  }

  .row-delete {
    width: 44px;
    height: 44px;
  }

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

  .section-heading {
    display: grid;
  }

  .mobile-line-hint {
    display: block;
  }

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

  .cost-row > :nth-child(2) {
    grid-column: 1 / -1;
  }

  .cost-row > :nth-child(5) {
    justify-self: end;
  }

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

  .order-summary div:nth-child(2) {
    border-right: 0;
  }

  .order-summary div:nth-child(3),
  .order-summary div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

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

  .action-fields {
    grid-template-columns: 1fr;
  }

  .quote-scroll {
    padding: 10px;
  }

  .quote-paper {
    min-width: 700px;
    transform-origin: top left;
  }

  .appointment-paper {
    width: 100%;
    min-height: 0;
    padding: 26px 16px 34px;
  }

  .appointment-paper-grid,
  .appointment-paper-sign {
    grid-template-columns: 1fr;
  }

  .appointment-paper-grid div:nth-child(2n) {
    border-right: 1px solid #dce3ec;
  }

  .appointment-paper-grid div:nth-last-child(-n + 2) {
    border-bottom: 1px solid #dce3ec;
  }

  .appointment-paper-grid div:last-child {
    border-bottom: 0;
  }

  .quote-paper .quote-meta-grid,
  .quote-paper .quote-signature {
    grid-template-columns: 1fr;
  }

  .quote-paper .quote-meta-grid div:nth-child(2n) {
    border-right: 1px solid #dce3ec;
  }

  .quote-paper .quote-meta-grid div:nth-last-child(-n + 2) {
    border-bottom: 1px solid #dce3ec;
  }

  .quote-paper .quote-meta-grid div:last-child {
    border-bottom: 0;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body {
    background: #fff;
  }

  body.printing-quote > :not(#quote-dialog) {
    display: none !important;
  }

  body.printing-quote #quote-dialog {
    position: static;
    display: block !important;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.printing-quote #quote-dialog::backdrop {
    display: none;
  }

  body.printing-quote .print-hide {
    display: none !important;
  }

  body.printing-quote .quote-scroll {
    padding: 0;
    overflow: visible;
    background: #fff;
  }

  body.printing-quote .quote-paper {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    padding: 15mm 16mm;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.printing-quote .quote-mobile-view {
    display: none !important;
  }

  body.printing-quote .quote-desktop-view {
    display: block !important;
  }

  body.printing-appointment > :not(#appointment-doc-dialog) {
    display: none !important;
  }

  body.printing-appointment #appointment-doc-dialog {
    position: static;
    display: block !important;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.printing-appointment #appointment-doc-dialog::backdrop {
    display: none;
  }

  body.printing-appointment .print-hide {
    display: none !important;
  }

  body.printing-appointment .quote-scroll {
    padding: 0;
    overflow: visible;
    background: #fff;
  }

  body.printing-appointment .appointment-paper {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    padding: 18mm 18mm;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
