:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-2: #fafafa;
  --line: #d9d9de;
  --line-strong: #c7c7cc;
  --text: #1d1d1f;
  --muted: #505a5e;
  --primary: #147d64;
  --primary-2: #0d654f;
  --success: #147d64;
  --warning: #9a6700;
  --danger: #b42318;
  --info: #245b9e;
  --gift: #735c91;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.22);
  --radius: 8px;
  --radius-sm: 6px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

* {
  letter-spacing: 0 !important;
}

html,
body {
  min-height: 100%;
  background: var(--bg) !important;
  color: var(--text);
  font-family: var(--font);
}

html {
  scrollbar-gutter: stable;
}

body {
  font-size: 14px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

::selection {
  background: rgba(20, 125, 100, 0.18);
}

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

button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  box-shadow: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

button:hover {
  border-color: #b9b9bf;
  background: #f5f5f7;
}

button:active {
  background: #ececef;
}

button.primary,
button.small.primary {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: none !important;
}

button.primary:hover,
button.small.primary:hover {
  border-color: var(--primary-2) !important;
  background: var(--primary-2) !important;
}

#pdfBtn,
#customerPdfBtn,
#costPdfBtn,
#contractPdfBtn,
#outstandingPdfBtn,
button[data-action$="-pdf"] {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: none !important;
}

#pdfBtn:hover,
#customerPdfBtn:hover,
#costPdfBtn:hover,
#contractPdfBtn:hover,
#outstandingPdfBtn:hover,
button[data-action$="-pdf"]:hover {
  border-color: var(--primary-2) !important;
  background: var(--primary-2) !important;
}

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

button.danger:hover {
  border-color: #d89c96;
  background: #fff5f4;
}

button.small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

input,
select,
textarea {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  box-shadow: none;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b9b9bf;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6e93bf;
  box-shadow: 0 0 0 3px rgba(36, 91, 158, 0.12);
}

input[readonly],
textarea[readonly],
select:disabled,
input:disabled,
textarea:disabled,
button:disabled {
  background: #f3f3f5;
  color: #77777c;
  opacity: 1;
}

.app {
  display: grid !important;
  grid-template-columns: 218px minmax(0, 1fr) !important;
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  position: sticky !important;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: auto;
  height: 100vh !important;
  min-width: 0;
  padding: 14px 10px 12px !important;
  overflow: auto;
  border: 0 !important;
  border-right: 1px solid #353538 !important;
  background: #1d1d1f !important;
  color: #f5f5f7;
  box-shadow: none !important;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: #48484a;
}

.brand {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  margin: 0 2px 10px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.brand.brand-no-logo {
  grid-template-columns: minmax(0, 1fr);
}

.brand-mark {
  width: 38px !important;
  height: 38px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: #fff;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  color: #fff;
  font-size: 15px !important;
  font-weight: 650;
  line-height: 1.25;
}

.brand p {
  margin-top: 3px !important;
  color: #a1a1a6 !important;
  font-size: 11px !important;
  line-height: 1.3;
}

.side-nav {
  display: grid;
  gap: 8px !important;
}

.nav-group {
  display: grid;
  gap: 3px;
}

.nav-label {
  padding: 0 9px 2px !important;
  color: #8e8e93 !important;
  font-size: 10px !important;
  font-weight: 600 !important;
}

.nav-btn {
  position: relative;
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) 16px !important;
  align-items: center;
  min-height: 40px !important;
  padding: 8px 10px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #d1d1d6 !important;
  font-size: 13px;
  text-align: left;
}

.nav-btn::before {
  content: "";
  position: absolute;
  inset: 7px auto 7px 0;
  width: 3px;
  border-radius: 3px;
  background: transparent;
}

.nav-btn:hover {
  background: #2c2c2e !important;
  color: #fff !important;
}

.nav-btn.active {
  background: #343436 !important;
  color: #fff !important;
  box-shadow: none !important;
}

.nav-btn.active::before {
  background: #42b996;
}

.nav-icon {
  display: grid !important;
  place-items: center;
  width: 22px !important;
  height: 22px !important;
  color: #a1a1a6 !important;
  font-size: 17px !important;
}

.nav-icon svg,
.nav-icon[data-lucide] {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.nav-btn.active .nav-icon,
.nav-btn:hover .nav-icon {
  color: #fff !important;
}

.nav-arrow {
  color: #636366 !important;
  font-size: 16px;
  text-align: right;
}

.sidebar-utility {
  position: relative;
  display: grid !important;
  gap: 9px !important;
  margin-top: auto !important;
  padding: 14px 2px 0 !important;
  border-top: 1px solid #38383a !important;
}

.sidebar-save-state {
  color: #8e8e93 !important;
  font-size: 10px !important;
}

.sidebar-utility button {
  width: 100%;
  min-height: 40px;
  border: 1px solid #48484a !important;
  background: #2c2c2e !important;
  color: #f5f5f7 !important;
}

.sidebar-utility button:hover {
  border-color: #636366 !important;
  background: #3a3a3c !important;
}

.sidebar .pill {
  border-color: #4b4b4f !important;
  background: #313133 !important;
  color: #d1d1d6 !important;
}

.main {
  min-width: 0;
  padding: 14px 20px 36px !important;
  background: var(--bg) !important;
}

.topbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 20px !important;
  padding: 0 0 18px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.workspace-heading .eyebrow {
  margin-bottom: 5px;
  color: var(--muted) !important;
  font-size: 10px !important;
  font-weight: 600 !important;
}

.workspace-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: 30px !important;
  font-weight: 650 !important;
  line-height: 1.12;
}

.workspace-heading p {
  margin: 6px 0 0 !important;
  color: var(--muted) !important;
  font-size: 12px !important;
}

.top-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px !important;
  flex-wrap: wrap;
}

.pill {
  min-height: 27px;
  padding: 4px 9px !important;
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #56565c !important;
  font-size: 10px !important;
  line-height: 17px;
}

.pill.final,
.pill.success,
.cloud-sync-pill.cloud-online {
  border-color: #b8dbd0 !important;
  background: #f1f8f5 !important;
  color: #12624f !important;
}

.pill.warn,
.workflow-draft {
  border-color: #e4cf9c !important;
  background: #fff9e9 !important;
  color: #805700 !important;
}

.cloud-user-button {
  min-width: 62px;
}

.section,
.dashboard-panel,
.workbench-panel,
.fixed-panel,
.designer-card,
.contract-editor,
.payment-ledger {
  border-color: var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: var(--shadow) !important;
}

#moduleShell {
  overflow: visible;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#moduleShell > .module-head {
  margin-bottom: 12px;
  padding: 0 0 11px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  background: transparent !important;
}

.module-head-title {
  color: var(--text);
  font-size: 16px !important;
  font-weight: 650 !important;
}

.module-head-subtitle,
.mini,
.muted {
  color: var(--muted) !important;
}

#moduleShell > .section-body {
  padding: 0 !important;
}

.section .section-head {
  min-height: 56px;
  padding: 13px 16px !important;
  border-color: var(--line) !important;
  background: #fff !important;
}

.section .section-body {
  padding: 16px !important;
}

.dashboard-toolbar,
.order-list-toolbar,
.customer-toolbar,
.customer-detail-head,
.order-context-bar,
.scheme-actions-bar {
  border-color: var(--line) !important;
  background: transparent !important;
}

.dashboard-segment,
.tabs,
.order-detail-tabs {
  border-color: var(--line) !important;
  border-radius: 7px !important;
  background: #e9e9ec !important;
}

.dashboard-segment button,
.tabs button,
.order-detail-tabs > button {
  border: 0 !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: #55555a !important;
  box-shadow: none !important;
}

.dashboard-segment button.active,
.tabs button.active,
.order-detail-tabs > button.active {
  background: #fff !important;
  color: var(--text) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}

.workbench,
.dashboard-shell {
  gap: 14px !important;
}

.workbench-overview {
  min-height: 48px;
  padding: 12px 14px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.workbench-overview-date {
  color: var(--primary) !important;
}

.dashboard-kpis {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0 !important;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dashboard-kpi {
  min-height: 112px;
  margin: 0 !important;
  padding: 18px 42px 16px 15px !important;
  border: 0 !important;
  border-right: 1px solid var(--line) !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}

.dashboard-kpi:nth-child(4n) {
  border-right: 0 !important;
}

.dashboard-kpi:nth-child(n + 5) {
  border-bottom: 0 !important;
}

.dashboard-kpi:hover {
  background: #fafafa !important;
}

.dashboard-kpi span {
  margin-bottom: 9px !important;
  color: var(--muted) !important;
  font-size: 11px !important;
}

.dashboard-kpi strong {
  color: var(--text);
  font-size: 22px !important;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.dashboard-kpi.income strong,
.dashboard-kpi.net strong {
  color: #147d64;
}

.dashboard-kpi.balance strong {
  color: #245b9e;
}

.dashboard-kpi.outstanding strong {
  color: #8a5d00;
}

.dashboard-kpi small {
  margin-top: 8px !important;
  color: #86868b !important;
  font-size: 10px !important;
  line-height: 1.45;
}

.dashboard-kpi-open {
  right: 15px !important;
  top: 18px !important;
  transform: none !important;
  color: #a1a1a6 !important;
  font-size: 14px !important;
}

.dashboard-chart-grid {
  gap: 14px !important;
}

.dashboard-panel {
  padding: 0 !important;
  overflow: hidden;
}

.dashboard-panel-head {
  min-height: 52px;
  margin: 0 !important;
  padding: 13px 15px !important;
  border-bottom: 1px solid var(--line) !important;
}

.dashboard-panel > :not(.dashboard-panel-head) {
  margin-left: 14px;
  margin-right: 14px;
}

.dashboard-panel svg {
  max-width: 100%;
}

.order-management-list,
.customer-directory-wrap,
.customer-orders-wrap,
.dashboard-ledger-wrap,
.cost-table-wrap,
.fixed-table-wrap {
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff;
  box-shadow: none !important;
}

table,
.dashboard-ledger,
.customer-directory,
.customer-orders,
.cost-table,
.fixed-table {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

th {
  background: #f5f5f7 !important;
  color: #55555a !important;
  font-size: 11px !important;
  font-weight: 650 !important;
}

th,
td {
  border-color: #e2e2e6 !important;
}

tbody tr:hover td {
  background: #fafafa;
}

.order-context-bar {
  position: sticky;
  top: 0;
  z-index: 8;
  margin: 0 0 10px;
  padding: 10px 12px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.07) !important;
}

.order-detail-tabs {
  position: sticky;
  top: 67px;
  z-index: 7;
  padding: 4px !important;
}

.current-scheme-card {
  min-width: 160px;
}

#quoteSection,
#quotePreviewSection,
#costPreview {
  margin-top: 14px;
}

.summary {
  gap: 0 !important;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.summary > * {
  border-radius: 0 !important;
  box-shadow: none !important;
}

.table,
.preview-paper {
  border-color: var(--line) !important;
  box-shadow: none !important;
}

dialog,
.system-tools-dialog,
.customer-link-dialog,
.customer-edit-dialog,
.dashboard-detail-dialog {
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff;
  box-shadow: var(--shadow-modal) !important;
}

dialog::backdrop {
  background: rgba(29, 29, 31, 0.54) !important;
}

.system-tools-head,
.dashboard-detail-head,
.customer-dialog-head {
  border-color: var(--line) !important;
  background: #f5f5f7 !important;
  color: var(--text) !important;
}

.dashboard-detail-title span {
  color: var(--muted) !important;
}

.dashboard-detail-close {
  border-color: var(--line) !important;
  background: #fff !important;
  color: var(--text) !important;
}

.cloud-login-overlay,
.cloud-modal-overlay {
  background: rgba(29, 29, 31, 0.64) !important;
  backdrop-filter: none !important;
}

.cloud-login-card,
.cloud-modal-card {
  width: min(420px, calc(100vw - 28px));
  padding: 28px !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: var(--shadow-modal) !important;
}

.cloud-login-brand {
  margin-bottom: 22px !important;
}

.cloud-login-brand h2 {
  color: var(--text);
  font-size: 21px !important;
  font-weight: 650 !important;
}

.cloud-login-brand p {
  color: var(--muted) !important;
}

.cloud-login-fields {
  gap: 13px !important;
}

.cloud-login-fields label,
.field label {
  color: #4f4f54 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}

.cloud-login-submit {
  min-height: 42px !important;
  margin-top: 17px !important;
}

.cloud-login-secondary button {
  border-color: transparent !important;
  background: transparent !important;
  color: var(--primary) !important;
}

.notice,
.workbench-empty,
.dashboard-detail-empty,
.cost-manager-empty {
  border-color: var(--line) !important;
  background: #fafafa !important;
  color: var(--muted) !important;
}

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 204px minmax(0, 1fr) !important;
  }

  .main {
    padding: 20px 20px 40px !important;
  }

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

  .dashboard-kpi:nth-child(4n) {
    border-right: 1px solid var(--line) !important;
  }

  .dashboard-kpi:nth-child(3n) {
    border-right: 0 !important;
  }

  .dashboard-kpi:nth-child(n + 5) {
    border-bottom: 1px solid var(--line) !important;
  }

  .dashboard-kpi:nth-last-child(-n + 1),
  .dashboard-kpi:nth-last-child(-n + 2),
  .dashboard-kpi:nth-last-child(-n + 3) {
    border-bottom: 0 !important;
  }
}

@media (max-width: 900px) {
  .app {
    display: block !important;
  }

  .main {
    padding: 18px 16px 36px !important;
  }

  .workspace-heading h1 {
    font-size: 26px !important;
  }

  .dashboard-chart-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 680px) {
  .main {
    padding: 14px 10px 28px !important;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .top-status {
    justify-content: flex-start;
  }

  .workspace-heading h1 {
    font-size: 24px !important;
  }

  .dashboard-kpis {
    grid-template-columns: 1fr !important;
  }

  .dashboard-kpi,
  .dashboard-kpi:nth-child(n) {
    min-height: 96px;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .dashboard-kpi:last-child {
    border-bottom: 0 !important;
  }

  .order-context-bar {
    position: static;
  }

  .order-detail-tabs {
    position: static;
    overflow-x: auto;
  }

  .order-detail-tabs > button {
    flex: 0 0 auto;
  }

  .cloud-login-card,
  .cloud-modal-card {
    padding: 22px 18px !important;
  }
}

/* Production Apple Pro layout */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app {
  display: block !important;
  min-height: 100vh;
}

.sidebar {
  position: fixed !important;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex !important;
  width: 220px !important;
  height: 100vh !important;
  padding: 0 !important;
  overflow-y: auto;
  border-right: 1px solid #353538 !important;
  background: #1d1d1f !important;
}

.sidebar .brand {
  min-height: 72px;
  margin: 0 !important;
  padding: 13px 16px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar .brand-mark {
  width: 36px !important;
  height: 36px !important;
  border-radius: 7px !important;
}

.sidebar .brand-copy h1 {
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}

.sidebar .brand-copy p {
  margin-top: 3px !important;
  color: #a1a1a6 !important;
  font-size: 11px !important;
}

.side-nav {
  flex: 1;
  align-content: start;
  gap: 0 !important;
  grid-auto-rows: max-content;
  padding: 8px 12px !important;
}

.side-nav .nav-group {
  align-content: start;
  grid-auto-rows: max-content;
}

.side-nav .nav-group + .nav-group {
  margin-top: 10px;
}

.side-nav .nav-label {
  padding: 0 9px 3px !important;
  color: #a1a1a6 !important;
  font-size: 10px !important;
  font-weight: 600 !important;
}

.side-nav .nav-btn {
  position: relative;
  display: grid !important;
  width: 100%;
  min-height: 40px;
  grid-template-columns: 22px minmax(0, 1fr) auto !important;
  align-items: center;
  gap: 9px !important;
  padding: 7px 10px !important;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #d1d1d6 !important;
  text-align: left;
}

.side-nav .nav-btn:hover {
  background: #2c2c2e !important;
  color: #fff !important;
}

.side-nav .nav-btn.active {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: #343436 !important;
  color: #fff !important;
}

.side-nav .nav-btn.active::before {
  top: 9px !important;
  bottom: 9px !important;
  left: -1px !important;
  width: 2px !important;
  border-radius: 2px;
  background: #56b99c !important;
}

.side-nav .nav-icon,
.side-nav .nav-icon svg {
  width: 17px !important;
  height: 17px !important;
  color: currentColor !important;
}

.sidebar-utility {
  display: grid !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 12px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.09) !important;
}

.sidebar-save-state {
  order: 2;
  display: flex !important;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
  color: #8e8e93 !important;
}

.sidebar-lock-button {
  order: 1;
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 0 !important;
  background: transparent !important;
  color: #d1d1d6 !important;
  text-align: left;
}

.sidebar-lock-button:hover {
  background: #2c2c2e !important;
  color: #fff !important;
}

.sidebar-lock-button svg {
  width: 17px;
  height: 17px;
}

.sidebar-account {
  order: 3;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
}

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

.sidebar-account strong {
  color: #f5f5f7;
  font-size: 12px;
}

.sidebar-account small {
  margin-top: 2px;
  color: #a1a1a6;
  font-size: 10px;
}

.sidebar-account-menu-button {
  display: grid;
  width: 30px;
  min-height: 30px;
  padding: 0;
  place-items: center;
  border: 0 !important;
  background: transparent !important;
  color: #a1a1a6 !important;
}

.sidebar-account-menu-button:hover,
.sidebar-account-menu-button[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.sidebar-account-menu-button svg {
  width: 16px;
  height: 16px;
}

.sidebar-account-menu {
  position: absolute;
  right: 10px;
  bottom: 66px;
  left: 10px;
  z-index: 50;
  overflow: hidden;
  border: 1px solid #48484a;
  border-radius: 7px;
  background: #2c2c2e;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
}

.sidebar-account-menu[hidden] {
  display: none !important;
}

.sidebar-account-menu-head {
  padding: 10px 12px 9px;
  border-bottom: 1px solid #48484a;
}

.sidebar-account-menu-head strong,
.sidebar-account-menu-head small {
  display: block;
}

.sidebar-account-menu-head strong {
  color: #fff;
  font-size: 12px;
}

.sidebar-account-menu-head small {
  margin-top: 2px;
  overflow: hidden;
  color: #a1a1a6;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account-menu > button {
  display: grid;
  width: 100%;
  min-height: 48px;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #f5f5f7 !important;
  text-align: left;
}

.sidebar-account-menu > button:last-child {
  border-bottom: 0 !important;
}

.sidebar-account-menu > button:hover {
  background: #3a3a3c !important;
}

.sidebar-account-menu > button svg {
  width: 17px;
  height: 17px;
  color: #d1d1d6;
}

.sidebar-account-menu > button strong,
.sidebar-account-menu > button small {
  display: block;
}

.sidebar-account-menu > button strong {
  color: #fff;
  font-size: 11px;
}

.sidebar-account-menu > button small {
  margin-top: 2px;
  color: #a1a1a6;
  font-size: 9px;
}

.account-profile-dialog {
  width: min(430px, calc(100vw - 28px));
  padding: 0 !important;
}

.account-profile-head {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f7f7f8;
}

.account-profile-head strong,
.account-profile-head small {
  display: block;
}

.account-profile-head strong {
  font-size: 15px;
}

.account-profile-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.account-profile-head > button {
  display: grid;
  width: 34px;
  min-height: 34px;
  padding: 0;
  place-items: center;
}

.account-profile-head > button svg {
  width: 16px;
}

.account-profile-body {
  padding: 18px 16px 14px;
}

.account-profile-body > label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
}

.account-profile-body > input {
  width: 100%;
}

.account-profile-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f7f8;
  font-size: 11px;
}

.account-profile-login span {
  color: var(--muted);
}

.account-profile-status {
  min-height: 18px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.account-profile-status.success {
  color: var(--success);
}

.account-profile-status.error {
  color: var(--danger);
}

.account-profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.main {
  min-height: 100vh;
  margin-left: 220px;
  row-gap: 8px;
  padding: 54px 0 48px !important;
  background: var(--bg) !important;
  overflow-anchor: none;
}

.product-topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 220px;
  z-index: 30;
  display: flex;
  width: auto;
  height: 54px;
  min-height: 54px;
  align-items: center;
  box-sizing: border-box;
  padding: 7px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.product-company-context {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.product-company-context strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-company-context span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

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

.product-icon-button,
.product-lock-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--text) !important;
}

.product-icon-button {
  width: 36px;
  padding: 0;
}

.product-icon-button:hover,
.product-lock-button:hover {
  border-color: var(--line-strong) !important;
  background: #f7f7f8 !important;
}

.product-icon-button svg,
.product-lock-button svg {
  width: 17px;
  height: 17px;
}

.mobile-nav-button {
  display: none;
  margin-right: 10px;
}

.product-notice-button {
  position: relative;
}

.product-notice-button > span {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: var(--danger);
}

.product-notice-panel {
  position: absolute;
  top: 48px;
  right: 76px;
  display: none;
  width: min(300px, calc(100vw - 32px));
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-modal);
}

.product-notice-panel.open {
  display: grid;
}

.product-notice-panel strong {
  margin-bottom: 3px;
  font-size: 13px;
}

.product-notice-panel span {
  color: var(--muted);
  font-size: 11px;
}

.main > .topbar,
.main > #moduleShell,
.main > #quoteSection,
.main > #quotePreviewSection,
.main > #costSection,
.main > #costPreview {
  width: min(1660px, calc(100% - 40px));
  margin-right: auto !important;
  margin-left: auto !important;
}

.main > .topbar {
  min-height: 68px;
  align-items: flex-start;
  margin-bottom: 0 !important;
  padding: 13px 0 9px !important;
  border-bottom: 0 !important;
}

.workspace-heading h1 {
  font-size: 28px !important;
  line-height: 1.2;
}

.workspace-heading .eyebrow {
  color: #505054 !important;
  font-size: 10px !important;
}

.workspace-heading p {
  margin-top: 5px !important;
  font-size: 11px !important;
}

#cloudLogoutBtn {
  display: none !important;
}

#moduleShell > .module-head {
  display: none !important;
}

#moduleShell,
#moduleShell > .section-body {
  padding: 0 !important;
}

#moduleShell > #orderOverviewTab,
#moduleShell > #quoteTab,
#moduleShell > #paymentTab,
#moduleShell > #costTab,
#moduleShell > #contractTab,
#moduleShell > #orderProfitTab {
  padding-top: 16px !important;
}

#workbenchTab {
  display: grid;
  gap: 12px;
}

#workbenchPage {
  grid-row: 2;
}

#businessDashboard {
  display: contents;
}

#businessDashboard > .dashboard-toolbar {
  grid-row: 1;
}

#businessDashboard > .dashboard-kpis {
  grid-row: 3;
}

#businessDashboard > .dashboard-primary-grid {
  grid-row: 4;
}

#businessDashboard > .dashboard-secondary-grid {
  grid-row: 5;
}

.dashboard-toolbar {
  min-height: 38px;
  justify-content: flex-end !important;
  padding: 0 !important;
}

.dashboard-toolbar > .left {
  order: 2;
}

.dashboard-toolbar > .right {
  order: 1;
  margin-right: auto;
}

.dashboard-segment {
  padding: 3px !important;
  border: 1px solid var(--line) !important;
  background: #eeeef0 !important;
}

.dashboard-segment button {
  min-width: 56px;
  min-height: 30px;
}

.dashboard-toolbar select {
  min-height: 36px;
  border-color: var(--line) !important;
  border-radius: 7px !important;
  background: #fff !important;
}

.workbench-overview {
  min-height: 44px;
  padding: 8px 12px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
}

.workbench-statuses {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 11px;
}

.workbench-statuses > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.workbench-statuses i {
  color: var(--primary);
  font-style: normal;
}

.workbench-statuses strong {
  color: var(--text);
}

.workbench-statuses .workbench-date {
  color: var(--muted);
}

.workbench-overview > button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 4px 5px;
  border: 0 !important;
  background: transparent !important;
  color: var(--primary-2) !important;
  font-size: 11px;
  font-weight: 700;
}

.dashboard-kpis {
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
}

.dashboard-kpi,
.dashboard-kpi:nth-child(n) {
  min-height: 104px;
  padding: 15px 34px 13px 13px !important;
  border-right: 1px solid var(--line) !important;
  border-bottom: 0 !important;
}

.dashboard-kpi:last-child {
  border-right: 0 !important;
}

.dashboard-kpi span {
  margin-bottom: 8px !important;
}

.dashboard-kpi strong {
  font-size: 20px !important;
}

.dashboard-kpi small {
  overflow: hidden;
  color: #626268 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-kpi-open {
  right: 12px !important;
  top: 15px !important;
}

.dashboard-primary-grid,
.dashboard-secondary-grid {
  display: grid;
  gap: 12px;
}

.dashboard-primary-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(440px, 1fr);
}

.dashboard-secondary-grid {
  grid-template-columns: minmax(430px, 1.1fr) minmax(520px, 1fr);
}

.dashboard-panel {
  min-width: 0;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
}

.dashboard-panel-head {
  min-height: 56px;
  padding: 12px 14px !important;
}

.dashboard-panel-head > div > strong,
.dashboard-panel-head > div > small {
  display: block;
}

.dashboard-panel-head > div > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.dashboard-panel-head > button {
  min-height: 28px;
  padding: 3px 4px;
  border: 0 !important;
  background: transparent !important;
  color: var(--primary-2) !important;
  font-size: 11px;
  font-weight: 700;
}

.dashboard-chart-legend {
  display: inline-flex;
  gap: 14px;
}

.dashboard-chart-legend b::before {
  display: inline-block;
  width: 14px;
  height: 2px;
  margin-right: 5px;
  background: currentColor;
  vertical-align: middle;
  content: '';
}

.dashboard-trend-panel .trend-chart {
  display: block !important;
  width: calc(100% - 28px) !important;
  height: 235px !important;
  margin: 6px 14px 10px !important;
  padding: 0 !important;
}

.dashboard-composition-panel .cost-composition {
  display: grid;
  min-height: 251px;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}

.dashboard-composition-panel .cost-donut {
  width: 150px;
  height: 150px;
}

.dashboard-composition-panel .cost-legend {
  width: 100%;
  max-height: 218px;
  padding-right: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  scrollbar-color: #c7c7cc transparent;
  scrollbar-width: thin;
}

.dashboard-composition-panel .cost-legend::-webkit-scrollbar {
  width: 6px;
}

.dashboard-composition-panel .cost-legend::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-composition-panel .cost-legend::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: #c7c7cc;
}

.dashboard-composition-panel .cost-legend-row {
  grid-template-columns: 10px minmax(110px, 1fr) auto;
  gap: 8px;
  font-size: 11px;
}

.board-usage-bars {
  display: grid;
  min-height: 236px;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 24px;
  padding: 18px 32px 14px;
}

.board-usage-item {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1fr auto;
  gap: 9px;
  text-align: center;
}

.board-usage-item span,
.board-usage-item strong {
  font-size: 11px;
}

.board-usage-item span {
  color: var(--muted);
}

.board-usage-track {
  display: flex;
  width: 34px;
  min-height: 150px;
  align-items: flex-end;
  justify-self: center;
  border-bottom: 1px solid var(--line-strong);
}

.board-usage-track i {
  display: block;
  width: 100%;
  min-height: 0;
  border-radius: 3px 3px 0 0;
}

.dashboard-receivable-list {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) repeat(3, max-content);
  align-content: start;
  column-gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.dashboard-receivable-row {
  display: grid;
  grid-column: 1 / -1;
  width: auto;
  min-width: 0;
  min-height: 49px;
  grid-template-columns: subgrid;
  align-items: center;
  column-gap: inherit;
  padding: 7px 8px;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  text-align: left;
  white-space: nowrap;
}

.dashboard-receivable-row > span:last-child {
  text-align: right;
}

.dashboard-receivable-row > span:nth-child(3) {
  text-align: center;
}

.dashboard-receivable-row:not(.head) > span:nth-child(2) {
  color: #606b77;
}

.dashboard-receivable-row:not(.head) > span:nth-child(3) {
  justify-self: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef0f3;
  color: var(--text);
  line-height: 20px;
}

.dashboard-receivable-row:not(.head) > span:last-child {
  font-weight: 600;
}

.dashboard-receivable-empty {
  grid-column: 1 / -1;
}

.dashboard-receivable-row:hover:not(.head) {
  background: #fafafa !important;
}

.dashboard-receivable-row.head {
  min-height: 34px;
  background: #f7f7f8 !important;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

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

.dashboard-receivable-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.dashboard-receivable-empty,
.order-list-empty,
.order-archive-empty {
  padding: 30px 18px;
  color: var(--muted);
  text-align: center;
}

.order-list-toolbar {
  min-height: 54px;
  margin-bottom: 12px;
  padding: 8px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
}

.order-list-toolbar .search-block {
  flex: 0 1 330px;
}

#orderSearch {
  width: 100% !important;
  min-height: 36px;
  padding-left: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}

.order-filter-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
}

.order-filter-tabs button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid transparent !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-weight: 600;
}

.order-filter-tabs button:hover {
  background: #f7f7f8 !important;
}

.order-filter-tabs button.active {
  border-color: #b9d4cf !important;
  background: #e8f3ef !important;
  color: var(--primary-2) !important;
}

.order-filter-tabs b {
  margin-left: 3px;
  font-size: 10px;
}

.order-list-toolbar .actions {
  margin-left: auto;
}

#orderCountPill {
  display: none;
}

.order-management-list {
  max-height: none !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid var(--line) !important;
}

.order-browser {
  display: grid;
  min-height: 560px;
  grid-template-columns: 188px minmax(0, 1fr);
}

.order-archive-tree {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--line);
  background: #fafafa;
}

.order-archive-title {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 4px 7px 8px;
  border-bottom: 1px solid var(--line);
}

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

.order-archive-title span {
  color: var(--muted);
  font-size: 10px;
}

.order-archive-tree-body {
  padding-top: 5px;
}

.order-archive-item,
.order-archive-year > summary {
  display: grid;
  width: 100%;
  min-height: 38px;
  grid-template-columns: 17px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid transparent !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 11px;
  text-align: left;
}

.order-archive-item:hover,
.order-archive-year > summary:hover {
  background: #edf2f1 !important;
}

.order-archive-item.active {
  border-color: #b9d4cf !important;
  background: #e8f3ef !important;
  color: var(--primary-2) !important;
}

.order-archive-item strong,
.order-archive-year strong {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-archive-item b,
.order-archive-year b {
  font-size: 10px;
}

.order-archive-year > summary {
  list-style: none;
  cursor: pointer;
}

.order-archive-year > summary::-webkit-details-marker {
  display: none;
}

.order-archive-year > div {
  padding-left: 18px;
}

.order-table-panel {
  min-width: 0;
  background: #fff;
}

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

.order-table-summary > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.order-table-summary > div > strong {
  font-size: 15px;
}

.order-table-summary > div > span,
.order-table-summary small {
  color: var(--muted);
  font-size: 10px;
}

.order-table-summary small {
  margin-left: auto;
}

.order-data-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.order-data-table:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.order-data-row {
  display: grid;
  width: 100%;
  min-width: 930px;
  min-height: 58px;
  grid-template-columns: minmax(190px, 1.5fr) 100px 100px 112px 100px 100px 105px 20px;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.order-data-head {
  min-height: 38px;
  background: #f7f7f8;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.order-data-row.order-item {
  margin: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: #fff !important;
}

.order-data-row.order-item:hover,
.order-data-row.order-item.active {
  background: #f7faf9 !important;
}

.order-data-row.order-item.active {
  color: var(--text) !important;
  box-shadow: inset 2px 0 var(--primary);
}

.order-data-row.order-item.active strong {
  color: var(--text) !important;
}

.order-data-row.order-item.active small,
.order-data-row.order-item.active .order-row-arrow {
  color: var(--muted) !important;
}

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

.order-data-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.order-state-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--warning);
}

.order-state-dot.confirmed {
  background: var(--info);
}

.order-state-dot.completed {
  background: var(--success);
}

.order-row-arrow {
  color: var(--muted);
  font-size: 17px;
}

.order-context-bar {
  position: static !important;
  min-height: 68px;
  margin-bottom: 10px;
  padding: 10px 12px !important;
  box-shadow: none !important;
}

.order-detail-tabs {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
  justify-content: flex-start;
  padding: 0 !important;
  overflow-x: auto;
  border: 0 !important;
  border-bottom: 1px solid var(--line-strong) !important;
  border-radius: 0 !important;
  background: var(--bg) !important;
}

#quoteSection > .section-head {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
  box-shadow: none !important;
}

.cost-section-head {
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px !important;
  color: var(--text) !important;
}

.cost-section-heading {
  min-width: 240px;
}

.cost-section-heading strong,
.cost-section-heading span {
  display: block;
}

.cost-section-heading strong {
  font-size: 15px;
}

.cost-section-heading span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.cost-section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}

.order-detail-tabs > button {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 8px 14px !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.order-detail-tabs > button svg {
  width: 16px;
  height: 16px;
}

.order-detail-tabs > button.active {
  background: transparent !important;
  color: var(--primary-2) !important;
  box-shadow: inset 0 -2px var(--primary) !important;
}

.section,
.designer-card,
.contract-editor,
.payment-ledger,
.fixed-panel,
.customer-directory-wrap,
.customer-orders-wrap {
  border-radius: 8px !important;
  box-shadow: none !important;
}

.section .section-head,
.fixed-head,
.customer-detail-head {
  min-height: 56px;
}

input,
select,
textarea {
  border-radius: 7px !important;
}

.system-tools-dialog {
  width: min(1180px, calc(100vw - 32px)) !important;
  max-height: min(88vh, 880px) !important;
  border-radius: 8px !important;
}

#systemToolsDialog[open] {
  position: fixed !important;
  inset: 54px 0 0 220px !important;
  z-index: 28;
  display: block;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 0 48px !important;
  overflow: auto;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--bg) !important;
  box-shadow: none !important;
}

#systemToolsDialog::backdrop {
  background: transparent !important;
}

#systemToolsDialog > .system-tools-head,
#systemToolsDialog > .system-tools-body {
  width: min(1660px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

#systemToolsDialog > .system-tools-head {
  min-height: 82px;
  align-items: flex-end;
  padding: 14px 0 12px !important;
  border-bottom: 0 !important;
  background: transparent !important;
}

#systemToolsDialog > .system-tools-head strong {
  font-size: 28px;
  line-height: 1.2;
}

#systemToolsDialog > .system-tools-head .mini {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

#systemToolsCloseBtn {
  display: none;
}

#systemToolsDialog > .system-tools-body {
  min-height: 620px;
  max-height: none !important;
  overflow: hidden !important;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.system-tools-head {
  min-height: 60px;
  padding: 14px 18px !important;
  background: #fff !important;
}

.system-tools-body {
  display: grid !important;
  min-height: 570px;
  max-height: calc(88vh - 60px) !important;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.system-tools-nav {
  padding: 8px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #fafafa;
}

.system-tools-nav button {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 0 !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: var(--muted) !important;
  text-align: left;
}

.system-tools-nav button:hover {
  background: #f0f0f2 !important;
}

.system-tools-nav button.active {
  background: #e8f3ef !important;
  color: var(--primary-2) !important;
  font-weight: 700;
}

.system-tools-content {
  min-width: 0;
  padding: 16px 18px;
  overflow-y: auto;
  background: #fff;
}

.system-tools-content > .system-tools-page {
  display: none;
}

.system-tools-content > .system-tools-page.active {
  display: grid;
  gap: 18px;
}

.system-tools-page > .system-tools-panel {
  display: grid;
  gap: 10px;
  padding: 0 0 18px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.system-tools-page > .system-tools-panel:last-child {
  padding-bottom: 0 !important;
  border-bottom: 0 !important;
}

.system-tools-page > .system-tools-panel h3 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.cloud-login-overlay {
  background: #f5f5f7 !important;
}

.cloud-login-card {
  width: min(430px, calc(100vw - 28px)) !important;
  padding: 30px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  box-shadow: 0 22px 60px rgba(29, 29, 31, 0.14) !important;
}

.cloud-login-brand {
  align-items: center;
}

.cloud-login-brand img {
  width: 52px !important;
  height: 52px !important;
  border-radius: 8px !important;
}

.cloud-login-brand h2 {
  font-size: 20px !important;
}

.sidebar-scrim {
  display: none;
}

@media (max-width: 1360px) {
  .dashboard-kpis {
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  }

  .dashboard-kpi:nth-child(n) {
    border-right: 1px solid var(--line) !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .dashboard-kpi:nth-child(-n + 4) {
    grid-column: span 3;
  }

  .dashboard-kpi:nth-child(n + 5) {
    grid-column: span 4;
  }

  .dashboard-kpi:nth-child(4n) {
    border-right: 0 !important;
  }

  .dashboard-kpi:nth-last-child(-n + 3) {
    border-bottom: 0 !important;
  }

  .dashboard-kpi:last-child {
    border-right: 0 !important;
  }

  .dashboard-primary-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
  }

  .dashboard-secondary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

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

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(29, 29, 31, 0.48);
  }

  .sidebar-scrim.open {
    display: block;
  }

  .main {
    margin-left: 0;
  }

  .product-topbar {
    left: 0;
  }

  #systemToolsDialog[open] {
    left: 0 !important;
  }

  #systemToolsDialog > .system-tools-head,
  #systemToolsDialog > .system-tools-body {
    width: min(100% - 28px, 1660px);
  }

  .mobile-nav-button {
    display: inline-flex;
  }

  .main > .topbar,
  .main > #moduleShell,
  .main > #quoteSection,
  .main > #quotePreviewSection,
  .main > #costSection,
  .main > #costPreview {
    width: min(100% - 28px, 1660px);
  }

  .product-topbar {
    padding-right: 14px;
    padding-left: 14px;
  }

  .dashboard-primary-grid {
    grid-template-columns: 1fr;
  }

  .order-browser {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  #ordersTab,
  #orderList,
  .order-table-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .order-archive-tree {
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .order-archive-title,
  .order-archive-year {
    display: none;
  }

  .order-archive-tree-body {
    display: flex;
    gap: 5px;
  }

  .order-archive-item {
    min-width: 138px;
    margin: 0;
  }

  .system-tools-body {
    grid-template-columns: 150px minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .product-company-context span,
  .product-lock-button span,
  .top-status #orderContextStatus {
    display: none;
  }

  .main > .topbar {
    min-height: 74px;
    padding-top: 18px !important;
  }

  .workspace-heading h1 {
    font-size: 23px !important;
  }

  .top-status {
    justify-content: flex-start;
  }

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

  .dashboard-toolbar > .right {
    display: none;
  }

  .dashboard-toolbar > .left {
    width: 100%;
    overflow-x: auto;
  }

  .workbench-overview {
    align-items: stretch;
    flex-direction: column;
  }

  .workbench-statuses {
    width: 100%;
    gap: 12px;
    overflow-x: auto;
  }

  .workbench-overview > button {
    align-self: flex-start;
  }

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

  .dashboard-kpi,
  .dashboard-kpi:nth-child(n) {
    grid-column: auto;
    min-height: 100px;
    border-right: 1px solid var(--line) !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .dashboard-kpi:nth-child(even) {
    border-right: 0 !important;
  }

  .dashboard-kpi:last-child {
    border-bottom: 0 !important;
  }

  .dashboard-trend-panel .trend-chart {
    height: 220px !important;
  }

  .dashboard-composition-panel .cost-composition {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .dashboard-composition-panel .cost-legend {
    width: 100%;
    max-height: 200px;
  }

  .cost-section-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-left: 0;
  }

  .board-usage-bars {
    gap: 12px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .order-list-toolbar {
    align-items: stretch !important;
    flex-direction: column;
  }

  .order-list-toolbar .search-block {
    width: 100%;
    flex-basis: auto;
  }

  .order-filter-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .order-filter-tabs button {
    flex: 0 0 auto;
  }

  .order-list-toolbar .actions {
    width: 100%;
    margin-left: 0;
  }

  #newOrderBtn {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
  }

  #newOrderBtn > span {
    display: inline-block;
    line-height: 1;
  }

  .order-table-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-table-summary small {
    margin-left: 0;
  }

  .system-tools-dialog {
    width: calc(100vw - 16px) !important;
    max-height: 94vh !important;
  }

  #systemToolsDialog[open] {
    width: auto !important;
    max-height: none !important;
    padding-bottom: 24px !important;
  }

  #systemToolsDialog > .system-tools-head {
    min-height: 88px;
    padding-top: 18px !important;
    padding-bottom: 12px !important;
  }

  #systemToolsDialog > .system-tools-head strong {
    font-size: 23px;
  }

  #systemToolsDialog > .system-tools-body {
    min-height: calc(100vh - 168px);
    max-height: none !important;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .system-tools-body {
    min-height: 0;
    max-height: calc(94vh - 60px) !important;
    grid-template-columns: 1fr;
  }

  .system-tools-nav {
    display: flex;
    align-self: start;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .system-tools-nav button {
    width: auto;
    min-width: 100px;
    flex: 0 0 auto;
    text-align: center;
  }

  .system-tools-content {
    padding: 14px;
  }
}

@media print {
  body {
    background: #fff !important;
  }
}

/* Order workspace detail surfaces */
#moduleShell > #orderOverviewTab,
#moduleShell > #quoteTab,
#moduleShell > #paymentTab,
#moduleShell > #costTab,
#moduleShell > #contractTab,
#moduleShell > #orderProfitTab {
  min-width: 0;
}

#moduleShell > #costTab:empty {
  display: none !important;
}

.order-detail-tabs {
  min-width: 0;
  flex-wrap: wrap;
  overflow-x: hidden;
}

.order-detail-tabs > button {
  min-width: 0;
}

.order-overview,
#orderProfitPage,
#costSection,
#paymentTab,
#contractTab {
  min-width: 0;
}

.payment-ledger,
.contract-editor {
  display: grid;
  gap: 0;
  margin-top: 0;
  padding: 0;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: none !important;
  overflow: hidden;
}

.payment-ledger-head,
.contract-editor-head {
  display: flex;
  min-width: 0;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.payment-ledger-title,
.contract-editor-title {
  min-width: 0;
}

.payment-ledger-title h3,
.contract-editor-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.3;
}

.payment-ledger-title .mini,
.contract-editor-title .mini {
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.payment-ledger-head + .payment-ledger-grid {
  border-bottom: 1px solid var(--line);
}

.payment-ledger-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  min-width: 0;
}

.payment-stage {
  min-width: 0;
  padding: 14px 16px 16px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.payment-stage:last-child {
  border-right: 0;
}

.payment-stage-title {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 13px;
}

.payment-stage-title strong {
  font-weight: 700;
}

.payment-stage-title .mini {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}

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

.payment-field {
  min-width: 0;
}

.payment-stage label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.payment-stage input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
}

.payment-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  min-width: 0;
  margin-top: 0;
  background: #f7f9f8;
}

.payment-overview-item {
  min-width: 0;
  padding: 12px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.payment-overview-item:last-child {
  border-right: 0;
}

.payment-overview-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.payment-overview-item strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 16px;
}

.payment-overview-item .payment-state {
  font-size: 14px;
}

.contract-editor {
  gap: 0;
}

.contract-editor-head {
  align-items: center;
}

.contract-editor-head > #contractPdfBtn {
  flex: 0 0 auto;
  min-height: 38px;
  white-space: nowrap;
}

.contract-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  background: #f7f9f8;
}

.contract-summary-strip > div {
  min-width: 0;
  padding: 12px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.contract-summary-strip > div:last-child {
  border-right: 0;
}

.contract-summary-strip span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.contract-summary-strip strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.contract-editor-block {
  min-width: 0;
  margin: 0 16px;
  padding: 18px 0 20px;
  border-top: 1px solid var(--line);
}

.contract-editor-block:first-of-type {
  border-top: 0;
}

.contract-editor-block h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 14px;
}

.contract-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.contract-grid .field {
  min-width: 0;
}

.contract-grid .field input,
.contract-grid .field textarea {
  width: 100%;
  min-width: 0;
}

.contract-signature-grid {
  margin-top: 12px;
}

.contract-textarea {
  resize: vertical;
  line-height: 1.55;
}

.contract-textarea-tall {
  min-height: 120px;
}

.contract-textarea-compact {
  min-height: 90px;
}

.checkbox-field {
  display: flex !important;
  min-height: 36px;
  align-items: center;
  align-self: end;
  justify-content: flex-start;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f9f8;
  cursor: pointer;
}

.checkbox-field span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.contract-grid .checkbox-field input[type="checkbox"] {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  flex: 0 0 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}

@media (max-width: 1024px) {
  .payment-ledger-grid {
    grid-template-columns: 1fr;
  }

  .payment-stage {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .payment-stage:last-child {
    border-bottom: 0;
  }

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

  .contract-summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contract-summary-strip > div:nth-child(3) {
    border-right: 0;
  }

  .contract-summary-strip > div:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

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

  .payment-overview-item:nth-child(2n) {
    border-right: 0;
  }

  .payment-overview-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .main > .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .order-detail-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    overflow-x: visible;
  }

  .order-detail-tabs > button {
    width: 100%;
    justify-content: center;
    padding-right: 8px !important;
    padding-left: 8px !important;
  }

  .payment-ledger-head,
  .contract-editor-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .payment-ledger-head {
    min-height: 0;
  }

  .contract-editor-head > #contractPdfBtn {
    width: 100%;
  }

  .payment-ledger-grid,
  .payment-overview,
  .contract-summary-strip {
    grid-template-columns: 1fr;
  }

  .payment-stage {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .payment-stage:last-child {
    border-bottom: 0;
  }

  .payment-overview-item,
  .contract-summary-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .payment-overview-item:last-child,
  .contract-summary-strip > div:last-child {
    border-bottom: 0;
  }

  .contract-editor-block {
    margin-right: 12px;
    margin-left: 12px;
    padding-top: 16px;
    padding-bottom: 18px;
  }

  .contract-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .contract-grid .span-2,
  .contract-grid .span-4 {
    grid-column: 1;
  }

  .contract-signature-grid {
    margin-top: 10px;
  }

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