:root {
  --canvas: #f3f2ee;
  --surface: #ffffff;
  --surface-muted: #f8f8f5;
  --ink: #172126;
  --muted: #687177;
  --line: #d9ddda;
  --line-strong: #bdc6c1;
  --sidebar: #162a2b;
  --sidebar-soft: #21393a;
  --teal: #16796d;
  --teal-soft: #e1f1ed;
  --amber: #c9851d;
  --amber-soft: #fff0d7;
  --blue: #3978a6;
  --blue-soft: #e6f0f7;
  --rose: #b94f4b;
  --rose-soft: #f8e5e3;
  --violet: #75609a;
  --violet-soft: #eee9f5;
  --shadow: 0 12px 30px rgba(27, 42, 40, 0.08);
  --radius: 6px;
  --sidebar-width: 236px;
  font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: #58706d;
  background: #edf0eb;
  font-size: 12px;
}

.boot-screen p { margin: 0; }

.boot-mark {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  background: var(--sidebar);
  border-radius: 5px;
  box-shadow: 0 10px 25px rgba(22, 42, 43, 0.18);
}

.boot-mark span {
  display: block;
  width: 5px;
  background: #f4b04d;
  border-radius: 1px 1px 0 0;
  animation: boot-pulse 900ms ease-in-out infinite alternate;
}

.boot-mark span:nth-child(1) { height: 10px; }
.boot-mark span:nth-child(2) { height: 22px; animation-delay: 160ms; }
.boot-mark span:nth-child(3) { height: 15px; animation-delay: 320ms; }

@keyframes boot-pulse {
  from { opacity: 0.45; transform: scaleY(0.72); transform-origin: bottom; }
  to { opacity: 1; transform: scaleY(1); transform-origin: bottom; }
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(330px, 0.85fr) minmax(500px, 1.15fr);
  background: #edf0eb;
}

.auth-brand-panel {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  color: #edf5f3;
  background: var(--sidebar);
  border-right: 1px solid #2b4445;
}

.auth-brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-brand-mark {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  padding: 10px;
}

.auth-brand-lockup p {
  margin: 0 0 5px;
  color: #9fb5b4;
  font-size: 11px;
  font-weight: 700;
}

.auth-brand-lockup h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
}

.auth-brand-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9fb5b4;
  font-size: 12px;
}

.auth-form-area {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 36px;
}

.auth-panel {
  width: min(440px, 100%);
  padding: 30px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--teal);
  border-radius: var(--radius);
  box-shadow: 0 22px 55px rgba(26, 43, 41, 0.12);
}

.auth-heading {
  margin-bottom: 20px;
}

.auth-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  margin-bottom: 22px;
  padding: 3px;
  background: #edf0ed;
  border-radius: 5px;
}

.auth-tab {
  min-height: 38px;
  color: #65716f;
  background: transparent;
  border: 0;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
}

.auth-tab.is-active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(32, 55, 52, 0.08);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 3px;
}

.auth-message {
  margin-top: 16px;
  padding: 11px 12px;
  color: #315f58;
  background: var(--teal-soft);
  border-left: 4px solid var(--teal);
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.6;
}

.auth-message.is-error {
  color: #7c4744;
  background: var(--rose-soft);
  border-left-color: var(--rose);
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(22, 121, 109, 0.25);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  color: #edf5f3;
  background: var(--sidebar);
  border-right: 1px solid #2b4445;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-block strong,
.brand-block small {
  display: block;
  overflow: hidden;
  max-width: 150px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-block strong {
  font-size: 16px;
  line-height: 1.45;
}

.brand-block small {
  margin-top: 3px;
  color: #9fb5b4;
  font-size: 12px;
}

.brand-mark {
  display: flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 8px;
  background: #f4b04d;
  border-radius: 4px;
}

.brand-mark span {
  display: block;
  width: 4px;
  background: var(--sidebar);
  border-radius: 1px 1px 0 0;
}

.brand-mark span:nth-child(1) { height: 8px; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 11px; }

.main-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding: 18px 12px;
}

.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 0 12px;
  color: #b9c9c8;
  background: transparent;
  border: 0;
  border-radius: 5px;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  color: #ffffff;
  background: var(--sidebar-soft);
  transform: translateX(2px);
}

.nav-item.is-active {
  color: #ffffff;
  background: #2a4848;
  box-shadow: inset 3px 0 0 #f4b04d;
}

.nav-icon {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  font-size: 17px;
}

.nav-count {
  display: inline-grid;
  min-width: 25px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  color: #d6e5e3;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  font-size: 11px;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px;
  color: #99afad;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
}

.storage-dot {
  width: 8px;
  height: 8px;
  background: #65bea8;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(101, 190, 168, 0.12);
}

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

.topbar {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 30px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-kicker {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
}

.topbar-actions,
.toolbar-actions,
.filter-row,
.dialog-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-menu {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 4px 5px 4px 7px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.user-avatar {
  display: inline-grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  color: #ffffff;
  background: var(--teal);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.user-email {
  overflow: hidden;
  max-width: 190px;
  color: #536068;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.logout-button {
  min-height: 28px;
  padding: 0 6px;
}

#sync-status.is-syncing .storage-dot {
  background: #f4b04d;
  box-shadow: 0 0 0 4px rgba(244, 176, 77, 0.12);
}

#sync-status.is-error .storage-dot {
  background: #df7771;
  box-shadow: 0 0 0 4px rgba(223, 119, 113, 0.12);
}

.today-chip {
  min-height: 38px;
  padding: 9px 12px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

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

.button-primary {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
}

.button-primary:hover { background: #11685e; }

.button-secondary {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line-strong);
}

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

.button-danger {
  color: var(--rose);
  background: #ffffff;
  border-color: #d6aaa7;
}

.button-danger:hover {
  color: #ffffff;
  background: var(--rose);
  border-color: var(--rose);
}

.text-button {
  padding: 4px 0;
  color: var(--teal);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
}

.text-button:hover { color: #0e5b53; }

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 25px;
  line-height: 1;
}

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

.view {
  display: none;
  padding: 26px 30px 42px;
  animation: view-in 220ms ease both;
}

.view.is-active { display: block; }

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

.stage-cumulative-section {
  margin-bottom: 18px;
}

.stage-cumulative-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.stage-cumulative-heading h2,
.stage-cumulative-group h3 {
  margin: 0;
}

.stage-cumulative-heading h2 {
  font-size: 20px;
}

.stage-cumulative-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

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

.stage-cumulative-group {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--stage-accent);
  border-radius: var(--radius);
}

.stage-cumulative-group--first { --stage-accent: #486f73; }
.stage-cumulative-group--second { --stage-accent: var(--teal); }

.stage-cumulative-group-heading {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.stage-cumulative-badge {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--stage-accent);
  font-size: 11px;
  font-weight: 800;
}

.stage-cumulative-group h3 {
  font-size: 15px;
}

.stage-cumulative-total {
  display: grid;
  min-width: 88px;
  justify-items: end;
}

.stage-cumulative-total strong {
  color: var(--ink);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.stage-cumulative-total span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.stage-cumulative-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.stage-cumulative-stats > div {
  min-width: 0;
  padding: 12px 14px;
  border-top: 1px solid #eef1ef;
}

.stage-cumulative-stats > div:nth-child(-n + 4) {
  border-top: 0;
}

.stage-cumulative-stats dt {
  min-height: 16px;
  color: var(--muted);
  font-size: 10px;
}

.stage-cumulative-stats dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.summary-band {
  display: flex;
  min-height: 116px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 22px 24px;
  color: #ffffff;
  background: #234f4d;
  border-left: 6px solid #f4b04d;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.summary-band .section-kicker { color: #b9d9d4; }

.summary-band h2 {
  margin: 0;
  font-size: 26px;
}

.summary-band p:last-child {
  margin: 5px 0 0;
  color: #d0e1de;
  font-size: 14px;
}

.summary-band .field span { color: #d0e1de; }

.summary-band select {
  min-width: 180px;
  color: var(--ink);
  background: #ffffff;
  border-color: transparent;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  min-width: 0;
  min-height: 128px;
  padding: 18px 16px 15px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--metric-color, var(--teal));
}

.metric-card::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 16px;
  width: 8px;
  height: 8px;
  background: var(--metric-color, var(--teal));
  border-radius: 50%;
}

.metric-total { --metric-color: var(--ink); }
.metric-appointment { --metric-color: var(--teal); }
.metric-missed { --metric-color: var(--amber); }
.metric-declined { --metric-color: var(--rose); }
.metric-invalid { --metric-color: var(--violet); }
.metric-converted { --metric-color: var(--blue); }

.trend-panel {
  margin-bottom: 18px;
  overflow: hidden;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  display: inline-block;
  width: 20px;
  height: 3px;
  border-radius: 2px;
}

.legend-leads { background: var(--teal); }
.legend-visits { background: var(--rose); }

.line-chart {
  width: 100%;
  min-height: 350px;
  padding: 14px 16px 10px;
  overflow-x: auto;
}

.line-chart svg {
  display: block;
  width: auto;
  min-width: 100%;
  height: 320px;
}

.line-grid-line {
  stroke: #e1e6e3;
  stroke-width: 1;
}

.line-axis-label {
  fill: #747e82;
  font-family: "Microsoft JhengHei", sans-serif;
  font-size: 11px;
}

.line-week-label {
  fill: #40504f;
  font-weight: 700;
}

.line-date-label {
  font-size: 10px;
}

.line-series-leads,
.line-series-visits {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-series-leads { stroke: var(--teal); }
.line-series-visits { stroke: var(--rose); }
.line-point-leads { fill: #ffffff; stroke: var(--teal); stroke-width: 2; }
.line-point-visits { fill: #ffffff; stroke: var(--rose); stroke-width: 2; }

.analytics-section {
  margin-top: 24px;
}

.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.section-heading-row h2 {
  margin: 0;
  font-size: 18px;
}

.analysis-total {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.section-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.pdf-export-button {
  white-space: nowrap;
}

.pie-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 12px;
}

.pie-card {
  position: relative;
  min-width: 0;
  min-height: 260px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pie-card[data-pie-detail] {
  cursor: zoom-in;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.pie-card[data-pie-detail]:hover,
.pie-card[data-pie-detail]:focus-visible {
  border-color: #7fa69f;
  box-shadow: 0 8px 24px rgba(28, 66, 62, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.pie-expand-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #45625e;
  background: #edf3f0;
  border: 1px solid #d2dfda;
  border-radius: 4px;
  font-size: 15px;
  line-height: 1;
}

.pie-card h3 {
  margin: 0 0 14px;
  padding-right: 30px;
  font-size: 13px;
}

.pie-chart-content {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.pie-chart svg {
  display: block;
  width: 122px;
  height: 122px;
}

.pie-segment-0, .pie-color-0 { fill: #16796d; background: #16796d; }
.pie-segment-1, .pie-color-1 { fill: #3978a6; background: #3978a6; }
.pie-segment-2, .pie-color-2 { fill: #c9851d; background: #c9851d; }
.pie-segment-3, .pie-color-3 { fill: #b94f4b; background: #b94f4b; }
.pie-segment-4, .pie-color-4 { fill: #75609a; background: #75609a; }
.pie-segment-5, .pie-color-5 { fill: #568060; background: #568060; }
.pie-segment-6, .pie-color-6 { fill: #a05f7a; background: #a05f7a; }
.pie-segment-7, .pie-color-7 { fill: #60757f; background: #60757f; }

.pie-legend {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pie-legend li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
}

.pie-legend-label {
  overflow: hidden;
  color: #3f4a4f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pie-legend-swatch {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.pie-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: #899095;
  font-size: 11px;
}

.pie-detail-dialog {
  width: min(1120px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: hidden;
}

.pie-detail-shell {
  display: flex;
  max-height: calc(100vh - 28px);
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  overflow-y: auto;
}

.pie-detail-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
}

.pie-detail-layout {
  display: grid;
  width: 100%;
  min-height: 0;
  grid-template-columns: minmax(560px, 620px) minmax(0, 1fr);
  align-items: stretch;
  gap: 20px;
}

.pie-detail-chart {
  display: grid;
  width: 100%;
  min-height: 540px;
  place-items: center;
  padding: 18px;
  background: #f6f8f6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pie-detail-chart svg {
  display: block;
  width: min(580px, 100%);
  aspect-ratio: 1;
}

.pie-detail-total-number {
  fill: #183f3a;
  font-size: 13px;
  font-weight: 800;
}

.pie-detail-total-unit {
  fill: #6c7775;
  font-size: 7px;
  font-weight: 700;
}

.pie-detail-label {
  fill: #ffffff;
  stroke: rgba(25, 43, 40, 0.82);
  stroke-width: 1.05px;
  paint-order: stroke fill;
  font-size: 5.5px;
  font-weight: 900;
  letter-spacing: 0;
  pointer-events: none;
}

.pie-detail-label.is-compact {
  stroke-width: 0.9px;
  font-size: 4.5px;
}

.pie-detail-table-scroll {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  align-self: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pie-detail-table {
  min-width: 0;
}

.pie-detail-table td:first-child,
.pie-detail-table th:first-child {
  width: 58px;
  text-align: center;
}

.pie-detail-table td:nth-child(3),
.pie-detail-table td:nth-child(4),
.pie-detail-table th:nth-child(3),
.pie-detail-table th:nth-child(4) {
  width: 92px;
  text-align: right;
}

.pie-detail-rank {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.pie-detail-group-row td {
  color: #183f3a;
  background: #edf5f2;
}

.pie-detail-subrow td {
  color: var(--muted);
  background: #fafbf9;
  font-size: 11px;
}

.pie-detail-subrow td:nth-child(2) {
  padding-left: 28px;
}

@media (max-width: 1050px) {
  .pie-detail-layout {
    grid-template-columns: 1fr;
  }

  .pie-detail-chart {
    min-height: 460px;
  }

  .pie-detail-chart svg {
    width: min(520px, 100%);
  }

  .pie-detail-table-scroll {
    height: 360px;
    max-height: 360px;
  }
}

.metric-label {
  display: block;
  padding-right: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 32px;
  line-height: 1.1;
}

.metric-card small {
  color: #8a9296;
  font-size: 10px;
}

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

.data-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel-heading {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 0;
  font-size: 16px;
}

.table-scroll {
  width: 100%;
  overflow: auto;
}

.compact-table-scroll { max-height: 430px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  height: 46px;
  padding: 9px 12px;
  border-bottom: 1px solid #e8ebe9;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 42px;
  color: #667075;
  background: #f7f8f6;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background 120ms ease;
}

.data-table tbody tr:hover { background: #fafbf9; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .selected-week-row { background: #edf6f3; }
.data-table .selected-week-row:hover { background: #e5f2ee; }
.data-table .pre-launch-row { background: #fff8ea; }
.data-table .pre-launch-row:hover { background: #fff3d8; }

.weekly-table td:nth-child(n+3),
.weekly-table th:nth-child(n+3) {
  text-align: center;
}

.week-index {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #35504d;
  background: #edf0ed;
  border-radius: 4px;
  font-weight: 700;
}

.selected-week-row .week-index {
  color: #ffffff;
  background: var(--teal);
}

.pre-launch-index {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  color: #785318;
  background: #f6dfad;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
}

.comparison-range strong,
.comparison-range small {
  display: block;
  white-space: nowrap;
}

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

.conversion-rate {
  color: var(--teal);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.source-chart {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 22px;
}

.source-row {
  display: grid;
  grid-template-columns: 70px minmax(90px, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.source-label,
.source-value {
  font-size: 12px;
  font-weight: 700;
}

.source-value {
  color: var(--muted);
  text-align: right;
}

.source-progress {
  appearance: none;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  background: #eceeec;
  border-radius: 4px;
  color: #6f7b7a;
}

.source-progress::-webkit-progress-bar {
  background: #eceeec;
  border-radius: 4px;
}

.source-progress::-webkit-progress-value {
  background: currentColor;
  border-radius: 4px;
  transform-origin: left;
  animation: bar-grow 420ms ease both;
}

.source-progress::-moz-progress-bar {
  background: currentColor;
  border-radius: 4px;
}

.source-progress--list { color: #16796d; }
.source-progress--official { color: #b24f62; }
.source-progress--phone { color: #3978a6; }
.source-progress--591 { color: #c9851d; }
.source-progress--leju { color: #75609a; }
.source-progress--other { color: #6f7b7a; }

@keyframes bar-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.empty-chart,
.empty-row td {
  color: #899095;
  text-align: center;
}

.staff-panel { margin-bottom: 10px; }

.dashboard-stage-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 12px;
  padding: 0 2px 12px;
  border-bottom: 1px solid var(--line);
}

.dashboard-stage-toolbar h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.dashboard-stage-control > button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dashboard-stage-control small {
  min-width: 22px;
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  text-align: right;
  opacity: 0.78;
}

.stage-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.stage-toolbar h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.stage-control button {
  gap: 7px;
  grid-auto-flow: column;
}

.stage-control button span {
  min-width: 24px;
  padding: 1px 5px;
  color: inherit;
  background: rgba(255, 255, 255, 0.42);
  border-radius: 3px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.page-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.lead-date-bar {
  display: grid;
  grid-template-columns: minmax(150px, 180px) 22px minmax(150px, 180px) minmax(150px, 180px) 36px;
  align-items: end;
  gap: 10px;
  margin: -2px 0 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.date-range-separator {
  display: grid;
  height: 40px;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.lead-date-reset {
  margin-bottom: 2px;
  background: var(--surface-muted);
  border-color: var(--line);
}

.filter-row {
  flex: 1;
  align-items: flex-end;
  flex-wrap: wrap;
}

.search-field {
  display: block;
  width: min(360px, 100%);
}

.search-field input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px 8px 38px;
  color: var(--ink);
  background-color: #ffffff;
  background-image: radial-gradient(circle at 16px 17px, transparent 5px, #7f898d 6px, #7f898d 7px, transparent 8px), linear-gradient(45deg, transparent 46%, #7f898d 47%, #7f898d 56%, transparent 57%);
  background-repeat: no-repeat;
  background-size: 26px 28px, 8px 8px;
  background-position: 0 0, 22px 23px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  color: #495358;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.6;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.search-field input:hover { border-color: #96a39d; }

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus { border-color: var(--teal); }

.field small {
  color: #7d868a;
  font-size: 10px;
  line-height: 1.5;
}

.compact-field { min-width: 155px; }
.compact-field select { min-height: 40px; }

.table-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.table-summary span:first-child {
  color: var(--ink);
  font-weight: 700;
}

.record-group {
  display: block;
  max-width: 190px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  white-space: normal;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.table-pagination .icon-button {
  width: 34px;
  height: 34px;
  background: var(--surface);
  border-color: var(--line);
}

.table-panel {
  min-height: 460px;
  overflow: hidden;
}

.main-table {
  min-width: 1120px;
}

.visit-table { min-width: 2580px; }
.visit-table th,
.visit-table td { white-space: nowrap; }

.deal-table { min-width: 1960px; }
.deal-table th,
.deal-table td { white-space: nowrap; }

.selection-column {
  width: 46px;
  min-width: 46px;
  text-align: center !important;
}

.selection-column input,
.row-select {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal);
  cursor: pointer;
}

.data-table tbody tr.is-selected { background: #edf6f3; }
.data-table tbody tr.is-selected:hover { background: #e5f2ee; }

.selection-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.main-table td {
  height: 56px;
}

.phone-cell strong,
.phone-cell small {
  display: block;
  white-space: nowrap;
}

.phone-cell .phone-number { white-space: nowrap; }

.phone-cell strong {
  color: #26343a;
  font-weight: 600;
}

.phone-cell .phone-number.is-duplicate {
  color: #e00000;
  font-weight: 800;
}

.phone-duplicate-details {
  width: max-content;
  max-width: 280px;
  margin-top: 4px;
  color: #9f1111;
  font-size: 9px;
}

.phone-duplicate-details summary {
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.phone-duplicate-details ul {
  display: grid;
  min-width: 230px;
  max-width: 280px;
  gap: 5px;
  margin: 6px 0 0;
  padding: 7px 8px;
  list-style: none;
  color: #4d2b2b;
  background: #fff1f1;
  border-left: 3px solid #e00000;
}

.phone-duplicate-details li {
  display: grid;
  grid-template-columns: 76px minmax(72px, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.phone-duplicate-details li strong {
  overflow: hidden;
  color: #3b2424;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-duplicate-details time {
  color: #7a5555;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.phone-duplicate-type {
  color: #b30000;
  font-weight: 800;
  white-space: nowrap;
}

.phone-cell small {
  margin-top: 3px;
  color: #899196;
  font-size: 9px;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-source-1,
.badge-source-list { color: #315f58; background: var(--teal-soft); border-color: #bbddd5; }
.badge-source-official { color: #874250; background: #f8e9ec; border-color: #e8bec7; }
.badge-source-phone { color: #2c6086; background: var(--blue-soft); border-color: #c8ddea; }
.badge-source-591 { color: #8a5a11; background: var(--amber-soft); border-color: #ead2a7; }
.badge-source-home { color: #665184; background: var(--violet-soft); border-color: #d9cfe7; }
.badge-source-unknown { color: #7c4744; background: var(--rose-soft); border-color: #e6c3c0; }

.status-appointment { color: #315f58; background: var(--teal-soft); }
.status-missed { color: #8a5a11; background: var(--amber-soft); }
.status-declined { color: #7c4744; background: var(--rose-soft); }
.status-invalid { color: #665184; background: var(--violet-soft); }
.status-other { color: #536068; background: #edf0f1; }
.status-empty { color: #7c858a; background: #f3f4f4; }

.visit-yes { color: #315f58; background: var(--teal-soft); }
.visit-no { color: #6f787c; background: #f1f2f1; }

.lead-visit-history {
  display: grid;
  min-width: 118px;
  gap: 3px;
  line-height: 1.35;
}

.lead-visit-history > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.lead-visit-history small {
  color: #687479;
  font-size: 9px;
  font-weight: 700;
}

.lead-visit-history span {
  color: #26343a;
  font-variant-numeric: tabular-nums;
}

.note-cell {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.row-action {
  display: inline-grid;
  min-width: 34px;
  height: 30px;
  place-items: center;
  padding: 0 8px;
  color: #536068;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
}

.row-action:hover {
  color: var(--teal);
  border-color: #9acbc2;
}

.row-action.delete:hover {
  color: var(--rose);
  border-color: #d9aaa7;
}

.rule-notice {
  margin-bottom: 12px;
  padding: 11px 14px;
  color: #3f5d59;
  background: #edf6f3;
  border: 1px solid #c8e0da;
  border-left: 4px solid var(--teal);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.6;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.settings-panel {
  padding-bottom: 18px;
}

.settings-panel > .form-grid,
.settings-panel > .field,
.settings-panel > .form-actions {
  margin: 18px;
}

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

.settings-fields {
  grid-template-columns: minmax(180px, 1.25fr) minmax(160px, 1fr) minmax(110px, 0.65fr);
}

.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.visit-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full-column { grid-column: 1 / -1; }

.management-list {
  display: flex;
  flex-direction: column;
  padding: 2px 18px 0;
}

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

.management-item:last-child { border-bottom: 0; }
.management-item strong { font-size: 13px; }
.management-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.danger-item strong { color: var(--rose); }

dialog {
  padding: 0;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(18, 33, 31, 0.24);
}

dialog::backdrop {
  background: rgba(16, 30, 30, 0.55);
  backdrop-filter: blur(2px);
}

.form-dialog {
  width: min(680px, calc(100vw - 28px));
}

#visit-dialog {
  width: min(1040px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: hidden;
}

#visit-dialog form {
  max-height: calc(100vh - 28px);
  overflow-y: auto;
}

.form-dialog form,
.confirm-dialog form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

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

.dialog-heading h2,
.confirm-dialog h2 {
  margin: 0;
  font-size: 20px;
}

.dialog-actions {
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.dialog-delete-action {
  margin-right: auto;
}

.customer-name-button {
  max-width: 100%;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: #9acbc2;
  text-underline-offset: 3px;
}

.customer-name-button:hover {
  color: var(--teal);
  text-decoration-color: currentColor;
}

.customer-name-button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

.auto-source-preview {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  background: #edf6f3;
  border-left: 4px solid var(--teal);
  border-radius: 4px;
}

.auto-source-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.auto-source-preview strong { font-size: 14px; }

.bulk-dialog { width: min(820px, calc(100vw - 28px)); }

.bulk-format {
  padding: 11px 13px;
  color: #4c5c62;
  background: #f4f6f4;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.7;
}

.bulk-format code {
  display: block;
  margin-top: 5px;
  color: #274640;
  font-family: Consolas, monospace;
  white-space: normal;
}

.bulk-dialog textarea {
  font-family: Consolas, "Microsoft JhengHei", monospace;
  font-size: 12px;
  white-space: pre;
}

.confirm-dialog {
  width: min(430px, calc(100vw - 28px));
}

.confirm-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  display: flex;
  width: min(360px, calc(100vw - 44px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  color: #ffffff;
  background: #263a39;
  border-left: 4px solid #65bea8;
  border-radius: 4px;
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.55;
  animation: toast-in 180ms ease both;
}

.toast.is-error { border-left-color: #df7771; }

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

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .dashboard-layout { grid-template-columns: 1fr; }
  .source-chart { min-height: 220px; }
  .pie-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .user-email { display: none; }
  .settings-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 78px; }

  .brand-block {
    justify-content: center;
    padding: 16px 10px;
  }

  .brand-block > div:last-child,
  .nav-item > span:not(.nav-icon),
  .sidebar-foot span:not(.storage-dot) { display: none; }

  .main-nav { padding: 14px 9px; }
  .nav-item { display: grid; grid-template-columns: 1fr; justify-items: center; padding: 0; }
  .nav-item.is-active { box-shadow: inset 3px 0 0 #f4b04d; }
  .sidebar-foot { justify-content: center; }
  .settings-layout { grid-template-columns: 1fr; }
  .visit-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .auth-screen { grid-template-columns: 1fr; }
  .auth-brand-panel {
    min-height: auto;
    padding: 26px 28px;
    border-right: 0;
    border-bottom: 1px solid #2b4445;
  }
  .auth-brand-foot { display: none; }
}

@media (max-width: 720px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    inset: auto 0 0 0;
    width: 100%;
    height: 64px;
    border-top: 1px solid #2b4445;
    border-right: 0;
  }

  .brand-block,
  .sidebar-foot { display: none; }

  .main-nav {
    display: grid;
    grid-template-columns: repeat(9, minmax(40px, 1fr));
    gap: 0;
    overflow-x: auto;
    padding: 6px 3px;
    scrollbar-width: none;
  }

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

  .nav-item {
    display: flex;
    min-height: 50px;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    color: #bdcecc;
    font-size: 8px;
  }

  .nav-item > span:not(.nav-count) { display: inline; }
  .nav-item .nav-icon { height: 25px; font-size: 16px; }
  .nav-count { display: none; }
  .nav-item.is-active { box-shadow: inset 0 -3px 0 #f4b04d; }

  .main-content { margin-left: 0; padding-bottom: 64px; }

  .auth-form-area { padding: 24px 16px; }
  .auth-panel { padding: 22px; }
  .auth-brand-lockup h1 { font-size: 20px; }

  .topbar {
    min-height: 76px;
    align-items: flex-start;
    padding: 14px 16px;
  }

  .topbar h1 { font-size: 17px; }
  .today-chip { display: none; }
  .topbar-actions .button { min-height: 34px; padding: 0 10px; font-size: 11px; }
  .user-menu { min-height: 34px; }
  .view { padding: 18px 14px 30px; }

  .stage-cumulative-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .stage-cumulative-grid { grid-template-columns: 1fr; }

  .summary-band {
    min-height: 0;
    align-items: flex-start;
    padding: 18px;
  }

  .summary-band h2 { font-size: 22px; }
  .summary-band .compact-field { min-width: 130px; }
  .summary-band select { min-width: 130px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 116px; padding: 16px 14px; }
  .metric-card strong { font-size: 28px; }
  .line-chart { min-height: 340px; padding-inline: 8px; }
  .settings-fields { grid-template-columns: 1fr; }
  .pie-grid { grid-template-columns: 1fr; }
  .pie-card { min-height: 220px; }

  .pie-detail-shell {
    gap: 14px;
    padding: 16px;
    overflow-y: auto;
  }

  .pie-detail-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .pie-detail-chart {
    min-height: 300px;
    padding: 8px;
  }

  .pie-detail-chart svg {
    width: min(420px, 88vw);
  }

  .pie-detail-table-scroll {
    height: 320px;
    max-height: 320px;
  }

  .dashboard-stage-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-stage-control {
    display: flex;
    width: 100%;
  }

  .dashboard-stage-control > button {
    flex: 1;
    justify-content: center;
  }

  .page-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .stage-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .stage-control {
    display: flex;
    width: 100%;
  }

  .stage-control button { flex: 1; }

  .filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .lead-date-bar {
    grid-template-columns: 1fr 1fr;
  }

  .date-range-separator { display: none; }
  .lead-date-reset { justify-self: start; }

  .search-field { grid-column: 1 / -1; width: 100%; }
  .compact-field { min-width: 0; }
  .toolbar-actions { justify-content: flex-end; }
  .toolbar-actions .button { flex: 1; }
  .table-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
  .table-pagination { justify-content: center; }
  .two-columns { grid-template-columns: 1fr; }
  .visit-form-grid { grid-template-columns: 1fr; }
  .management-item { grid-template-columns: 1fr; }
  .management-item .button { justify-self: start; }
  .form-dialog form, .confirm-dialog form { padding: 17px; }
  .auto-source-preview { grid-template-columns: 90px 1fr; }
}

@media (max-width: 440px) {
  .form-dialog .dialog-actions {
    flex-wrap: wrap;
  }

  .form-dialog .dialog-delete-action {
    flex: 1 0 100%;
    margin-right: 0;
  }

  .form-dialog .dialog-actions .button:not(.dialog-delete-action) {
    flex: 1;
  }

  .topbar-actions .button { display: none; }
  .today-chip { display: none; }
  .auth-brand-panel { padding: 20px; }
  .auth-brand-mark { width: 40px; height: 40px; flex-basis: 40px; padding: 8px; }
  .auth-form-area { align-items: start; padding-top: 18px; }
  .auth-panel { padding: 18px; }
  .summary-band { flex-direction: column; }
  .stage-cumulative-group-heading { min-height: 76px; padding: 12px 14px; }
  .stage-cumulative-total strong { font-size: 30px; }
  .stage-cumulative-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-cumulative-stats > div:nth-child(-n + 4) { border-top: 1px solid #eef1ef; }
  .stage-cumulative-stats > div:nth-child(-n + 2) { border-top: 0; }
  .summary-band .compact-field,
  .summary-band select { width: 100%; min-width: 0; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card small { display: none; }
  .metric-card { min-height: 100px; }
  .filter-row { grid-template-columns: 1fr; }
  .lead-date-bar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .toolbar-actions { flex-direction: column; }
  .toolbar-actions .button { width: 100%; }
  .section-heading-row { align-items: flex-start; flex-direction: column; gap: 5px; }
  .pie-chart-content { grid-template-columns: 110px minmax(0, 1fr); }
  .pie-chart svg { width: 110px; height: 110px; }
}

.deal-report-panel {
  min-height: 0;
  background: #ffccff;
  border-color: #705d70;
  box-shadow: 0 10px 26px rgba(78, 43, 75, 0.1);
}

.deal-report-heading {
  display: grid;
  min-height: 56px;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 8px 16px;
  color: #242126;
  background: #ffffff;
  border-bottom: 1px solid #705d70;
}

.deal-report-title-wrap {
  display: inline-flex;
  grid-column: 2;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-weight: 800;
}

.deal-report-title-wrap h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.deal-report-range {
  display: flex;
  grid-column: 3;
  align-items: center;
  justify-self: end;
  gap: 12px;
  font-size: 11px;
}

.deal-report-range span { color: #777078; }
.deal-report-range strong { color: #2d282e; font-size: 12px; }

.deal-classification-legend {
  display: flex;
  grid-column: 1;
  grid-row: 1;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
}

.deal-classification-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #4f474f;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.deal-legend-swatch {
  width: 16px;
  height: 16px;
  border: 1px solid #766a75;
}

.deal-legend-swatch.is-landlord { background: #ff99cc; }
.deal-legend-swatch.is-first-phase { background: #ffccff; }
.deal-legend-swatch.is-second-phase { background: #ffcc66; }

.deal-table-scroll {
  max-height: 620px;
  background: #ffccff;
}

.deal-table {
  min-width: 2840px;
  border-collapse: separate;
  border-spacing: 0;
  border-left: 1px solid #6d626d;
  border-top: 1px solid #6d626d;
  font-size: 10px;
}

.deal-table th,
.deal-table td {
  height: 40px;
  padding: 6px 8px;
  text-align: center;
  border-right: 1px solid #6d626d;
  border-bottom: 1px solid #6d626d !important;
}

.deal-table thead th {
  color: #282329;
  background: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.deal-table .deal-group-header th {
  top: 0;
  height: 34px;
}

.deal-table .deal-sub-header th {
  top: 34px;
  height: 30px;
  color: #4e474f;
  background: #f8f6f8;
  font-size: 9px;
}

.deal-table tbody td {
  color: #29242a;
  background: #ffccff;
}

.deal-table tbody tr:hover td { background: #f4bdf1; }
.deal-table tbody tr.is-selected td,
.deal-table tbody tr.is-selected:hover td { background: #e8afe5; }

.deal-table .empty-row td {
  height: 130px;
  color: #6f5e6e;
  background: #f7ddf4;
  font-size: 12px;
  text-align: center;
}

.deal-table .selection-column { background: #fff8ff; }

.deal-cell-group,
.deal-cell-date,
.deal-area-cell,
.deal-price-cell,
.deal-total-cell { font-variant-numeric: tabular-nums; }

.deal-cell-customer { min-width: 150px; }
.deal-match-cell { min-width: 130px; }
.deal-unit-code {
  font-weight: 800;
}

.deal-unit-code.is-zone-a { color: #0000ff !important; }
.deal-unit-code.is-zone-b { color: #29242a !important; }
.deal-table td.deal-cell-landlord { background: #ff99cc !important; }
.deal-table td.deal-cell-second-phase { background: #ffcc66 !important; }
.deal-table td.deal-text-red { color: #ff0000 !important; }
.deal-table td.deal-text-blue { color: #0000ff !important; }

.deal-area-cell { font-weight: 700; }
.deal-total-cell { font-weight: 800; }
.deal-salesperson-cell { font-weight: 700; }
.deal-parking-cell { min-width: 90px; }

.deal-table .note-cell {
  min-width: 190px;
  max-width: 260px;
  text-align: left;
}

.deal-table .row-actions { justify-content: center; }
.deal-table .row-action {
  height: 26px;
  color: #4f4050;
  background: rgba(255, 255, 255, 0.72);
  border-color: #8e708c;
}

.deal-report-summary {
  padding: 12px;
  color: #302a31;
  background: #ffffff;
  border-top: 1px solid #705d70;
}

.deal-rollup-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(105px, 1fr));
  border-top: 1px solid #7a7079;
  border-left: 1px solid #7a7079;
}

.deal-rollup-cell {
  display: grid;
  min-height: 54px;
  align-content: center;
  gap: 3px;
  padding: 7px 9px;
  border-right: 1px solid #7a7079;
  border-bottom: 1px solid #7a7079;
  text-align: center;
}

.deal-rollup-cell span { font-size: 9px; font-weight: 700; }
.deal-rollup-cell strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.deal-rollup-cell.is-lemon { background: #f5ef9b; }
.deal-rollup-cell.is-mint { background: #cce8c6; }
.deal-rollup-cell.is-sky { background: #aee5e5; }
.deal-rollup-cell.is-total { color: #ffffff; background: #e22027; }

.deal-report-breakdown {
  display: grid;
  grid-template-columns: minmax(420px, auto) 1fr;
  gap: 10px;
  margin-top: 10px;
}

.deal-stage-counts,
.deal-salesperson-counts {
  display: flex;
  min-height: 40px;
  align-items: stretch;
  flex-wrap: wrap;
  border-top: 1px solid #7a7079;
  border-left: 1px solid #7a7079;
}

.deal-breakdown-label,
.deal-empty-breakdown,
.deal-count-chip,
.deal-person-chip {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 11px;
  border-right: 1px solid #7a7079;
  border-bottom: 1px solid #7a7079;
  font-size: 9px;
}

.deal-breakdown-label {
  color: #613d5c;
  background: #edb7e7;
  font-weight: 800;
}

.deal-count-chip b,
.deal-person-chip b { font-size: 12px; }
.deal-count-chip.is-signed { color: #ffffff; background: #8e2330; }
.deal-count-chip.is-deposit { color: #3f3200; background: #f4ca42; }
.deal-count-chip.is-topped-up { color: #5a203f; background: #eca0c8; }
.deal-count-chip.is-controlled { color: #ffffff; background: #237ca9; }
.deal-count-chip.is-available { color: #24443e; background: #ffffff; }
.deal-person-chip.tone-0 { background: #efa7b5; }
.deal-person-chip.tone-1 { background: #8fe3e4; }
.deal-person-chip.tone-2 { background: #b9b1e6; }
.deal-person-chip.tone-3 { background: #83d6b1; }
.deal-person-chip.tone-4 { background: #f2e344; }
.deal-person-chip.tone-5 { background: #f3eeae; }
.deal-empty-breakdown { color: #777078; background: #f6f4f5; }

.deal-stage-badge {
  min-width: 68px;
  border-radius: 4px;
}

.deal-stage-badge.is-signed { color: #ffffff; background: #8e2330; border-color: #8e2330; }
.deal-stage-badge.is-deposit { color: #4b3b00; background: #f4ca42; border-color: #dfb72e; }
.deal-stage-badge.is-topped-up { color: #5d2140; background: #eca0c8; border-color: #d983b2; }
.deal-stage-badge.is-controlled { color: #ffffff; background: #237ca9; border-color: #237ca9; }
.deal-stage-badge.is-available { color: #24443e; background: #ffffff; border-color: #7d918b; }

#deal-dialog {
  width: min(1120px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: hidden;
}

#deal-dialog form {
  max-height: calc(100vh - 28px);
  overflow-y: auto;
}

.deal-form-section {
  padding: 16px;
  background: #f8f9f6;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.deal-form-section h3 {
  margin: 0 0 14px;
  color: #41504f;
  font-size: 12px;
}

.deal-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.deal-analysis-details {
  border: 1px solid var(--line);
  border-radius: 4px;
}

.deal-analysis-details summary {
  padding: 13px 15px;
  color: #3f5d59;
  background: #f4f7f4;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.deal-analysis-details .deal-form-grid {
  padding: 16px;
  border-top: 1px solid var(--line);
}

.inventory-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.inventory-toolbar h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.inventory-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.inventory-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
}

.inventory-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #566166;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(25, 35, 35, 0.18);
  border-radius: 2px;
}

.legend-swatch.is-landlord,
.inventory-unit.is-landlord { color: #ffffff; background: #7b847a; }
.legend-swatch.is-signed,
.inventory-cell.is-signed { color: #ffffff; background: #8e2330; }
.legend-swatch.is-deposit,
.inventory-cell.is-deposit { color: #3f3200; background: #f4ca42; }
.legend-swatch.is-topped-up,
.inventory-cell.is-topped-up { color: #5a203f; background: #eca0c8; }
.legend-swatch.is-controlled,
.inventory-cell.is-controlled { color: #ffffff; background: #237ca9; }
.legend-swatch.is-available,
.inventory-cell.is-available { color: #253238; background: #ffffff; }

.inventory-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.inventory-kpi {
  display: grid;
  min-height: 92px;
  grid-template-columns: 1fr auto;
  align-content: center;
  gap: 4px 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid #688b85;
  border-radius: 5px;
}

.inventory-kpi span,
.inventory-kpi small {
  color: var(--muted);
  font-size: 10px;
}

.inventory-kpi strong {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.inventory-panel {
  overflow: hidden;
}

.inventory-scroll {
  overflow: auto;
  scrollbar-gutter: stable;
}

.inventory-grid {
  width: 100%;
  min-width: 1080px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.inventory-grid th,
.inventory-grid td {
  height: 58px;
  padding: 0;
  text-align: center;
  border-right: 1px solid #aeb7b3;
  border-bottom: 1px solid #aeb7b3;
}

.inventory-grid thead th {
  position: sticky;
  z-index: 3;
  top: 0;
  height: 44px;
  color: #35413f;
  background: #eef1ed;
  font-size: 12px;
}

.inventory-grid thead th.inventory-building-a { background: #fff1cc; }
.inventory-grid thead th.inventory-building-b { background: #dfedd9; }

.inventory-grid tbody th,
.inventory-floor-heading {
  position: sticky;
  z-index: 2;
  left: 0;
  width: 64px;
  color: #3e4947;
  background: #e5e7e4 !important;
  font-size: 12px;
  font-weight: 700;
}

.inventory-grid thead .inventory-floor-heading { z-index: 4; }
.inventory-unit { background: #ffffff; }
.inventory-unit.is-unavailable { background: #141817; }

.inventory-unit.is-landlord span {
  display: inline-grid;
  height: 100%;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
}

.inventory-cell {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 72px;
  place-content: center;
  gap: 3px;
  padding: 4px;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: filter 120ms ease, box-shadow 120ms ease;
}

.inventory-cell strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.inventory-cell small {
  font-size: 9px;
  font-weight: 700;
}

.inventory-cell.is-available small { color: #7b8589; }
.inventory-cell:hover,
.inventory-cell:focus-visible {
  z-index: 1;
  filter: brightness(0.95);
  box-shadow: inset 0 0 0 3px #123b37;
  outline: none;
}

.inventory-summary-panel {
  margin-top: 16px;
  overflow: hidden;
}

.inventory-summary-table {
  min-width: 1080px;
  text-align: center;
}

.inventory-summary-table th,
.inventory-summary-table td {
  text-align: center;
  white-space: nowrap;
}

.inventory-summary-table tbody th {
  color: #4b5654;
  background: #f4f5f2;
}

.inventory-rate-row td {
  color: #183f3a;
  background: #e3f0ec;
  font-weight: 800;
}

.segmented-control {
  display: inline-flex;
  min-height: 38px;
  align-items: stretch;
  padding: 3px;
  background: #e9ece8;
  border: 1px solid #cfd6d2;
  border-radius: 5px;
}

.segmented-control > button,
.segmented-control > label > span {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  padding: 0 12px;
  color: #52605c;
  background: transparent;
  border: 0;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.segmented-control > button.is-active,
.segmented-control > label > input:checked + span {
  color: #ffffff;
  background: #214f4a;
  box-shadow: 0 1px 3px rgba(19, 50, 47, 0.18);
}

.segmented-control > label > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pricing-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.pricing-toolbar h2,
.pricing-history-section h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.pricing-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pricing-context-row {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  color: #596560;
}

.pricing-context-row > div:first-child {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.pricing-context-row > div:first-child span,
.pricing-context-row > small { font-size: 10px; }
.pricing-context-row > div:first-child strong { color: #1e3431; font-size: 12px; }
.pricing-context-row > small { margin-left: auto; text-align: right; }

.pricing-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 13px;
}

.pricing-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.price-swatch {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(30, 40, 39, 0.22);
  border-radius: 2px;
}

.price-swatch.is-unsold { background: #ffffff; }
.price-swatch.is-adjusted { background: #ffffff; box-shadow: inset 0 -3px #0000ff; }
.price-swatch.is-sold { background: #ff6699; }
.price-swatch.is-sold-after-increase { background: #0099ff; }
.price-swatch.is-landlord { background: #ffffff; box-shadow: inset 0 -3px #009900; }
.price-swatch.is-unavailable { background: #a6a6a6; }

.pricing-phase-summary-panel {
  margin-bottom: 12px;
  overflow: hidden;
}

.pricing-phase-summary-heading {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-bottom: 1px solid #d7ddda;
}

.pricing-phase-summary-heading h3 { margin: 2px 0 0; font-size: 15px; }
.pricing-phase-summary-heading > small {
  color: #71807c;
  font-size: 9px;
  text-align: right;
}

.pricing-phase-summary-scroll { overflow: auto; }

.pricing-phase-summary-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

.pricing-phase-summary-table th,
.pricing-phase-summary-table td {
  height: 42px;
  padding: 7px 10px;
  text-align: right;
  border-right: 1px solid #b9c1bd;
  border-bottom: 1px solid #b9c1bd;
  font-variant-numeric: tabular-nums;
}

.pricing-phase-summary-table thead th {
  height: 30px;
  color: #53615d;
  background: #eef1ee;
  font-size: 9px;
}

.pricing-phase-summary-table th:first-child { width: 76px; text-align: center; }
.pricing-phase-summary-table tbody th { font-size: 11px; }
.pricing-phase-summary-table tbody td strong { font-size: 15px; }
.pricing-phase-summary-table tbody td small {
  margin-left: 3px;
  color: #6f7c78;
  font-size: 9px;
}

.pricing-phase-shop-count {
  display: block;
  margin-top: 2px;
  color: #9a6419;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.pricing-phase-summary-table tr.is-sold { background: #fff0f5; }
.pricing-phase-summary-table tr.is-sold th { color: #9b3157; background: #ffe2ed; }
.pricing-phase-summary-table tr.is-unsold { background: #f2fbf8; }
.pricing-phase-summary-table tr.is-unsold th { color: #17695f; background: #dcf5ee; }

.pricing-summary-panel {
  margin-bottom: 12px;
  overflow: hidden;
}

.pricing-statistics-heading {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-bottom: 1px solid #d7ddda;
}

.pricing-statistics-heading h3 {
  margin: 2px 0 0;
  font-size: 15px;
}

.pricing-statistics-heading > small {
  color: #71807c;
  font-size: 9px;
  text-align: right;
}

.pricing-statistics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.pricing-statistics-grid.is-all {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pricing-statistics-group {
  min-width: 0;
  border-right: 1px solid #d7ddda;
  border-bottom: 1px solid #d7ddda;
}

.pricing-statistics-grid.is-all .pricing-statistics-group.is-zone-all {
  grid-column: 1 / -1;
}

.pricing-statistics-group > header {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
}

.pricing-statistics-group.is-zone-b > header { background: #ccffff; }
.pricing-statistics-group.is-zone-a > header { background: #ffffcc; }
.pricing-statistics-group.is-zone-all > header { background: #ffccff; }

.pricing-statistics-group > header strong,
.pricing-statistics-group > header small {
  display: block;
}

.pricing-statistics-group > header strong { color: #223b37; font-size: 13px; }
.pricing-statistics-group > header small { margin-top: 1px; color: #687572; font-size: 9px; }
.pricing-statistics-group > header > span { color: #bf1717; font-size: 10px; }
.pricing-statistics-group > header b { margin-left: 5px; font-size: 13px; }
.pricing-statistics-scroll { overflow: auto; }

.pricing-summary-table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  table-layout: fixed;
}

.pricing-summary-table th,
.pricing-summary-table td {
  padding: 8px 9px;
  text-align: right;
  border-right: 1px solid #b9c1bd;
  border-bottom: 1px solid #b9c1bd;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.pricing-summary-table thead th {
  color: #354541;
  background: #f2f3f1;
  font-size: 9px;
  font-weight: 800;
}

.pricing-summary-table th:first-child {
  width: 70px;
  text-align: center;
}

.pricing-summary-table tbody th {
  color: #263b37;
  background: #f7f8f6;
  font-size: 10px;
}

.pricing-summary-table tbody tr:first-child {
  color: #e11a1a;
}

.pricing-summary-table td small {
  margin-left: 2px;
  font-size: 8px;
}

.pricing-room-summary-panel {
  margin-bottom: 12px;
  overflow: hidden;
}

.pricing-room-summary-heading {
  padding: 12px 14px 9px;
  border-bottom: 1px solid var(--line);
}

.pricing-room-summary-heading h3 {
  margin: 2px 0 0;
  font-size: 14px;
}

.pricing-room-summary-scroll { overflow: auto; }
.pricing-room-summary-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
}

.pricing-room-summary-table th,
.pricing-room-summary-table td {
  padding: 9px 11px;
  border-right: 1px solid #d7ddda;
  border-bottom: 1px solid #d7ddda;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pricing-room-summary-table thead th {
  color: #64706d;
  background: #eef1ee;
  font-size: 9px;
  font-weight: 800;
}

.pricing-room-summary-table th:first-child,
.pricing-room-summary-table td:nth-child(2),
.pricing-room-summary-table td:nth-child(3) { text-align: left; }
.pricing-room-summary-table th:first-child { width: 88px; color: #254e67; font-size: 11px; }
.pricing-room-summary-table td:nth-child(2) { width: 74px; }
.pricing-room-summary-table td:nth-child(3) { width: 150px; }
.pricing-room-summary-table td strong { font-size: 13px; }
.pricing-room-summary-table td small { margin-left: 3px; color: #7a8582; font-size: 9px; }
.pricing-room-summary-table .pricing-room-buildings { color: #52625e; font-size: 10px; font-weight: 700; }
.pricing-room-summary-table .is-sold-count,
.pricing-room-summary-table .is-sold-price { background: #fff0f5; }
.pricing-room-summary-table .is-unsold-count,
.pricing-room-summary-table .is-unsold-price { background: #f7fbf9; }
.pricing-room-summary-table .is-sold-price strong { color: #a83262; }
.pricing-room-summary-table .is-unsold-price strong { color: #17695f; }
.pricing-room-summary-table tr[data-zone="B"] th:first-child { color: #5c5422; }

.pricing-panel { overflow: hidden; }

.pricing-stage-heading {
  padding: 14px 18px 12px;
  border-bottom: 1px solid #c9d0cd;
}

.pricing-stage-heading h2 { margin: 2px 0 0; font-size: 18px; }
.pricing-stage-heading > small {
  display: block;
  margin-top: 3px;
  color: #6b7773;
  font-size: 9px;
}

.pricing-zone-tables {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 12px;
}

.pricing-print-pages { display: none; }

.pricing-zone-block {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #8d9692;
}

.pricing-zone-heading {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-bottom: 1px solid #8d9692;
}

.pricing-zone-block.is-zone-a .pricing-zone-heading { background: #ffffcc; }
.pricing-zone-block.is-zone-b .pricing-zone-heading { background: #ccffff; }
.pricing-zone-title {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 6px;
}
.pricing-zone-title small { flex-basis: 100%; }
.pricing-zone-heading span { color: #687572; font-size: 9px; font-weight: 800; }
.pricing-zone-heading strong { color: #243a36; font-size: 13px; }
.pricing-zone-heading small { color: #687572; font-size: 9px; }

.pricing-shop-card {
  display: grid;
  width: min(300px, 72%);
  min-height: 58px;
  grid-template-rows: auto auto auto;
  padding: 5px 7px;
  color: #20312d;
  background: #ffffff;
  border: 1px solid #66736f;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: box-shadow 120ms ease, filter 120ms ease;
}

.pricing-shop-card.is-sold { color: #4f1428; background: #ff6699; }
.pricing-shop-card:hover,
.pricing-shop-card:focus-visible {
  filter: brightness(0.97);
  box-shadow: inset 0 0 0 2px #164f47;
  outline: none;
}

.pricing-shop-title,
.pricing-shop-values {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.pricing-shop-title { grid-template-columns: auto minmax(0, 1fr) auto; }
.pricing-shop-title b { color: #164f47; font-size: 10px; }
.pricing-shop-title strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pricing-shop-title em {
  padding: 1px 4px;
  color: #52615d;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(82, 97, 93, 0.3);
  border-radius: 3px;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.pricing-shop-values {
  grid-template-columns: 0.8fr 1.25fr 0.9fr;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.pricing-shop-values > * {
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pricing-shop-values > * + * { border-left: 1px solid rgba(45, 53, 50, 0.32); }
.pricing-shop-values strong { color: #a52b25; font-size: 10px; }
.pricing-shop-card.is-sold .pricing-shop-values strong { color: #ffffff; }
.pricing-shop-card > small {
  margin-top: 2px;
  color: #64716d;
  font-size: 8px;
  text-align: right;
}
.pricing-shop-card.is-sold > small { color: #632039; }
.pricing-zone-scroll { overflow: auto; scrollbar-gutter: stable; }

.pricing-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.pricing-zone-block.is-zone-a .pricing-grid { min-width: 560px; }
.pricing-zone-block.is-zone-b .pricing-grid { min-width: 760px; }

.pricing-grid th,
.pricing-grid td {
  height: 62px;
  padding: 0;
  text-align: center;
  border-right: 1px solid #747d79;
  border-bottom: 1px solid #747d79;
}

.pricing-grid thead th {
  position: sticky;
  z-index: 3;
  top: 0;
  height: 30px;
  color: #222d2a;
  background: #f5f5f3;
  font-size: 11px;
}

.pricing-grid thead tr:nth-child(2) th { top: 30px; }
.pricing-grid thead th.pricing-building-a1,
.pricing-grid thead th.pricing-building-a2,
.pricing-grid thead th.pricing-building-b1,
.pricing-grid thead th.pricing-building-b6,
.pricing-grid thead th.pricing-building-b7 { background: #ccffff; }
.pricing-grid thead th.pricing-building-b2,
.pricing-grid thead th.pricing-building-b3,
.pricing-grid thead th.pricing-building-b5 { background: #ccffcc; }
.pricing-grid thead th.pricing-building-a3,
.pricing-grid thead th.pricing-building-a5,
.pricing-grid thead th.pricing-building-a6,
.pricing-grid thead th.pricing-building-b8 { background: #ffffcc; }

.pricing-grid tbody > tr > th,
.pricing-floor-heading,
.pricing-grid tfoot th {
  position: sticky;
  z-index: 2;
  left: 0;
  width: 54px;
  color: #343f3c;
  background: #f0f1ef !important;
  font-size: 10px;
  font-weight: 800;
}

.pricing-grid thead .pricing-floor-heading { z-index: 4; }
.pricing-unit { background: #ffffff; }
.pricing-unit.is-unavailable,
.pricing-unit.is-landlord { background: #a6a6a6; }

.pricing-cell {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 74px;
  grid-template-rows: 1fr 1fr;
  padding: 0;
  color: #202b28;
  background: #ffffff;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: box-shadow 120ms ease, filter 120ms ease;
}

.pricing-cell.is-unsold { background: #ffffff; }
.pricing-cell.is-price-increase { background: #e8f6ff; }
.pricing-cell.is-price-decrease { background: #fff0f0; }
.pricing-cell.has-phase-comparison { grid-template-rows: 21px 15px 26px; }
.pricing-cell.is-sold { color: #4f1428; background: #ff6699; }
.pricing-cell.is-sold.is-price-increase,
.pricing-cell.is-sold.is-price-decrease { background: #ff6699; }

.pricing-cell-values {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid rgba(45, 53, 50, 0.36);
  font-size: 9px;
  white-space: nowrap;
}

.pricing-cell-values > * {
  display: grid;
  min-width: 0;
  height: 100%;
  place-items: center;
  padding: 2px;
  overflow: hidden;
}

.pricing-cell-values > * + * { border-left: 1px solid rgba(45, 53, 50, 0.36); }
.pricing-area-value { color: #202b28; }
.pricing-area-value.is-landlord { color: #009900; font-weight: 900; }
.pricing-unit-price {
  color: #ff0000;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.pricing-unit-price.is-adjusted { color: #0000ff; }
.pricing-cell.is-price-increase .pricing-unit-price { color: #005da3; }
.pricing-cell.is-price-decrease .pricing-unit-price { color: #b42318; }
.pricing-cell.is-sold .pricing-unit-price:not(.is-adjusted) { color: #800000; }
.pricing-cell.is-sold .pricing-unit-price.is-adjusted { color: #000066; }

.pricing-cell.has-phase-comparison .pricing-cell-values {
  grid-template-columns: 36% 64%;
}

.pricing-unit-price.is-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding-inline: 1px;
  font-size: 6.5px;
}

.pricing-unit-price.is-pending i {
  color: #68736f;
  font-size: 6px;
  font-style: normal;
}

.pricing-cell > strong {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pricing-cell.is-sold > strong { color: #ffffff; }
.pricing-cell > strong small { font-size: 8px; font-weight: 700; }
.pricing-cell.is-price-increase > strong { color: #005da3; }
.pricing-cell.is-price-decrease > strong { color: #b42318; }

.pricing-before-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #68736f;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.pricing-before-price em {
  font-size: 6px;
  font-style: normal;
  font-weight: 800;
}

.pricing-before-price span {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.pricing-before-price b { font-size: 6px; }
.pricing-before-price i {
  color: #59645f;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.pricing-after-price {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0 !important;
  padding: 0 0 2px;
  font-weight: 900;
}

.pricing-after-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 0;
}

.pricing-after-main em {
  font-size: 6px;
  font-style: normal;
  font-weight: 800;
}

.pricing-price-delta {
  font-size: 7px !important;
  font-weight: 900 !important;
  line-height: 1;
}

.pricing-unchanged-label {
  margin-left: 2px;
  color: #75807c;
  font-size: 6px;
  font-style: normal;
  font-weight: 800;
}
.pricing-cell:hover,
.pricing-cell:focus-visible {
  z-index: 1;
  filter: brightness(0.97);
  box-shadow: inset 0 0 0 3px #164f47;
  outline: none;
}

.pricing-grid tfoot th,
.pricing-grid tfoot td {
  height: 28px;
  padding: 3px 5px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.pricing-grid tfoot tr.is-sellable th,
.pricing-grid tfoot tr.is-sellable td { background: #ffffcc; }
.pricing-grid tfoot tr.is-sold-count th,
.pricing-grid tfoot tr.is-sold-count td { background: #ffccff; }
.pricing-grid tfoot tr.is-unsold-count th,
.pricing-grid tfoot tr.is-unsold-count td { background: #ccccff; }
.pricing-grid tfoot tr.is-sale-rate td.is-highlight {
  color: #ffffff;
  background: #ff0000;
  font-weight: 900;
}
.pricing-grid tfoot tr.is-increase-note td {
  color: #ff2525;
  background: #ffffff;
}
.pricing-grid tfoot tr.is-increase-note th { background: #ffffff !important; }

.pricing-grid tfoot tr.pricing-confirm-row th,
.pricing-grid tfoot tr.pricing-confirm-row td {
  height: 46px;
  padding: 3px;
  background: #eef1ef;
}

.pricing-confirm-building-button {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  place-items: center;
  gap: 1px;
  padding: 4px 2px;
  color: #6d7773;
  background: #e2e6e4;
  border: 1px solid #cbd2cf;
  border-radius: 4px;
  font-size: 8px;
}

.pricing-confirm-building-button.has-pending {
  color: #ffffff;
  background: #167f73;
  border-color: #167f73;
  cursor: pointer;
}

.pricing-confirm-building-button.has-pending:hover,
.pricing-confirm-building-button.has-pending:focus-visible {
  background: #0e675e;
  outline: 2px solid #b7e1dc;
  outline-offset: 1px;
}

.pricing-confirm-building-button:disabled { opacity: 1; cursor: default; }
.pricing-confirm-building-button span { font-size: 8px; font-weight: 900; white-space: nowrap; }
.pricing-confirm-building-button small { font-size: 6px; font-weight: 700; white-space: nowrap; }

@media (min-width: 1280px) {
  .pricing-zone-tables.is-all {
    grid-template-columns: minmax(480px, 5fr) minmax(660px, 7fr);
    align-items: start;
  }

  .pricing-zone-tables.is-all .pricing-zone-block.is-zone-a {
    margin-top: 372px;
  }
}

.pricing-history-section { margin-top: 18px; }
.pricing-history-list { border-top: 1px solid var(--line); }
.pricing-history-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(200px, 1.5fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}

.pricing-history-unit { color: #31514c; font-size: 11px; font-weight: 800; }
.pricing-history-item strong { color: #303c39; font-size: 11px; }
.pricing-history-item.is-increase strong { color: #1769aa; }
.pricing-history-item.is-decrease strong { color: #c43b3b; }
.pricing-history-item small { color: #7a8581; font-size: 9px; text-align: right; }
.pricing-history-item.is-pending { background: #f1faf8; }
.pricing-history-status { color: #167f73; font-weight: 900; }
.pricing-history-empty { margin: 0; padding: 16px 4px; color: var(--muted); font-size: 11px; }

.price-adjust-dialog { width: min(780px, calc(100vw - 28px)); }
.price-adjust-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.price-floor-mode-field { grid-column: span 2; margin: 0; padding: 0; border: 0; }
.price-floor-mode-field legend,
.field-label { margin-bottom: 7px; color: #485652; font-size: 10px; font-weight: 700; }
.price-floor-mode-field .segmented-control { display: flex; width: 100%; }
.price-floor-mode-field .segmented-control label { flex: 1; }
.price-floor-mode-field .segmented-control span { width: 100%; }

.price-range-fields {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 10px;
  padding: 10px 12px;
  background: #f4f6f3;
  border: 1px solid #d8dfdb;
  border-radius: 4px;
}

.price-range-divider { padding-bottom: 10px; color: #74807c; font-size: 10px; font-weight: 800; }
.price-specific-fields { grid-column: 1 / -1; }
.price-specific-floor-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
.price-floor-check { position: relative; }
.price-floor-check input { position: absolute; opacity: 0; }
.price-floor-check span {
  display: grid;
  min-height: 34px;
  place-items: center;
  padding: 4px;
  color: #38504c;
  background: #ffffff;
  border: 1px solid #cbd4d0;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.price-floor-check input:checked + span { color: #ffffff; background: #235951; border-color: #235951; }
.price-floor-check.is-occupied span { color: #8a777d; background: #eee8ea; cursor: not-allowed; }
.input-with-unit { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.input-with-unit input { grid-column: 1 / -1; grid-row: 1; padding-right: 64px; }
.input-with-unit span { z-index: 1; grid-column: 2; grid-row: 1; padding-right: 11px; color: #65716e; font-size: 9px; pointer-events: none; }

.price-adjust-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  background: #d9dfdc;
  border: 1px solid #d9dfdc;
  border-radius: 4px;
}

.price-adjust-preview > div { padding: 10px 12px; background: #f6f7f4; }
.price-adjust-preview span,
.price-adjust-preview strong { display: block; }
.price-adjust-preview span { color: #74807c; font-size: 9px; }
.price-adjust-preview strong { margin-top: 3px; color: #243b37; font-size: 11px; }
.price-adjust-preview .price-preview-example { grid-column: 1 / -1; background: #edf4f1; }
.price-adjust-preview > small { grid-column: 1 / -1; padding: 8px 11px; color: #606d69; background: #ffffff; font-size: 9px; }

@media (max-width: 1100px) {
  .deal-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .deal-report-heading { grid-template-columns: 1fr auto; }
  .deal-report-title-wrap { grid-column: 1; grid-row: 1; justify-content: flex-start; }
  .deal-report-range { grid-column: 2; grid-row: 1; }
  .deal-classification-legend { grid-column: 1 / -1; grid-row: 2; }
  .deal-rollup-grid { grid-template-columns: repeat(4, minmax(105px, 1fr)); }
  .deal-report-breakdown { grid-template-columns: 1fr; }
  .inventory-toolbar { align-items: flex-start; flex-direction: column; }
  .inventory-toolbar-actions { width: 100%; justify-content: flex-start; }
  .inventory-legend { justify-content: flex-start; }
  .pricing-toolbar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 720px) {
  .deal-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deal-report-heading {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 5px;
    padding: 11px 13px;
  }
  .deal-report-title-wrap,
  .deal-report-range { grid-column: 1; justify-self: start; }
  .deal-report-title-wrap { grid-row: 1; }
  .deal-report-range { grid-row: 2; }
  .deal-classification-legend { grid-column: 1; grid-row: 3; }
  .deal-report-title-wrap h2 { font-size: 14px; }
  .deal-rollup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deal-report-summary { padding: 8px; }
  .inventory-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-grid th,
  .inventory-grid td { height: 54px; }
  .pricing-toolbar-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .pricing-stage-control { width: 100%; }
  .pricing-stage-control button { flex: 1; }
  .pricing-zone-control { width: 100%; }
  .pricing-zone-control button { flex: 1; }
  .pricing-context-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .pricing-context-row > small { margin-left: 0; text-align: left; }
  .pricing-phase-summary-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .pricing-phase-summary-heading > small { text-align: left; }
  .pricing-statistics-grid.is-all { grid-template-columns: 1fr; }
  .pricing-statistics-grid.is-all .pricing-statistics-group.is-zone-all { grid-column: 1; }
  .pricing-statistics-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .pricing-statistics-heading > small { text-align: left; }
  .pricing-zone-tables { padding: 8px; }
  .pricing-zone-heading { align-items: stretch; flex-direction: column; }
  .pricing-shop-card { width: 100%; }
  .pricing-zone-block.is-zone-a .pricing-grid { min-width: 520px; }
  .pricing-zone-block.is-zone-b .pricing-grid { min-width: 720px; }
  .pricing-grid th,
  .pricing-grid td { height: 74px; }
  .price-adjust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-specific-floor-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .price-adjust-preview { grid-template-columns: 1fr; }
  .price-adjust-preview .price-preview-example,
  .price-adjust-preview > small { grid-column: 1; }
  .pricing-history-item { grid-template-columns: 1fr; gap: 3px; }
  .pricing-history-item small { text-align: left; }
}

@media (max-width: 440px) {
  .deal-form-grid { grid-template-columns: 1fr; }
  .inventory-kpi { padding: 12px; }
  .inventory-kpi strong { font-size: 24px; }
  .price-adjust-grid { grid-template-columns: 1fr; }
  .price-floor-mode-field { grid-column: 1; }
  .price-specific-floor-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.auth-help {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.account-status-panel {
  text-align: center;
}

.account-status-mark {
  display: inline-grid;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  place-items: center;
  color: #ffffff;
  background: #d39a3c;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
}

.account-status-panel h2 {
  margin: 0;
  font-size: 22px;
}

.account-status-panel > p:not(.section-kicker) {
  margin: 12px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.account-status-panel > strong {
  display: block;
  overflow-wrap: anywhere;
  margin: 14px 0;
  color: #31514c;
  font-size: 12px;
}

.user-role-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  color: #2f5b55;
  background: #dcece7;
  border: 1px solid #c4ddd6;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.user-role-badge[data-role="admin"] {
  color: #6a4510;
  background: #f8e9c7;
  border-color: #ead09c;
}

.user-role-badge[data-role="viewer"] {
  color: #4d5f69;
  background: #e8edf0;
  border-color: #d4dde2;
}

.is-read-only .sidebar-foot .storage-dot {
  background: #7b909c;
  box-shadow: 0 0 0 4px rgba(123, 144, 156, 0.12);
}

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-kpi {
  min-height: 116px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 4px solid #3f746c;
  border-radius: 5px;
}

.admin-kpi.is-pending { border-top-color: #d39a3c; }
.admin-kpi.is-editor { border-top-color: #477da5; }

.admin-kpi span,
.admin-kpi small {
  display: block;
}

.admin-kpi span {
  color: #50605c;
  font-size: 11px;
  font-weight: 800;
}

.admin-kpi strong {
  display: block;
  margin: 8px 0 4px;
  color: #203c38;
  font-size: 30px;
  line-height: 1;
}

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

.admin-panel + .admin-panel {
  margin-top: 16px;
}

.admin-panel-note {
  color: var(--muted);
  font-size: 10px;
}

.admin-user-table th:nth-child(1) { min-width: 260px; }
.admin-user-table th:nth-child(2) { min-width: 100px; }
.admin-user-table th:nth-child(3) { min-width: 150px; }
.admin-user-table th:nth-child(4) { min-width: 170px; }
.admin-user-table th:nth-child(5) { width: 90px; }
.admin-user-table tr.is-pending td { background: #fff9ec; }

.admin-user-identity {
  display: grid;
  gap: 3px;
}

.admin-user-identity strong {
  color: #263b37;
  font-size: 11px;
}

.admin-user-identity small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 9px;
}

.admin-access-select {
  width: 100%;
  min-height: 36px;
  padding: 7px 28px 7px 9px;
  color: #2f4541;
  background: #ffffff;
  border: 1px solid #cbd5d1;
  border-radius: 3px;
  font-size: 10px;
}

.admin-access-save {
  min-width: 68px;
  min-height: 34px;
}

.integration-heading {
  align-items: end;
}

.integration-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.integration-source {
  min-width: 0;
  padding: 18px 18px 18px 0;
}

.integration-source + .integration-source {
  padding-right: 0;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

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

.integration-source-heading h3,
.integration-recent-heading h3 {
  margin: 2px 0 3px;
  color: #253c38;
  font-size: 14px;
}

.integration-source-heading small,
.integration-recent-heading span {
  color: var(--muted);
  font-size: 9px;
}

.integration-source-label {
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
}

.integration-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  color: #596965;
  background: #edf1ef;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.integration-status.is-connected {
  color: #236055;
  background: #dcece7;
}

.integration-status.is-warning {
  color: #78551c;
  background: #f7e9c8;
}

.integration-status.is-error {
  color: #82433e;
  background: #f3dcda;
}

.toggle-field {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #314944;
  font-size: 10px;
  font-weight: 800;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

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

.integration-fields .field {
  margin: 0;
}

.integration-wide-field {
  grid-column: 1 / -1;
}

.integration-account,
.integration-last-run {
  min-height: 18px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.integration-account {
  color: #365a53;
  font-weight: 700;
}

.integration-account.is-error {
  color: #8d4b47;
}

.integration-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.integration-actions .button {
  min-height: 36px;
}

.integration-disconnect {
  margin-left: auto;
  color: #8d4b47;
}

.integration-recent {
  margin-top: 18px;
}

.integration-recent-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

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

.integration-recent-row {
  display: grid;
  grid-template-columns: 90px 90px minmax(180px, 1fr) 150px;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}

.integration-recent-row strong {
  color: #314944;
}

.integration-result-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  color: #355f56;
  background: #dcece7;
  border-radius: 3px;
  font-weight: 800;
}

.integration-result-badge.is-rejected {
  color: #82433e;
  background: #f3dcda;
}

.integration-result-badge.is-linked {
  color: #77541a;
  background: #f7e9c8;
}

.integration-recent-detail {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-recent-row time {
  color: var(--muted);
  text-align: right;
}

.access-badge,
.audit-action-badge,
.audit-entity {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.access-badge.is-admin {
  color: #714b15;
  background: #f8e8c5;
}

.access-badge.is-pending {
  color: #76551a;
  background: #fff0c7;
}

.access-badge.is-editor {
  color: #245d85;
  background: #dcecf7;
}

.access-badge.is-viewer {
  color: #355f56;
  background: #dcece7;
}

.access-badge.is-disabled {
  color: #77504d;
  background: #f1dfdd;
}

.audit-heading {
  align-items: end;
}

.audit-filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  background: #f4f6f3;
  border: 1px solid #dce2de;
  border-radius: 4px;
}

.audit-filter-row .field {
  margin: 0;
}

.audit-refresh-button {
  min-height: 38px;
  white-space: nowrap;
}

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

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

.audit-item-main {
  display: grid;
  grid-template-columns: 76px minmax(240px, 1fr) 120px 160px;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 4px;
}

.audit-action-badge {
  color: #2d5f55;
  background: #dcece7;
}

.audit-action-badge.is-delete,
.audit-action-badge.is-clear {
  color: #82433e;
  background: #f3dcda;
}

.audit-action-badge.is-permission,
.audit-action-badge.is-signup {
  color: #77541a;
  background: #f7e9c8;
}

.audit-action-badge.is-restore {
  color: #315f82;
  background: #dceaf4;
}

.audit-action-badge.is-auto_import {
  color: #245d85;
  background: #dcecf7;
}

.audit-summary {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.audit-summary strong {
  overflow: hidden;
  color: #2a3e3a;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.audit-summary span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
}

.audit-entity {
  color: #50635e;
  background: #edf1ef;
}

.audit-item-main time {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.audit-details {
  margin: 0 4px 10px 92px;
}

.audit-details summary {
  width: fit-content;
  padding: 5px 0;
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.audit-detail-content {
  margin-top: 6px;
  overflow: hidden;
  background: #f7f8f6;
  border: 1px solid #dde3df;
  border-radius: 4px;
}

.audit-change-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(140px, 1fr) 18px minmax(140px, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 10px;
  border-bottom: 1px solid #e1e6e3;
  font-size: 9px;
}

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

.audit-change-row strong {
  color: #3d514d;
}

.audit-change-row span {
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.audit-change-row i {
  color: #82908c;
  font-style: normal;
  text-align: center;
}

.audit-before {
  color: #765b58;
}

.audit-after {
  color: #245f57;
  font-weight: 700;
}

.audit-extra-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding: 9px 10px;
  font-size: 9px;
}

.audit-extra-row span {
  overflow-wrap: anywhere;
}

.audit-no-change,
.audit-empty {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.audit-empty.is-error {
  color: #8d4b47;
}

@media (max-width: 900px) {
  .integration-source-grid {
    grid-template-columns: 1fr;
  }

  .integration-source,
  .integration-source + .integration-source {
    padding: 16px 0;
    border-left: 0;
  }

  .integration-source + .integration-source {
    border-top: 1px solid var(--line);
  }

  .integration-recent-row {
    grid-template-columns: 80px 80px minmax(150px, 1fr);
  }

  .integration-recent-row time {
    grid-column: 3;
    text-align: left;
  }

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

  .audit-refresh-button {
    width: 100%;
  }

  .audit-item-main {
    grid-template-columns: 70px minmax(180px, 1fr) 100px;
  }

  .audit-item-main time {
    grid-column: 2 / -1;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .integration-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .integration-wide-field {
    grid-column: auto;
  }

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

  .integration-actions .button,
  .integration-actions .text-button {
    width: 100%;
  }

  .integration-disconnect {
    margin-left: 0;
  }

  .integration-recent-row {
    grid-template-columns: 72px 74px minmax(0, 1fr);
  }

  .admin-kpis {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-kpi {
    display: grid;
    min-height: 78px;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 14px;
  }

  .admin-kpi strong {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin: 0;
    font-size: 28px;
  }

  .admin-kpi small {
    margin-top: 4px;
  }

  .admin-panel-note {
    display: none;
  }

  .admin-table-scroll {
    overflow: visible;
  }

  .admin-user-table {
    display: block;
    min-width: 0;
  }

  .admin-user-table thead {
    display: none;
  }

  .admin-user-table tbody {
    display: grid;
    gap: 8px;
  }

  .admin-user-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 10px;
    padding: 11px;
    background: #ffffff;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .admin-user-table tr:last-child {
    border-bottom: 0;
  }

  .admin-user-table tr.is-pending {
    background: #fff9ec;
    border-bottom-color: #ead6a9;
  }

  .admin-user-table td {
    display: block;
    min-width: 0;
    padding: 2px 0;
    background: transparent !important;
    border: 0;
  }

  .admin-user-table td:nth-child(1) {
    grid-column: 1;
  }

  .admin-user-table td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

  .admin-user-table td:nth-child(3) {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 9px;
  }

  .admin-user-table td:nth-child(3)::before {
    content: "註冊：";
  }

  .admin-user-table td:nth-child(4) {
    grid-column: 1;
  }

  .admin-user-table td:nth-child(5) {
    grid-column: 2;
  }

  .admin-access-select,
  .admin-access-save {
    min-height: 38px;
  }

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

  .audit-item-main {
    grid-template-columns: 68px 1fr;
    gap: 8px;
    padding: 12px 2px;
  }

  .audit-entity {
    grid-column: 1;
  }

  .audit-item-main time {
    grid-column: 2;
  }

  .audit-details {
    margin-left: 76px;
  }

  .audit-change-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px;
  }

  .audit-change-row i {
    text-align: left;
  }

  .audit-before::before {
    content: "修改前：";
    color: var(--muted);
    font-weight: 400;
  }

  .audit-after::before {
    content: "修改後：";
    color: var(--muted);
    font-weight: 400;
  }
}

@media (max-width: 440px) {
  .user-role-badge {
    padding: 0 5px;
    font-size: 8px;
  }

  .audit-details {
    margin-left: 0;
  }

  .audit-summary strong,
  .audit-summary span {
    white-space: normal;
  }
}

.parking-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.parking-toolbar h2,
.parking-roster-panel h3,
.parking-plan-heading h3,
.parking-detail-panel h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.parking-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.parking-context-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
  color: #596663;
  background: #f8f8f5;
  border: 1px solid var(--line);
  border-left: 4px solid #317c73;
  border-radius: 5px;
}

.parking-context-row > small {
  max-width: 440px;
  font-size: 9px;
  line-height: 1.6;
  text-align: right;
}

.parking-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 10px;
  font-weight: 800;
}

.parking-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.parking-swatch {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(18, 33, 35, 0.28);
  border-radius: 2px;
}

.parking-swatch.is-sold,
.parking-pin.is-sold,
.parking-card.is-sold,
.parking-detail-status.is-sold {
  color: #5f1538;
  background: #ee9bc4;
  border-color: #cf6599;
}

.parking-swatch.is-deposit,
.parking-pin.is-deposit,
.parking-card.is-deposit,
.parking-detail-status.is-deposit {
  color: #3d3200;
  background: #f4d638;
  border-color: #c4a91e;
}

.parking-swatch.is-landlord-blue,
.parking-pin.is-landlord-blue,
.parking-card.is-landlord-blue,
.parking-detail-status.is-landlord-blue {
  color: #ffffff;
  background: #367fad;
  border-color: #255e83;
}

.parking-swatch.is-landlord-gray,
.parking-pin.is-landlord-gray,
.parking-card.is-landlord-gray,
.parking-detail-status.is-landlord-gray {
  color: #ffffff;
  background: #7b8383;
  border-color: #5e6666;
}

.parking-swatch.is-available,
.parking-pin.is-available,
.parking-pin.is-accessible,
.parking-card.is-available,
.parking-card.is-accessible,
.parking-detail-status.is-available,
.parking-detail-status.is-accessible {
  color: #273333;
  background: #ffffff;
  border-color: #8e9996;
}

.parking-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.parking-kpi {
  display: grid;
  min-height: 82px;
  grid-template-columns: 1fr auto;
  align-content: center;
  gap: 3px 10px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 3px solid #5f8781;
  border-radius: 5px;
}

.parking-kpi span,
.parking-kpi small {
  color: var(--muted);
  font-size: 9px;
}

.parking-kpi strong {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
}

.parking-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.parking-plan-panel {
  min-width: 0;
  overflow: hidden;
}

.parking-plan-heading {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.parking-plan-heading h3,
.parking-detail-panel h3,
.parking-roster-panel h3 {
  font-size: 15px;
}

.parking-zoom-controls {
  display: flex;
  gap: 5px;
}

.parking-zoom-controls .icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  font-size: 18px;
}

.parking-zoom-controls .parking-zoom-reset {
  width: 50px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.parking-plan-scroll {
  overflow: auto;
  max-height: min(72vh, 820px);
  padding: 12px;
  background: #eceeeb;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  touch-action: pan-x pan-y;
}

.parking-plan-stage {
  position: relative;
  max-width: none;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(24, 38, 37, 0.12);
  transition: width 160ms ease;
}

.parking-plan-stage.is-zone-a.zoom-75 { width: 570px; }
.parking-plan-stage.is-zone-a.zoom-100 { width: 760px; }
.parking-plan-stage.is-zone-a.zoom-125 { width: 950px; }
.parking-plan-stage.is-zone-a.zoom-150 { width: 1140px; }
.parking-plan-stage.is-zone-a.zoom-175 { width: 1330px; }
.parking-plan-stage.is-zone-a.zoom-200 { width: 1520px; }
.parking-plan-stage.is-zone-b.zoom-75 { width: 840px; }
.parking-plan-stage.is-zone-b.zoom-100 { width: 1120px; }
.parking-plan-stage.is-zone-b.zoom-125 { width: 1400px; }
.parking-plan-stage.is-zone-b.zoom-150 { width: 1680px; }
.parking-plan-stage.is-zone-b.zoom-175 { width: 1960px; }
.parking-plan-stage.is-zone-b.zoom-200 { width: 2240px; }

.parking-plan-stage img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.52;
  filter: grayscale(1) contrast(0.88) brightness(1.08);
  pointer-events: none;
  user-select: none;
}

.parking-plan-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.parking-plan-pins svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.parking-pin {
  cursor: pointer;
  pointer-events: auto;
}

.parking-pin circle {
  stroke-width: 3;
  filter: drop-shadow(0 2px 2px rgba(17, 31, 31, 0.22));
  transition: transform 120ms ease, stroke-width 120ms ease;
}

.parking-pin text {
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.parking-pin.is-sold circle { fill: #ee9bc4; stroke: #cf6599; }
.parking-pin.is-sold text { fill: #5f1538; }
.parking-pin.is-sold.is-consigned-signed circle {
  stroke: #1f6fb8;
  stroke-width: 6;
}
.parking-pin.is-deposit circle { fill: #f4d638; stroke: #c4a91e; }
.parking-pin.is-deposit text { fill: #3d3200; }
.parking-pin.is-landlord-blue circle { fill: #367fad; stroke: #255e83; }
.parking-pin.is-landlord-blue text { fill: #ffffff; }
.parking-pin.is-landlord-gray circle { fill: #7b8383; stroke: #5e6666; }
.parking-pin.is-landlord-gray text { fill: #ffffff; }
.parking-pin.is-available circle,
.parking-pin.is-accessible circle { fill: #ffffff; stroke: #8e9996; }
.parking-pin.is-available text,
.parking-pin.is-accessible text { fill: #273333; }

.parking-pin:hover circle,
.parking-pin:focus circle {
  transform: scale(1.12);
  transform-box: fill-box;
  transform-origin: center;
}

.parking-pin.is-selected circle {
  stroke: #173d39;
  stroke-width: 6;
}

.parking-card.is-selected {
  outline: 3px solid #173d39;
  outline-offset: 2px;
}

.parking-card.is-sold.is-consigned-signed,
.parking-detail-status.is-sold.is-consigned-signed {
  border-color: #1f6fb8;
  box-shadow: inset 0 0 0 2px #1f6fb8;
}

.parking-detail-panel {
  position: sticky;
  top: 84px;
  overflow: hidden;
  padding: 14px;
}

.parking-detail-heading {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.parking-detail-status {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 900;
}

.parking-detail-list {
  display: grid;
  gap: 0;
  margin: 8px 0 14px;
}

.parking-detail-list > div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid #e5e8e5;
}

.parking-detail-list dt {
  color: var(--muted);
  font-size: 9px;
}

.parking-detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 10px;
  font-weight: 800;
  text-align: right;
}

.parking-detail-panel .button {
  width: 100%;
}

.parking-roster-panel {
  padding: 12px;
}

.parking-roster-panel .panel-heading {
  margin-bottom: 10px;
}

.parking-roster-panel .panel-heading > span {
  color: var(--muted);
  font-size: 9px;
}

.parking-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 7px;
}

.parking-card {
  display: grid;
  min-height: 92px;
  align-content: space-between;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid;
  border-radius: 5px;
  text-align: left;
}

.parking-card > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.parking-card strong {
  font-size: 12px;
}

.parking-card em {
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.parking-card > small {
  color: currentColor;
  font-size: 8px;
  opacity: 0.8;
}

.parking-card > b {
  justify-self: end;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.parking-card > b small {
  margin-left: 2px;
  font-size: 8px;
}

@media (max-width: 1100px) {
  .parking-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .parking-toolbar-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .parking-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .parking-toolbar-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .parking-zone-control,
  .parking-level-control {
    display: flex;
    width: 100%;
  }

  .parking-zone-control button,
  .parking-level-control button {
    flex: 1;
  }

  .parking-context-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .parking-context-row > small {
    max-width: none;
    text-align: left;
  }

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

  .parking-workspace {
    grid-template-columns: 1fr;
  }

  .parking-detail-panel {
    position: static;
  }

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

  .parking-detail-list > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .parking-detail-list dd {
    text-align: left;
  }

  .parking-plan-scroll {
    max-height: 64vh;
    padding: 8px;
  }
}

@media (max-width: 440px) {
  .main-nav {
    grid-template-columns: repeat(9, 42px);
    justify-content: start;
  }

  .parking-kpi {
    min-height: 74px;
    padding: 10px;
  }

  .parking-kpi strong {
    font-size: 22px;
  }

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

@media print {
  @page {
    size: A3 landscape;
    margin: 8mm;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    animation: none !important;
    transition: none !important;
  }

  html,
  body {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    background: #ffffff !important;
  }

  body.is-pdf-exporting {
    color: #17211f;
    font-size: 8pt;
  }

  body.is-pdf-exporting .boot-screen,
  body.is-pdf-exporting .auth-screen,
  body.is-pdf-exporting .sidebar,
  body.is-pdf-exporting .topbar,
  body.is-pdf-exporting .toast-region,
  body.is-pdf-exporting dialog {
    display: none !important;
  }

  body.is-pdf-exporting .app-shell {
    display: block !important;
    min-height: 0 !important;
  }

  body.is-pdf-exporting .main-content {
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  body.is-pdf-exporting .view {
    display: none !important;
    padding: 0 !important;
    overflow: visible !important;
    transform: none !important;
  }

  body.is-pdf-exporting[data-print-target="deals"] #view-deals,
  body.is-pdf-exporting[data-print-target="inventory"] #view-inventory,
  body.is-pdf-exporting[data-print-target="parking"] #view-parking,
  body.is-pdf-exporting[data-print-target="pricing"] #view-pricing,
  body.is-pdf-exporting[data-print-target="visitor-profile"] #view-dashboard {
    display: block !important;
  }

  body.is-pdf-exporting[data-print-target="visitor-profile"] #view-dashboard > * {
    display: none !important;
  }

  body.is-pdf-exporting[data-print-target="visitor-profile"] #visitor-analysis-section {
    display: block !important;
    margin: 0 !important;
  }

  body.is-pdf-exporting .pdf-export-button,
  body.is-pdf-exporting .pie-expand-icon,
  body.is-pdf-exporting .page-toolbar,
  body.is-pdf-exporting .parking-toolbar-controls,
  body.is-pdf-exporting .parking-zoom-controls,
  body.is-pdf-exporting .pricing-toolbar-actions,
  body.is-pdf-exporting #parking-open-deal {
    display: none !important;
  }

  body.is-pdf-exporting .data-panel,
  body.is-pdf-exporting .pie-card {
    box-shadow: none !important;
  }

  body.is-pdf-exporting .table-scroll,
  body.is-pdf-exporting .deal-table-scroll,
  body.is-pdf-exporting .inventory-scroll,
  body.is-pdf-exporting .pricing-scroll,
  body.is-pdf-exporting .pricing-zone-scroll,
  body.is-pdf-exporting .pricing-statistics-scroll,
  body.is-pdf-exporting .pricing-room-summary-scroll,
  body.is-pdf-exporting .pricing-summary-panel,
  body.is-pdf-exporting .parking-plan-scroll {
    max-height: none !important;
    overflow: visible !important;
    scrollbar-gutter: auto !important;
  }

  body.is-pdf-exporting table {
    break-inside: auto;
  }

  body.is-pdf-exporting thead {
    display: table-header-group;
  }

  body.is-pdf-exporting tfoot {
    display: table-footer-group;
  }

  body.is-pdf-exporting tr,
  body.is-pdf-exporting .pie-card,
  body.is-pdf-exporting .parking-card,
  body.is-pdf-exporting .parking-kpi,
  body.is-pdf-exporting .pricing-history-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.is-pdf-exporting th,
  body.is-pdf-exporting .inventory-grid thead th,
  body.is-pdf-exporting .inventory-grid tbody th,
  body.is-pdf-exporting .pricing-grid thead th,
  body.is-pdf-exporting .pricing-grid tbody > tr > th {
    position: static !important;
  }

  body.is-pdf-exporting[data-print-target="visitor-profile"] .section-heading-row {
    align-items: center;
  }

  body.is-pdf-exporting[data-print-target="visitor-profile"] .pie-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3mm;
  }

  body.is-pdf-exporting[data-print-target="visitor-profile"] .pie-card {
    min-height: 58mm;
    padding: 4mm;
  }

  body.is-pdf-exporting[data-print-target="visitor-profile"] .pie-chart-content {
    grid-template-columns: 31mm minmax(0, 1fr);
    gap: 3mm;
  }

  body.is-pdf-exporting[data-print-target="visitor-profile"] .pie-chart svg {
    width: 31mm;
    height: 31mm;
  }

  body.is-pdf-exporting[data-print-target="deals"] .rule-notice,
  body.is-pdf-exporting[data-print-target="deals"] .table-summary {
    margin-bottom: 2mm;
  }

  body.is-pdf-exporting[data-print-target="deals"] .deal-report-panel {
    overflow: visible !important;
    border-radius: 0;
  }

  body.is-pdf-exporting[data-print-target="deals"] .deal-report-heading {
    min-height: 12mm;
    grid-template-columns: minmax(35mm, 1fr) auto minmax(35mm, 1fr);
    gap: 3mm;
    padding: 2mm 3mm;
  }

  body.is-pdf-exporting[data-print-target="deals"] .deal-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
    font-size: 5.2pt;
  }

  body.is-pdf-exporting[data-print-target="deals"] .deal-table th,
  body.is-pdf-exporting[data-print-target="deals"] .deal-table td {
    height: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 1.1mm 0.7mm;
    overflow-wrap: anywhere;
    white-space: normal !important;
    line-height: 1.25;
  }

  body.is-pdf-exporting[data-print-target="deals"] .deal-table thead th {
    font-size: 5pt;
  }

  body.is-pdf-exporting[data-print-target="deals"] .deal-table .selection-column,
  body.is-pdf-exporting[data-print-target="deals"] .deal-table th:last-child,
  body.is-pdf-exporting[data-print-target="deals"] .deal-table td:last-child {
    display: none !important;
  }

  body.is-pdf-exporting[data-print-target="deals"] .deal-cell-customer,
  body.is-pdf-exporting[data-print-target="deals"] .deal-parking-cell,
  body.is-pdf-exporting[data-print-target="deals"] .deal-table .note-cell {
    min-width: 0 !important;
    max-width: none !important;
  }

  body.is-pdf-exporting[data-print-target="deals"] .deal-report-summary {
    padding: 3mm;
  }

  body.is-pdf-exporting[data-print-target="inventory"] .inventory-toolbar,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-toolbar,
  body.is-pdf-exporting[data-print-target="parking"] .parking-toolbar {
    margin-bottom: 3mm;
  }

  body.is-pdf-exporting[data-print-target="inventory"] .inventory-toolbar-actions {
    max-width: 75%;
  }

  body.is-pdf-exporting[data-print-target="inventory"] .inventory-grid,
  body.is-pdf-exporting[data-print-target="inventory"] .inventory-summary-table,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-summary-table,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-room-summary-table,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-grid {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
  }

  body.is-pdf-exporting[data-print-target="inventory"] .inventory-grid th,
  body.is-pdf-exporting[data-print-target="inventory"] .inventory-grid td {
    height: 11mm;
  }

  body.is-pdf-exporting[data-print-target="inventory"] .inventory-cell {
    min-width: 0;
    padding: 1mm;
  }

  body.is-pdf-exporting[data-print-target="inventory"] .inventory-panel,
  body.is-pdf-exporting[data-print-target="inventory"] .inventory-summary-panel,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-panel,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-room-summary-panel {
    overflow: visible !important;
  }

  body.is-pdf-exporting[data-print-target="inventory"] .inventory-summary-panel {
    break-before: page;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-summary-panel,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-room-summary-panel {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-panel {
    overflow: visible !important;
    border: 0;
    break-before: page;
  }

  body.is-pdf-exporting[data-print-target="pricing"] #pricing-zone-tables {
    display: none !important;
  }

  body.is-pdf-exporting[data-print-target="pricing"] #pricing-stage-heading {
    display: none !important;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-pages {
    display: block !important;
    width: 100%;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page {
    --pricing-print-row-height: 9.5mm;
    display: grid !important;
    width: 100%;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
    gap: 2mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-stage-title,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-phase-summary {
    grid-column: 1 / -1;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-stage-title {
    display: flex;
    min-height: 8mm;
    align-items: center;
    gap: 3mm;
    padding: 1mm 2mm;
    border: 0.25mm solid #59635f;
    border-bottom: 0;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-stage-title p {
    margin: 0;
    color: #17695f;
    font-size: 4.5pt;
    font-weight: 800;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-stage-title h1 {
    margin: 0;
    font-size: 9pt;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-stage-title small {
    margin-left: auto;
    color: #66736f;
    font-size: 4.5pt;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-phase-summary {
    margin-bottom: 1mm;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-phase-summary .pricing-phase-summary-table {
    width: 100% !important;
    min-width: 0 !important;
    border: 0.25mm solid #59635f !important;
    border-collapse: collapse !important;
    table-layout: fixed;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-phase-summary .pricing-phase-summary-table th,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-phase-summary .pricing-phase-summary-table td {
    height: 4.8mm !important;
    padding: 0.35mm 0.8mm;
    border: 0.2mm solid #59635f !important;
    font-size: 4.8pt;
    line-height: 1;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-phase-summary .pricing-phase-summary-table thead th {
    height: 4.8mm !important;
    font-size: 4.2pt;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-phase-summary .pricing-phase-summary-table tbody td strong {
    font-size: 6.2pt;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-phase-summary .pricing-phase-summary-table tbody td small {
    font-size: 3.8pt;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page.is-single {
    grid-template-columns: minmax(0, 1fr);
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-zone-block {
    margin: 0;
    overflow: visible !important;
    border: 0.3mm solid #4f5956;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page.is-full .pricing-zone-block.is-zone-a {
    margin-top: calc(6 * var(--pricing-print-row-height) + 6px) !important;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page.is-single .pricing-zone-block.is-zone-a {
    margin-top: 0 !important;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-zone-heading {
    min-height: 18mm;
    padding: 1.5mm 2mm;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-grid {
    border: 0.25mm solid #59635f !important;
    border-collapse: collapse !important;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-grid th,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-grid td {
    border: 0.22mm solid #59635f !important;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-grid thead th,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-grid tfoot th,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-grid tfoot td {
    height: 5.5mm !important;
    padding: 0.35mm;
    font-size: 4.7pt;
    line-height: 1;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-grid tbody th,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-grid tbody td {
    height: var(--pricing-print-row-height) !important;
    max-height: var(--pricing-print-row-height);
    font-size: 4.9pt;
    line-height: 1;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-cell {
    height: var(--pricing-print-row-height) !important;
    min-height: 0;
    min-width: 0;
    grid-template-rows: 4mm 5.5mm;
    padding: 0;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-cell-values {
    height: 4mm;
    border-bottom: 0.2mm solid #59635f !important;
    font-size: 4.6pt;
    line-height: 1;
    white-space: nowrap;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-cell-values > * {
    padding: 0.2mm;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-cell-values > * + * {
    border-left: 0.2mm solid #59635f !important;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-unit-price {
    font-size: 4.9pt;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-cell > strong {
    display: flex !important;
    height: 5.5mm;
    align-items: center;
    justify-content: center;
    gap: 0.7mm;
    font-size: 6.8pt;
    line-height: 1;
    white-space: nowrap;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-cell > strong small {
    margin: 0;
    font-size: 4.4pt;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-cell:hover,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-cell:focus-visible,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-shop-card:hover,
  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-shop-card:focus-visible {
    filter: none;
    box-shadow: none;
    outline: none;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-print-page .pricing-shop-card {
    width: 66mm;
    min-height: 13mm;
    padding: 1mm 1.5mm;
  }

  body.is-pdf-exporting[data-print-target="pricing"] .pricing-history-section {
    break-before: page;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.is-pdf-exporting[data-print-target="parking"] .parking-context-row {
    margin-bottom: 2mm;
  }

  body.is-pdf-exporting[data-print-target="parking"] .parking-kpis {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 2mm;
    margin-bottom: 3mm;
  }

  body.is-pdf-exporting[data-print-target="parking"] .parking-kpi {
    min-height: 18mm;
    padding: 2.5mm;
  }

  body.is-pdf-exporting[data-print-target="parking"] .parking-workspace {
    grid-template-columns: minmax(0, 1fr) 52mm;
    gap: 3mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.is-pdf-exporting[data-print-target="parking"] .parking-plan-panel {
    overflow: visible !important;
  }

  body.is-pdf-exporting[data-print-target="parking"] .parking-plan-scroll {
    padding: 2mm;
  }

  body.is-pdf-exporting[data-print-target="parking"] .parking-plan-stage {
    max-width: 100% !important;
    box-shadow: none;
  }

  body.is-pdf-exporting[data-print-target="parking"] .parking-plan-stage.is-zone-a {
    width: 165mm !important;
  }

  body.is-pdf-exporting[data-print-target="parking"] .parking-plan-stage.is-zone-b {
    width: 310mm !important;
  }

  body.is-pdf-exporting[data-print-target="parking"] .parking-detail-panel {
    position: static;
    top: auto;
    padding: 3mm;
  }

  body.is-pdf-exporting[data-print-target="parking"] .parking-roster-panel {
    margin-top: 4mm;
    break-before: page;
  }

  body.is-pdf-exporting[data-print-target="parking"] .parking-card-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 2mm;
  }

  body.is-pdf-exporting[data-print-target="parking"] .parking-card {
    min-height: 20mm;
    padding: 2mm;
  }
}

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