:root {
  --ui-field-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #17211f;
  --ink-soft: #59635f;
  --paper: #f4f1ea;
  --surface: #fffdf8;
  --line: #dcd8cf;
  --blue: #3558d4;
  --blue-dark: #2948bd;
  --blue-pale: #e8ecff;
  --coral: #ee765e;
  --amber: #e4a738;
  --green: #4b9a76;
  --shadow: 0 18px 60px rgba(36, 41, 39, 0.09);
  --radius: 18px;
}

/* Moduli Anagrafiche e Contratti */
.address-book-module,
.contracts-module {
  min-width: 0;
}

.compact-module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 10px;
}

.compact-module-tabs .secondary-button {
  min-height: 32px;
  padding: 6px 13px;
}

.compact-module-tabs .secondary-button.active {
  color: #fff;
  border-color: #3158ff;
  background: #3158ff;
}

.address-book-module-section,
.contracts-module-section,
.recurring-services-panel {
  min-width: 0;
}

.address-book-module-section.active,
.contracts-module-section.active,
.recurring-services-panel.active {
  display: block;
}

.recurring-services-placeholder {
  display: grid;
  align-content: center;
  min-height: 180px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, #fffdfa, #f4f7ff);
}

.recurring-services-placeholder .eyebrow { margin: 0 0 4px; }
.recurring-services-placeholder h2 { margin: 0; font-size: 20px; }
.recurring-services-placeholder p:last-child { max-width: 620px; margin: 6px 0 0; color: var(--ink-soft); }

.contacts-workspace {
  display: grid;
  grid-template-columns: minmax(600px, 68%) minmax(300px, 32%);
  gap: 10px;
  min-height: min(680px, calc(100vh - 210px));
}

.supplier-contract-workspace,
.contracts-module-section > .contract-workspace {
  display: grid;
  grid-template-columns: minmax(250px, 30%) minmax(0, 1fr);
  gap: 10px;
  min-height: min(680px, calc(100vh - 210px));
}

.contacts-workspace[hidden],
.supplier-contract-workspace[hidden] {
  display: none;
}

.outlook-conflicts-workspace {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdfa;
}

.outlook-conflicts-workspace[hidden] { display: none; }

.outlook-conflicts-workspace > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.outlook-conflicts-workspace > header h2 { margin: 2px 0; font-size: 1.08rem; }
.outlook-conflicts-workspace > header p { margin: 0; color: var(--ink-soft); font-size: .7rem; }
.outlook-conflicts-workspace > header > div:last-child { display: flex; flex-wrap: wrap; gap: 7px; }

.outlook-conflict-list { display: grid; gap: 8px; margin-top: 11px; }

.outlook-conflict-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 82px;
  padding: 10px;
  border: 1px solid #dedbd3;
  border-radius: 12px;
  background: #fff;
}

.outlook-conflict-card.remote_deleted { border-color: #e9c3bd; background: #fff8f6; }
.outlook-conflict-card.conflict { border-color: #ead297; background: #fffaf0; }
.outlook-conflict-card.error { border-color: #e4b8b1; background: #fff5f2; }
.outlook-conflict-card-icon img { width: 34px; height: 34px; object-fit: contain; }
.outlook-conflict-card.remote_deleted .outlook-conflict-card-icon img { filter: grayscale(1); opacity: .55; }
.outlook-conflict-card-copy { min-width: 0; }
.outlook-conflict-card-copy header { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.outlook-conflict-card-copy header strong { font-size: .75rem; }
.outlook-conflict-card-copy header small { width: 100%; color: var(--ink-soft); font-size: .64rem; }
.outlook-conflict-card-copy > p { margin: 6px 0 0; color: var(--ink-soft); font-size: .67rem; }
.outlook-conflict-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 7px; }
.outlook-conflict-comparison span { min-width: 0; padding: 6px 8px; overflow: hidden; color: #4f5955; background: rgba(255,255,255,.7); border-radius: 8px; font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.outlook-conflict-comparison b { display: block; margin-bottom: 2px; color: #3158d4; font-size: .56rem; }
.outlook-conflict-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 320px; }
.outlook-conflict-card-actions button { min-height: 34px; }

.outlook-conflicts-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 42px 18px;
  color: var(--ink-soft);
  text-align: center;
}

.outlook-conflicts-empty img { width: 42px; height: 42px; object-fit: contain; opacity: .72; }
.outlook-conflicts-empty strong { color: var(--ink); font-size: .8rem; }
.outlook-conflicts-empty span { font-size: .67rem; }

@media (max-width: 800px) {
  .outlook-conflicts-workspace > header,
  .outlook-conflict-card { align-items: stretch; grid-template-columns: 1fr; }
  .outlook-conflict-card-icon { display: none; }
  .outlook-conflict-card-actions { justify-content: flex-start; max-width: none; }
  .outlook-conflict-comparison { grid-template-columns: 1fr; }
}

.contacts-workspace .service-list-tools {
  grid-template-columns: minmax(140px, 1fr) auto auto;
  align-items: center;
}

#directory-contact-list {
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  align-content: start;
  gap: 8px;
  padding: 8px;
}

.directory-contact-viewbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 43px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf6;
}

.directory-contact-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 34px);
  gap: 2px;
  padding: 2px;
  border: 1px solid #d9d6cf;
  border-radius: 10px;
  background: #f0efeb;
}

.directory-contact-view-switch button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 29px;
  padding: 0;
  color: #77807c;
  border: 0;
  border-radius: 7px;
  background: transparent;
}

.directory-contact-view-switch button:hover { color: #3158d4; }
.directory-contact-view-switch button.active { color: #3158d4; background: #fff; box-shadow: 0 1px 4px rgba(38, 55, 88, .12); }
.directory-contact-view-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.company-contact-list:not(.is-list-view) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(205px, 100%), 1fr));
  align-content: start;
  gap: 8px;
  padding: 8px;
}
.company-contact-list.is-list-view { overflow-x: auto; }
.company-contact-list.is-list-view > * { min-width: 720px; }
.company-contact-list .directory-contact-list-head > span {
  color: var(--ink-soft);
  font-size: .56rem;
  font-weight: 900;
  text-transform: uppercase;
}
.address-book-contacts > .directory-contact-view-switch { align-self: flex-end; flex: 0 0 auto; }

.directory-contact-card {
  position: relative;
  align-content: start;
  gap: 6px;
  min-height: 112px;
  padding: 11px 12px;
  border-color: #e0ddd6;
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

:is(#directory-contact-list, .company-contact-list):not(.is-list-view) .directory-contact-card {
  border: 1px solid #d9dfe9;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(38, 55, 88, .035);
}

.directory-contact-card:hover {
  border-color: #aebde9;
  background: #fafbff;
  box-shadow: 0 6px 16px rgba(38, 55, 88, .07);
  transform: translateY(-1px);
}

.directory-contact-card.active {
  border-color: #5273dc;
  background: #f5f7ff;
  box-shadow: 0 0 0 2px rgba(53, 88, 212, .11);
}

.directory-contact-card > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.directory-contact-card > span > strong {
  overflow: hidden;
  color: var(--ink);
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-contact-card > span > i {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: .61rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-contact-card > b { color: var(--blue-dark); font-size: .68rem; }
.directory-contact-card > small { align-self: end; font-size: .61rem; }

:is(#directory-contact-list, .company-contact-list).is-list-view {
  grid-template-columns: 1fr;
  gap: 3px;
}

.directory-contact-list-head,
:is(#directory-contact-list, .company-contact-list).is-list-view .directory-contact-card {
  display: grid;
  grid-template-columns: 18px minmax(0, .55fr) minmax(0, .8fr) minmax(0, .85fr) minmax(0, 1.15fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
}

.directory-contact-list-head {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 27px;
  padding: 0 11px;
  border-bottom: 1px solid #e6e3dc;
  background: #fbfaf6;
}

.directory-contact-list-head button {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 27px;
  padding: 0;
  overflow: hidden;
  color: var(--ink-soft);
  border: 0;
  background: transparent;
  font: 900 .56rem var(--ui-field-font);
  letter-spacing: .05em;
  text-align: left;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.directory-contact-list-head button:hover,
.directory-contact-list-head button.active { color: #3158d4; }

.directory-contact-list-head button span {
  flex: 0 0 auto;
  font-size: .7rem;
  line-height: 1;
}

:is(#directory-contact-list, .company-contact-list).is-list-view .directory-contact-card {
  min-height: 47px;
  padding: 6px 11px;
  border-radius: 9px;
  transform: none;
}

:is(#directory-contact-list, .company-contact-list).is-list-view .directory-contact-list-value {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: .63rem;
  font-style: normal;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(#directory-contact-list, .company-contact-list).is-list-view .directory-contact-list-value.strong { font-weight: 800; }
:is(#directory-contact-list, .company-contact-list).is-list-view .directory-contact-list-value.company { color: var(--blue-dark); font-weight: 700; }
:is(#directory-contact-list, .company-contact-list) .outlook-linked-icon { margin-left: 0; margin-right: 6px; }
:is(#directory-contact-list, .company-contact-list):not(.is-list-view) .directory-contact-card > span { padding-right: 26px; }
:is(#directory-contact-list, .company-contact-list):not(.is-list-view) .directory-contact-card .outlook-linked-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  margin: 0;
}
:is(#directory-contact-list, .company-contact-list).is-list-view .directory-contact-list-outlook-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
:is(#directory-contact-list, .company-contact-list).is-list-view .outlook-linked-icon { width: 12px; height: 12px; margin: 0; vertical-align: 0; }

@media (max-width: 1280px) {
  .contacts-workspace { grid-template-columns: 1fr; }
}

.outlook-contacts-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}

.outlook-contacts-open svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.outlook-contact-link-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: center;
  padding: 6px 9px;
  color: #24634d;
  background: #eaf7f1;
  border: 1px solid #bde1d1;
  border-radius: 999px;
  font-size: .67rem;
  font-weight: 800;
}

.outlook-contact-link-state img { width: 17px; height: 17px; object-fit: contain; }

.outlook-linked-icon {
  display: inline-block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  object-fit: contain;
  vertical-align: -4px;
}

.outlook-linked-icon.remote_deleted { filter: grayscale(1); opacity: .48; }
.outlook-linked-icon.conflict { filter: saturate(.65); outline: 2px solid #e4a738; outline-offset: 1px; border-radius: 4px; }
.address-book-contact-heading > .outlook-linked-icon { margin-right: auto; }

.address-book-outlook-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
  margin-top: 9px;
  padding: 8px;
  border: 1px solid #cfd9f5;
  border-radius: 10px;
  background: #f4f7ff;
}

.address-book-outlook-suggestions > span {
  grid-column: 1 / -1;
  color: #536074;
  font-size: .62rem;
  font-weight: 800;
}

.address-book-outlook-suggestions button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 7px;
  min-width: 0;
  min-height: 42px;
  padding: 6px 8px;
  color: var(--ink);
  text-align: left;
  border: 1px solid #d8def0;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.address-book-outlook-suggestions button:hover { border-color: #7e98e7; background: #fafdff; }
.address-book-outlook-suggestions img { grid-row: 1 / 3; width: 22px; height: 22px; object-fit: contain; }
.address-book-outlook-suggestions strong,
.address-book-outlook-suggestions small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.address-book-outlook-suggestions strong { font-size: .68rem; }
.address-book-outlook-suggestions small { color: var(--ink-soft); font-size: .58rem; }

.outlook-contact-link-state.pending_push,
.outlook-contact-link-state.conflict,
.outlook-contact-link-state.error { color: #865414; background: #fff5dc; border-color: #efd49b; }

.outlook-contacts-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-width: 1120px;
  height: min(780px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
}

.outlook-contacts-shell {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}

.outlook-contacts-dialog .dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.outlook-contacts-dialog .dialog-header h2 { margin: 2px 0; font-size: 1.35rem; }
.outlook-contacts-dialog .dialog-header p:not(.eyebrow) { margin: 0; color: var(--ink-soft); font-size: .78rem; }

.outlook-contacts-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 10px 14px 0;
  padding: 8px 12px;
  border: 1px solid #cbd8d2;
  border-radius: 12px;
  background: #f1f8f4;
  font-size: .75rem;
}

.outlook-contacts-status strong { font-size: .77rem; }
.outlook-contacts-status span { color: var(--ink-soft); }
.outlook-contacts-status.warning { border-color: #ead197; background: #fff7e2; }
.outlook-contacts-status.error { border-color: #ebbbb4; background: #fff0ed; }

.outlook-contacts-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
}

.outlook-contacts-toolbar > input,
.outlook-contacts-toolbar > button { height: 35px; min-height: 35px; }

.outlook-contacts-toolbar > input {
  width: 100%;
  min-width: 0;
  padding: 0 11px;
  color: var(--ink);
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 500 .72rem var(--ui-field-font);
  outline: none;
}

.outlook-contacts-toolbar > input:focus { border-color: #6e87df; box-shadow: 0 0 0 3px rgba(53, 88, 212, .1); }

.outlook-contacts-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 36%) minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  padding: 0 14px 12px;
}

.outlook-contact-list,
.outlook-contact-detail {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdfa;
}

.outlook-contact-list { display: grid; align-content: start; gap: 5px; padding: 7px; }

.outlook-contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  width: 100%;
  min-height: 64px;
  padding: 9px 10px;
  color: var(--ink);
  text-align: left;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
}

.outlook-contact-row:hover { background: #f5f6fb; }
.outlook-contact-row.active { border-color: #9cafea; background: #eef2ff; }
.outlook-contact-row > span:first-child { display: grid; min-width: 0; }
.outlook-contact-row strong,
.outlook-contact-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outlook-contact-row small { color: var(--ink-soft); font-size: .65rem; }

.outlook-sync-badge {
  align-self: center;
  padding: 4px 7px;
  color: #52605b;
  background: #f0f1ef;
  border-radius: 999px;
  font-size: .6rem;
  font-weight: 800;
  white-space: nowrap;
}

.outlook-sync-badge.linked { color: #24634d; background: #e1f3eb; }
.outlook-sync-badge.pending_push { color: #3158b9; background: #e8edff; }
.outlook-sync-badge.conflict,
.outlook-sync-badge.error { color: #914914; background: #ffead5; }

.outlook-contact-detail { padding: 13px; }
.outlook-contact-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.outlook-contact-detail-head > span:first-child { display: grid; gap: 2px; }
.outlook-contact-detail-head small { color: #3158d4; font-size: .61rem; font-weight: 900; letter-spacing: .08em; }
.outlook-contact-detail-head strong { font-size: 1rem; }

.outlook-contact-data { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 10px 0; }
.outlook-contact-data div { min-width: 0; padding: 8px 9px; border-bottom: 1px solid #ebe8e1; }
.outlook-contact-data dt { color: var(--ink-soft); font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.outlook-contact-data dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: .78rem; }

.outlook-association-panel,
.outlook-conflict-panel { margin-top: 12px; padding: 12px; border: 1px solid #d8dce7; border-radius: 13px; background: #f7f8fc; }
.outlook-association-panel h3 { margin: 0 0 9px; font-size: .87rem; }
.outlook-association-panel p,
.outlook-conflict-panel span { display: block; margin: 8px 0; color: var(--ink-soft); font-size: .68rem; }
.outlook-association-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.outlook-association-grid select { height: 35px; min-height: 35px; }
.outlook-association-actions,
.outlook-conflict-panel > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.outlook-association-actions button,
.outlook-conflict-panel button { min-height: 35px; }

.outlook-association-actions .outlook-direction-choice {
  color: #4f5b57;
  border-color: #d8d5ce;
  background: #fffdfa;
  box-shadow: none;
}

.outlook-association-actions .outlook-direction-choice:hover {
  color: #3158d4;
  border-color: #aebde9;
  background: #f7f9ff;
}

.outlook-association-actions .outlook-direction-choice.active {
  color: #fff;
  border-color: #3158d4;
  background: #3158d4;
  box-shadow: 0 4px 12px rgba(49, 88, 212, .2);
}
.outlook-contact-error { padding: 8px 10px; color: #8c352b; border-radius: 9px; background: #fff0ed; font-size: .7rem; }
.outlook-contacts-footer { padding: 9px 14px; }
.outlook-contacts-footer > span:first-child { color: var(--ink-soft); font-size: .67rem; }

@media (max-width: 780px) {
  .contacts-workspace .service-list-tools { grid-template-columns: minmax(0, 1fr) auto; }
  .contacts-workspace .service-list-tools input { grid-column: 1 / -1; }
  .outlook-contacts-workspace { grid-template-columns: 1fr; }
  .outlook-contact-list { max-height: 210px; }
  .outlook-contacts-status { grid-template-columns: 1fr; }
  .outlook-contact-data,
  .outlook-association-grid { grid-template-columns: 1fr; }
}

.directory-contact-grid,
.supplier-contract-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 8px;
  align-content: start;
}

.directory-contact-grid .full,
.supplier-contract-grid .full {
  grid-column: 1 / -1;
}

.directory-contact-outlook-create {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.directory-contact-outlook-create[hidden] { display: none; }

.directory-contact-outlook-create img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.supplier-contract-grid .supplier-contract-party,
.supplier-contract-grid .supplier-contract-title {
  grid-column: span 2;
}

.address-book-module .address-book-management {
  min-height: min(680px, calc(100vh - 210px));
}

@media (max-width: 980px) {
  .contacts-workspace,
  .supplier-contract-workspace,
  .contracts-module-section > .contract-workspace {
    grid-template-columns: 1fr;
  }

  .directory-contact-grid,
  .supplier-contract-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 94% 2%, rgba(53, 88, 212, 0.10), transparent 24rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.test-environment {
  padding-top: 32px;
  box-shadow: inset 0 0 0 4px #b4237a;
}

.test-environment-banner {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10000;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  color: white;
  background: repeating-linear-gradient(135deg, #8c145d 0 14px, #b4237a 14px 28px);
  box-shadow: 0 3px 14px rgba(76, 10, 49, 0.34);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.075em;
  line-height: 1.3;
  text-align: center;
}

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

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

svg.solid-icon {
  fill: currentColor;
  stroke: none;
}

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

[hidden] {
  display: none !important;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0 34px 60px 292px;
  transition: padding-left 180ms ease;
}

.app-shell.sidebar-collapsed {
  padding-left: 118px;
}

.module-sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  width: 248px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  color: #f8faf8;
  background: #14201d;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 18px 0 55px rgba(23, 33, 31, 0.15);
  transition: width 180ms ease;
}

.module-sidebar.is-collapsed {
  width: 74px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 9px;
}

.sidebar-label {
  min-width: 0;
  display: block;
}

.sidebar-label strong,
.sidebar-label small {
  display: block;
}

.sidebar-label strong {
  font-size: 18px;
  font-weight: 820;
  line-height: 1;
}

.sidebar-label small {
  margin-top: 4px;
  color: rgba(248, 250, 248, 0.58);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

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

.sidebar-icon-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: rgba(248, 250, 248, 0.78);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.sidebar-icon-button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

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

.module-sidebar:not(.is-pinned) [data-action="pin-sidebar"] {
  opacity: 0.62;
}

.module-sidebar.is-collapsed .sidebar-label,
.module-sidebar.is-collapsed .module-label,
.module-sidebar.is-collapsed .module-subnav,
.module-sidebar.is-collapsed [data-action="pin-sidebar"] {
  display: none;
}

.module-sidebar.is-collapsed .sidebar-header {
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.module-sidebar.is-collapsed .sidebar-controls {
  position: relative;
  z-index: 2;
  margin-top: 0;
}

.module-sidebar.is-collapsed [data-action="toggle-sidebar"] svg {
  transform: rotate(180deg);
}

.module-nav {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
}

.module-nav-section {
  border-radius: 12px;
}

.module-nav-section.active {
  background: rgba(255, 255, 255, 0.07);
}

.module-nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: rgba(248, 250, 248, 0.74);
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 760;
}

.module-nav-item:hover,
.module-nav-item.active {
  color: white;
  background: rgba(255, 255, 255, 0.11);
}

.module-nav-item svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.module-nav-item .module-nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .74;
}

.module-nav-item:hover .module-nav-icon,
.module-nav-item.active .module-nav-icon {
  opacity: 1;
}

.module-sidebar.is-collapsed .module-nav-item {
  justify-content: center;
  padding: 0;
}

.module-subnav {
  display: none;
  flex-direction: column;
  gap: 3px;
  padding: 0 8px 10px 42px;
}

.module-nav-section.active .module-subnav {
  display: flex;
}

.module-subnav button {
  min-height: 28px;
  padding: 0 9px;
  color: rgba(248, 250, 248, 0.62);
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
}

.module-subnav button:hover,
.module-subnav button.active {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.module-subnav [data-address-book-section="conflicts"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.module-subnav [data-address-book-section="conflicts"] span {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  color: rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

.module-subnav [data-address-book-section="conflicts"].has-conflicts span {
  color: #fff;
  background: #d0614e;
}

.address-book-contacts-subnav > .contacts-parent-entry {
  padding-left: 9px;
  font-size: 12px;
}

.module-subnav > .address-book-contacts-subnav {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.address-book-contacts-subnav > .contacts-child-entry {
  position: relative;
  min-height: 25px;
  margin-left: 9px;
  padding-left: 20px;
  font-size: 11px;
}

.address-book-contacts-subnav > .contacts-child-entry::before {
  content: '';
  position: absolute;
  top: -5px;
  bottom: 50%;
  left: 7px;
  width: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, .2);
  border-left: 1px solid rgba(255, 255, 255, .2);
  border-radius: 0 0 0 5px;
}

.address-book-contacts-subnav.active > .contacts-parent-entry {
  color: #fff;
}

.module-subnav-group {
  display: grid;
  gap: 2px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.module-subnav-group > span {
  padding: 0 9px 2px;
  color: rgba(248, 250, 248, 0.42);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module-subnav-group > button {
  padding-left: 18px;
}

.module-subnav > .module-subnav-group:first-child {
  margin-top: 0;
  padding-top: 2px;
  border-top: 0;
}

.module-subnav[data-subnav="administration"] > .module-subnav-group:first-child {
  margin-top: 7px;
  padding-top: 5px;
}

.module-subnav[data-subnav="administration"] .module-subnav-group > button {
  padding-left: 24px;
}

.module-subnav .crm-quotes-subnav.active > span {
  color: rgba(255, 255, 255, 0.86);
}

.sidebar-order-footer {
  display: flex;
  justify-content: flex-start;
  flex: 0 0 auto;
  min-height: 32px;
}

.sidebar-order-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f8faf8;
  opacity: .5;
  cursor: pointer;
  transition: opacity 140ms ease;
}

.sidebar-order-button:hover { opacity: .78; }
.sidebar-order-button svg { width: 17px; height: 17px; flex: 0 0 auto; }

.module-sidebar.is-collapsed .sidebar-order-button {
  width: 32px;
}

.module-sidebar.sidebar-order-editing .sidebar-order-button {
  opacity: 1;
}

.module-sidebar.sidebar-order-editing .module-nav-section .module-subnav { display: none; }
.module-sidebar.sidebar-order-editing .module-nav-section.sidebar-order-open .module-subnav { display: flex; }
.module-sidebar.sidebar-order-editing .module-nav-section { background: rgba(255, 255, 255, 0.045); }
.module-sidebar.sidebar-order-editing [data-sidebar-sortable="1"] { cursor: grab; }
.module-sidebar.sidebar-order-editing [data-sidebar-sortable="1"]:active { cursor: grabbing; }

.module-sidebar.sidebar-order-editing .module-nav-section,
.module-sidebar.sidebar-order-editing .module-subnav > button,
.module-sidebar.sidebar-order-editing .module-subnav > .module-subnav-group,
.module-sidebar.sidebar-order-editing .module-subnav-group > button {
  position: relative;
  padding-right: 25px;
  outline: 1px dashed rgba(159, 179, 255, 0.24);
  outline-offset: -2px;
}

.module-sidebar.sidebar-order-editing [data-sidebar-sortable="1"]::after {
  content: "⋮⋮";
  position: absolute;
  top: 50%;
  right: 7px;
  color: rgba(215, 224, 255, 0.72);
  font-size: 11px;
  letter-spacing: -3px;
  transform: translateY(-50%) rotate(90deg);
  pointer-events: none;
}

.module-sidebar.sidebar-order-editing .module-subnav-group::after {
  top: 13px;
  transform: rotate(90deg);
}

.module-sidebar .is-sidebar-dragging { opacity: 0.38; }
.module-sidebar .sidebar-drop-before { box-shadow: inset 0 3px 0 #8da7ff; }
.module-sidebar .sidebar-drop-after { box-shadow: inset 0 -3px 0 #8da7ff; }

.module-panel {
  display: block;
}

.module-panel[hidden] {
  display: none;
}

.home-module {
  padding-top: 34px;
}

.home-hero {
  min-height: 190px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 22px;
  align-items: end;
  padding: 34px;
  background: var(--surface);
  border: 1px solid rgba(23, 33, 31, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.home-hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0;
}

.home-user-card {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  color: white;
  background: #14201d;
  border-radius: 8px;
}

.home-user-card span,
.home-user-card small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.home-user-card strong {
  font-size: 24px;
  line-height: 1.05;
}

.module-launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.module-launch-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid rgba(23, 33, 31, 0.1);
  border-radius: 8px;
  text-align: left;
  box-shadow: 0 12px 34px rgba(36, 41, 39, 0.06);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.module-launch-card:hover,
.module-launch-card:focus-visible {
  transform: translateY(-2px);
  border-color: #b6c2f2;
  box-shadow: 0 18px 42px rgba(36, 41, 39, 0.1);
  outline: 0;
}

.module-launch-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 8px;
}

.module-launch-icon > svg,
.module-launch-icon > img {
  width: 24px;
  height: 24px;
}

.module-launch-icon > img {
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.module-launch-card.blue .module-launch-icon {
  background: var(--blue);
}

.module-launch-card.green .module-launch-icon {
  background: var(--green);
}

.module-launch-card.amber .module-launch-icon {
  background: var(--amber);
}

.module-launch-card.coral .module-launch-icon {
  background: var(--coral);
}

.module-launch-card.slate .module-launch-icon {
  background: #34423d;
}

.module-launch-card.violet .module-launch-icon {
  background: #7254b5;
}

.module-launch-card.teal .module-launch-icon {
  background: #19786f;
}

.module-launch-card.burgundy .module-launch-icon {
  background: #a54262;
}

.module-launch-card.cyan .module-launch-icon {
  background: #2a7394;
}

.module-launch-card.indigo .module-launch-icon {
  background: #4f56a6;
}

.monitor-module {
  display: grid;
  align-content: start;
  gap: 16px;
}

.monitor-heading {
  margin-bottom: 0;
}

.monitor-live-badge {
  color: #176548;
  background: #e7f5ee;
  border-color: #afd9c6;
}

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

.monitor-summary-card {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(36, 41, 39, .05);
}

.monitor-summary-card > span,
.monitor-summary-card > small {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 780;
}

.monitor-summary-card > span {
  letter-spacing: .07em;
  text-transform: uppercase;
}

.monitor-summary-card > strong {
  color: var(--ink);
  font-size: 25px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.monitor-summary-card.emphasis {
  background: #f2f4ff;
  border-color: #cbd1f1;
}

.monitor-summary-card.emphasis > strong {
  color: #3f4a9a;
}

.monitor-timer-panel {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 12px 34px rgba(36, 41, 39, .055);
}

.monitor-timer-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  background: #f7f8fc;
  border-bottom: 1px solid var(--line);
}

.monitor-timer-head strong,
.monitor-timer-head small {
  display: block;
}

.monitor-timer-head strong {
  font-size: 13px;
}

.monitor-timer-head small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.monitor-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #176548;
  font-size: 9px;
  font-weight: 820;
  white-space: nowrap;
}

.monitor-live-indicator i {
  width: 8px;
  height: 8px;
  background: #2da66f;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(45, 166, 111, .13);
  animation: monitor-live-pulse 1.8s ease-in-out infinite;
}

@keyframes monitor-live-pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.monitor-timer-list {
  min-width: 0;
  display: grid;
}

.monitor-timer-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(135px, .75fr) minmax(260px, 1.8fr) minmax(145px, .75fr) minmax(165px, .85fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid #ebe9e3;
}

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

.monitor-timer-row:hover {
  background: #fcfcfa;
}

.monitor-user-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #4f56a6;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
}

.monitor-user-copy,
.monitor-task-copy,
.monitor-start-copy,
.monitor-elapsed-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.monitor-user-copy strong,
.monitor-task-copy strong,
.monitor-start-copy strong,
.monitor-elapsed-copy strong,
.monitor-user-copy small,
.monitor-task-copy small,
.monitor-task-copy em,
.monitor-start-copy small,
.monitor-elapsed-copy small,
.monitor-elapsed-copy em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-user-copy strong,
.monitor-task-copy strong {
  font-size: 11px;
}

.monitor-user-copy small,
.monitor-task-copy small,
.monitor-start-copy small,
.monitor-elapsed-copy small {
  color: var(--ink-soft);
  font-size: 8px;
  font-style: normal;
  font-weight: 780;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.monitor-task-copy em {
  color: var(--ink-soft);
  font-size: 9px;
  font-style: normal;
}

.monitor-start-copy strong {
  font-size: 10px;
  font-weight: 760;
}

.monitor-elapsed-copy strong {
  color: #176548;
  font-size: 17px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.monitor-elapsed-copy em {
  width: max-content;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 8px;
  font-style: normal;
  font-weight: 820;
}

.monitor-elapsed-copy em.included {
  color: #247052;
  background: #e8f5ee;
}

.monitor-elapsed-copy em.extra {
  color: #8a5617;
  background: #fff2d8;
}

.monitor-open-button {
  box-sizing: border-box;
  min-height: 35px;
  height: 35px;
  padding: 0 11px;
  border-radius: 9px;
  white-space: nowrap;
}

.monitor-readonly-note {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 780;
  white-space: nowrap;
}

.monitor-empty {
  min-height: 230px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 28px;
  color: var(--ink-soft);
  text-align: center;
}

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

.monitor-empty small {
  font-size: 10px;
}

.monitor-empty-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #176548;
  background: #e5f4ec;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .monitor-timer-row {
    grid-template-columns: 42px minmax(130px, .8fr) minmax(240px, 1.5fr) minmax(155px, .8fr) auto;
  }

  .monitor-start-copy {
    display: none;
  }
}

@media (max-width: 820px) {
  .monitor-summary-grid {
    grid-template-columns: 1fr;
  }

  .monitor-timer-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: start;
  }

  .monitor-task-copy,
  .monitor-elapsed-copy {
    grid-column: 2 / -1;
  }

  .monitor-open-button,
  .monitor-readonly-note {
    grid-column: 2 / -1;
    justify-self: start;
  }
}

.module-launch-copy {
  min-width: 0;
  flex: 1;
  display: block;
}

.module-launch-copy small,
.module-launch-copy strong,
.module-launch-copy span {
  display: block;
}

.module-launch-copy small {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.module-launch-copy strong {
  margin-top: 9px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.module-launch-copy span {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.module-launch-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  align-self: stretch;
}

.module-launch-stats i {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--ink-soft);
  background: #f4f2ec;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 10px;
  font-style: normal;
  font-weight: 760;
}

.topbar {
  position: relative;
  min-height: 82px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(23, 33, 31, 0.11);
}

.brand {
  width: max-content;
  min-width: 0;
  flex: 1 1 170px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 8px;
}

.brand-copy {
  display: block;
}

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

.brand-copy strong {
  font-size: 21px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.035em;
  line-height: 1;
  text-transform: uppercase;
}

.environment-badge {
  padding: 4px 7px;
  color: #fff;
  background: #b24b3c;
  border-radius: 999px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
}

.view-switcher {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
  background: rgba(255, 253, 248, 0.68);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.view-button {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 680;
}

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

.view-button.active {
  color: var(--surface);
  background: var(--ink);
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 720;
  transition: 160ms ease;
}

.primary-button {
  color: white;
  background: var(--blue);
  border: 1px solid var(--blue);
  box-shadow: 0 8px 22px rgba(53, 88, 212, 0.2);
}

.primary-button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.primary-button.compact {
  justify-self: end;
}

.topbar-actions {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-corporate-logo {
  position: static;
  flex: 0 1 142px;
  width: 142px;
  max-width: 16vw;
  height: auto;
  display: block;
}

.action-bell {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: 180ms ease;
}

.active-timer-button {
  position: relative;
  min-width: 116px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 12px 5px 9px;
  color: #07543d;
  background: #e5f8f0;
  border: 1px solid #8bd0b8;
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(15, 110, 79, .12);
  transition: 180ms ease;
}

.active-timer-button.is-claimed-task {
  max-width: min(320px, 34vw);
  color: #274c91;
  background: #edf3ff;
  border-color: #a9bfe9;
  box-shadow: 0 8px 18px rgba(49, 82, 145, .12);
}

.active-timer-button.is-claimed-task:hover {
  color: #fff;
  background: #315baf;
  border-color: #315baf;
}

.active-timer-button.is-claimed-task .active-timer-copy strong {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-timer-button:hover {
  color: #fff;
  background: #157a5b;
  border-color: #157a5b;
  transform: translateY(-1px);
}

.active-timer-button:focus-visible {
  outline: 3px solid rgba(21, 122, 91, .28);
  outline-offset: 2px;
}

.active-timer-button > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke-width: 1.9;
}

.active-timer-copy {
  display: grid;
  justify-items: start;
  gap: 1px;
  line-height: 1;
}

.active-timer-copy small {
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.active-timer-copy strong {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.active-timer-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  color: #07543d;
  background: #fff;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.action-bell svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-bell.has-actions {
  color: white;
  box-shadow: 0 12px 24px rgba(32, 38, 36, 0.15);
}

.action-bell.personal {
  background: #e23636;
  border-color: #e23636;
}
.action-card.technical-action-personal { border-left:4px solid #e23636; }
.action-card.technical-action-group { border-left:4px solid #f09a25; }

.action-bell.group {
  background: #f09a25;
  border-color: #f09a25;
}

.action-bell span {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  color: #e23636;
  background: white;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.action-bell.shake svg {
  transform-origin: 50% 0;
  animation: action-bell-shake 30s ease-in-out infinite;
}

@keyframes action-bell-shake {
  0%, 94%, 100% { transform: rotate(0deg); }
  95% { transform: rotate(-13deg); }
  96% { transform: rotate(11deg); }
  97% { transform: rotate(-9deg); }
  98% { transform: rotate(7deg); }
  99% { transform: rotate(-4deg); }
}

.account-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 6px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  text-align: left;
}

.account-button:hover {
  background: white;
  border-color: #aaa69d;
}

.account-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--ink);
  border-radius: 9px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
}

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

.account-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.account-name-line #account-name {
  min-width: 0;
}

.account-microsoft-badge {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  display: inline-grid;
  place-items: center;
  background: white;
  border-radius: 6px;
  overflow: hidden;
}

.account-microsoft-badge[hidden] {
  display: none !important;
}

.account-microsoft-badge img {
  width: 21px;
  height: 21px;
  object-fit: contain;
}

.account-copy strong {
  font-size: 10px;
}

.account-copy small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
}

.primary-button svg,
.secondary-button svg {
  width: 17px;
  height: 17px;
}

.secondary-button,
.icon-button {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.secondary-button:hover,
.icon-button:hover {
  border-color: #aaa69d;
  background: white;
}

.danger-button {
  color: #b94736;
  background: #fff4f1;
  border: 1px solid #f3c7bf;
}

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

.intro {
  min-height: 320px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: end;
  gap: 60px;
  padding: 62px 0 50px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 760px;
  margin: 0;
  color: #2f5bff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(58px, 6vw, 92px);
  font-style: italic;
  font-weight: 850;
  letter-spacing: -0.065em;
  line-height: 0.9;
  white-space: nowrap;
  transform: scaleX(1.08);
  transform-origin: left center;
}

.intro h1 em {
  color: var(--blue);
  font-weight: 400;
}

.intro-copy {
  margin: 21px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}

.summary-card {
  min-height: 166px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-align: left;
  transition: 160ms ease;
}

.summary-card:hover {
  border-color: #aaa69d;
  box-shadow: 0 14px 32px rgba(32, 38, 36, 0.1);
  transform: translateY(-2px);
}

.summary-card:focus-visible {
  outline: 3px solid rgba(53, 88, 212, 0.25);
  outline-offset: 3px;
}

.summary-card.accent-card {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 16px 40px rgba(53, 88, 212, 0.2);
}

.summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.accent-card .summary-top {
  color: rgba(255, 255, 255, 0.77);
}

.summary-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-pale);
  border-radius: 9px;
}

.summary-icon svg {
  width: 16px;
  height: 16px;
}

.accent-card .summary-icon {
  color: white;
  background: rgba(255, 255, 255, 0.16);
}

.summary-icon.warm {
  color: #a16a08;
  background: #fff0ca;
}

.summary-icon.green {
  color: #257150;
  background: #dff2e9;
}

.summary-card strong {
  margin-top: auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
}

.summary-card small {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 11px;
}

.accent-card small {
  color: rgba(255, 255, 255, 0.7);
}

.active-work-panel {
  scroll-margin-top: 24px;
  margin: 0 0 18px;
  padding: 18px;
  color: white;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(135deg, #1130b8 0%, #3158ff 54%, #ee765e 100%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 25px;
  box-shadow: 0 24px 56px rgba(49, 88, 255, 0.28);
}

.active-work-panel[hidden] {
  display: none;
}

.active-work-card {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 0.9fr);
  align-items: end;
  gap: 20px;
}

.active-work-card.is-blocked {
  background: rgba(24, 31, 54, 0.12);
  border-radius: 19px;
}

.active-work-kicker {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.active-work-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.active-work-title-row h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.035em;
}

.active-work-pulse {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  background: #72ffbd;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  box-shadow: 0 0 0 8px rgba(114, 255, 189, 0.18);
  animation: active-work-pulse 1.8s ease-in-out infinite;
}

@keyframes active-work-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 8px rgba(114, 255, 189, 0.18); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 14px rgba(114, 255, 189, 0.05); }
}

.active-work-copy > p:not(.active-work-kicker) {
  max-width: 760px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  line-height: 1.5;
}

.active-work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.active-work-meta > span {
  display: inline-flex;
  gap: 5px;
  padding: 7px 10px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 11px;
}

.active-work-meta > span strong {
  color: white;
}

.active-work-controls {
  padding: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 18px;
  box-shadow: 0 18px 34px rgba(16, 26, 82, 0.16);
}

.active-work-comment {
  margin: 0;
}

.active-work-comment span {
  color: var(--ink-soft);
}

.active-work-comment span strong {
  color: #244fae;
}

.active-work-comment textarea {
  min-height: 92px;
  border-color: rgba(49, 88, 255, 0.28);
  resize: vertical;
}

.active-work-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
}

.active-work-actions .primary-button {
  background: #071a55;
  border-color: #071a55;
  box-shadow: 0 10px 24px rgba(7, 26, 85, 0.24);
}

.active-work-actions .secondary-button {
  background: white;
}

.active-work-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.active-work-open {
  margin-left: auto;
}

.active-work-hint {
  display: block;
  margin-top: 9px;
  color: #7b4d12;
  font-size: 11px;
  font-weight: 780;
}

.active-work-controls-compact {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 13px;
}

.active-work-controls-compact p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.workspace {
  padding: 30px;
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.module-heading {
  min-height: 132px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 0 24px;
}

.module-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: 48px;
  font-weight: 820;
  line-height: 0.98;
}

.module-heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.solution-architect-module {
  min-width: 0;
}

.solution-architect-heading {
  margin-bottom: 14px;
}

.solution-project-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 210px 190px;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .68);
}

.solution-project-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  min-height: 620px;
}

.solution-project-workspace.is-list-collapsed {
  grid-template-columns: 48px minmax(0, 1fr);
}

.solution-project-list-panel,
.solution-project-detail {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 14px 32px rgba(44, 52, 72, .07);
}

.solution-project-detail { container-type: inline-size; }

.solution-project-list-panel {
  padding: 8px;
  overflow: hidden;
}

.solution-project-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 3px 9px 6px;
}

.solution-project-list-head > span {
  display: grid;
  gap: 1px;
}

.solution-project-list-head small {
  color: var(--muted);
  font-size: 10px;
}

.solution-project-workspace.is-list-collapsed .solution-project-list-panel {
  padding: 8px;
}

.solution-project-workspace.is-list-collapsed .solution-project-list-head {
  justify-content: center;
  padding: 3px 0;
}

.solution-project-workspace.is-list-collapsed .solution-project-list-head > span,
.solution-project-workspace.is-list-collapsed .solution-project-list {
  display: none;
}

.solution-project-workspace.is-list-collapsed .solution-project-list-collapse svg,
.solution-project-workspace.is-list-collapsed .opportunity-list-collapse svg {
  transform: rotate(180deg);
}

.solution-project-list {
  display: grid;
  gap: 7px;
  max-height: 720px;
  overflow: auto;
  padding-right: 3px;
}

.solution-project-row {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: #f8f9fc;
  color: var(--ink);
  text-align: left;
}

.solution-project-row:hover,
.solution-project-row.active {
  border-color: #9cacec;
  background: #f1f4ff;
}

.solution-project-row-heading,
.solution-project-detail-head,
.solution-section-heading,
.solution-quote-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.solution-project-row-heading strong {
  min-width: 0;
  line-height: 1.25;
}

.solution-project-row > span:not(.solution-project-row-heading),
.solution-project-row small {
  color: var(--muted);
  font-size: .78rem;
}

.technical-status-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #cbd0da;
  border-radius: 999px;
  background: #f2f3f5;
  color: #59616d;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.technical-status-badge.status-analyzing { border-color: #e6bd63; background: #fff6dc; color: #8a5b05; }
.technical-status-badge.status-integration_required { border-color: #ef9b55; background: #fff0e3; color: #9b4811; }
.technical-status-badge.status-validated { border-color: #77be98; background: #e9f8ef; color: #17673b; }

.solution-project-detail {
  padding: 18px;
  overflow: auto;
}

.solution-project-detail-head h2 {
  margin: 2px 0 5px;
}

.solution-project-detail-head p,
.solution-project-description {
  margin: 0;
  color: var(--muted);
}

.solution-quote-context {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 420px) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d9def0;
  border-radius: 13px;
  background: linear-gradient(135deg, #f4f6ff, #fbfaf7);
}

.solution-quote-context.empty {
  grid-template-columns: minmax(0, 1fr);
}

.solution-quote-context-label,
.solution-quote-context label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.solution-quote-context-label small,
.solution-quote-context label > span,
.solution-rejected-quotes {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.solution-quote-context-label strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.solution-quote-context select {
  width: 100%;
  height: 34px;
  padding: 5px 30px 5px 9px;
  border: 1px solid #cdd4e8;
  border-radius: 9px;
  background-color: white;
}

.solution-rejected-quotes {
  align-self: center;
  max-width: 130px;
  color: #9a514a;
  text-align: right;
}

.solution-project-description {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f7f8;
}

.solution-project-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin: 14px 0 10px;
}

.solution-project-metrics > span {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 11px;
  background: #f4f6fb;
}

.solution-project-metrics small { color: var(--muted); font-size: .7rem; }

.solution-validation-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.solution-validation-strip span {
  padding: 5px 8px;
  border-radius: 9px;
  font-size: .72rem;
  font-weight: 700;
}

.solution-validation-strip .valid { background: #eaf7ef; color: #246a42; }
.solution-validation-strip .warning { background: #fff0df; color: #9b4b16; }

.solution-review-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-items: end;
  padding: 12px;
  border: 1px solid #dce1ee;
  border-radius: 14px;
  background: #f8f9fd;
}

.solution-review-form > button { justify-self: end; }
.solution-review-detail textarea { min-height: 58px; resize: vertical; }

.solution-project-head-actions,
.opportunity-detail-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.project-brief-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #f8f9fd;
  border: 1px solid #dfe3ee;
  border-radius: 12px;
}

.commercial-brief-panel { border-left: 3px solid #d68a28; }
.technical-brief-readonly { border-left: 3px solid #4969cc; }

.project-assignment-panel {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  background: linear-gradient(135deg, #f7f8fd, #fffdfa);
  border: 1px solid #d8ddec;
  border-left: 3px solid #526ed0;
  border-radius: 11px;
}

.project-assignment-heading > span {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.project-assignment-heading strong { font-size: 12px; }
.project-assignment-heading small { color: var(--muted); font-size: 9px; }

.project-assignment-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.project-assignment-fields label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.project-assignment-fields label > span {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.project-assignment-fields select,
.project-assignment-fields output {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
}

.project-assignment-fields output {
  display: flex;
  align-items: center;
  background: #f2f4fa;
  font-weight: 750;
}

.project-assignment-fields select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(53, 88, 212, .09);
  outline: 0;
}

.project-brief-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-brief-heading > div { display: grid; gap: 1px; }
.project-brief-heading strong { font-size: 12px; }
.project-brief-heading small { color: var(--muted); font-size: 9px; }

.project-brief-grid,
.project-brief-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.project-brief-grid textarea {
  min-height: 52px;
  resize: vertical;
}

.project-brief-readonly-grid > div {
  min-width: 0;
  padding: 7px 8px;
  background: rgba(255, 255, 255, .8);
  border: 1px solid #e3e6ed;
  border-radius: 8px;
}

.project-brief-readonly-grid span {
  color: #69738a;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.project-brief-readonly-grid p {
  max-height: 92px;
  overflow: auto;
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.solution-commercial-brief { margin-top: 8px; }
.project-detail-brief-grid { margin: 10px 0; }

.solution-project-section {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.solution-section-heading { align-items: center; margin-bottom: 9px; }
.solution-section-heading > div { display: grid; gap: 2px; }
.solution-section-heading small { color: var(--muted); }

.solution-workflow-list,
.solution-material-list {
  display: grid;
  gap: 5px;
}

.solution-workflow-row,
.solution-material-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid #e1e4eb;
  border-radius: 10px;
  background: #fff;
}

.solution-workflow-row > span:nth-child(2),
.solution-material-row > span:first-child,
.solution-quote-heading > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.solution-workflow-row small,
.solution-material-row small,
.solution-quote-heading small { color: var(--muted); }

.solution-workflow-index {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #e9edff;
  color: #3158c9;
  font-weight: 800;
}

.solution-quote-block + .solution-quote-block { margin-top: 10px; }
.solution-quote-heading { align-items: center; margin-bottom: 6px; padding: 0 3px; }
.solution-material-row { grid-template-columns: minmax(0, 1fr) 80px minmax(120px, 180px); }
.solution-material-row.component { margin-left: 18px; background: #fafafa; }

.solution-ai-section {
  padding: 13px;
  border: 1px solid #d8def3;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(244, 247, 255, .92), rgba(252, 250, 246, .94));
}

.solution-ai-heading-actions,
.solution-ai-proposal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.solution-ai-provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.solution-ai-mode-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.solution-ai-mode-control select {
  width: 126px;
  height: 30px;
  padding: 4px 28px 4px 9px;
  border: 1px solid #d6dbea;
  border-radius: 9px;
  background-color: rgba(255, 255, 255, .9);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.solution-ai-provider-badge img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.ai-processing-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  margin: 0 0 9px;
  padding: 7px 10px;
  border: 1px solid #aebdf2;
  border-radius: 10px;
  color: #233f9d;
  background: linear-gradient(90deg, #eef2ff, #f8f5ff, #eef7ff);
  background-size: 220% 100%;
  animation: ai-processing-sheen 1.8s ease-in-out infinite;
}

.ai-processing-status > span:last-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.ai-processing-status strong { font-size: 12px; }
.ai-processing-status small { color: #53638e; font-size: 10px; }

.ai-processing-spinner,
.ai-button-spinner {
  display: inline-block;
  flex: 0 0 auto;
  border: 2px solid rgba(49, 88, 201, .22);
  border-top-color: #3158c9;
  border-radius: 50%;
  animation: ai-processing-spin .72s linear infinite;
}

.ai-processing-spinner {
  width: 20px;
  height: 20px;
}

.ai-button-spinner {
  width: 12px;
  height: 12px;
  border-color: rgba(255, 255, 255, .38);
  border-top-color: currentColor;
}

.secondary-button .ai-button-spinner {
  border-color: rgba(49, 88, 201, .2);
  border-top-color: currentColor;
}

.ai-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

@keyframes ai-processing-spin { to { transform: rotate(360deg); } }
@keyframes ai-processing-sheen {
  0%, 100% { background-position: 0 50%; }
  50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-processing-status,
  .ai-processing-spinner,
  .ai-button-spinner { animation-duration: 2.5s; }
}

.solution-ai-provider-notice {
  margin: -2px 0 9px;
  padding: 7px 10px;
  border: 1px solid #efc86e;
  border-radius: 9px;
  color: #76530a;
  background: #fff7df;
  font-size: 12px;
}

.solution-ai-layout {
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(390px, 1.15fr);
  gap: 11px;
}

.solution-ai-layout > div,
.solution-ai-proposal {
  min-width: 0;
}

.solution-ai-empty {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dce2f4;
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
}

.solution-ai-empty p,
.solution-ai-message p,
.solution-ai-missing span {
  margin: 2px 0 0;
  color: var(--muted);
}

.solution-ai-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #3158d4;
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
  box-shadow: 0 5px 12px rgba(49, 88, 212, .24);
}

.solution-ai-profile,
.solution-ai-chat,
.solution-ai-proposal {
  padding: 10px;
  border: 1px solid #dde2ef;
  border-radius: 12px;
  background: rgba(255, 255, 255, .84);
}

.solution-ai-classification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.solution-ai-classification > span:first-child {
  display: grid;
  gap: 2px;
}

.solution-ai-classification small,
.solution-ai-component-summary,
.solution-ai-proposal-heading small,
.solution-ai-proposal-row small {
  color: var(--muted);
  font-size: .7rem;
}

.solution-ai-confidence {
  display: grid;
  min-width: 58px;
  padding: 5px 7px;
  border-radius: 9px;
  background: #edf1ff;
  color: #3158b9;
  text-align: center;
}

.solution-ai-facts,
.solution-ai-component-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.solution-ai-facts span {
  padding: 4px 7px;
  border: 1px solid #cbd5f4;
  border-radius: 999px;
  background: #f5f7ff;
  color: #3b568e;
  font-size: .68rem;
  font-weight: 750;
}

.solution-ai-component-summary span {
  padding-right: 7px;
  border-right: 1px solid #dfe2e9;
}

.solution-ai-missing {
  display: grid;
  gap: 4px;
  margin-top: 9px;
  padding: 8px 9px;
  border-radius: 9px;
  background: #fff5df;
  color: #815313;
  font-size: .73rem;
}

.solution-ai-chat {
  margin-top: 8px;
}

.solution-ai-messages {
  display: grid;
  gap: 6px;
  max-height: 210px;
  overflow: auto;
  padding-right: 2px;
}

.solution-ai-message {
  max-width: 92%;
  padding: 7px 9px;
  border-radius: 10px;
  background: #f1f3f7;
  font-size: .76rem;
}

.solution-ai-message.user {
  justify-self: end;
  background: #eaf0ff;
}

.solution-ai-message > span {
  color: #526078;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.solution-ai-message p {
  color: var(--ink);
  white-space: pre-wrap;
}

.solution-ai-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: end;
  margin-top: 8px;
}

.solution-ai-chat-form textarea {
  min-height: 52px;
  resize: vertical;
}

.solution-ai-proposal-heading > span:first-child {
  display: grid;
  gap: 2px;
}

.solution-ai-proposal-list {
  display: grid;
  gap: 5px;
  max-height: 390px;
  overflow: auto;
  margin-top: 8px;
}

.solution-ai-proposal-row {
  display: grid;
  grid-template-columns: auto 25px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 7px;
  border: 1px solid #e2e5ec;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.solution-ai-proposal-row > span:nth-child(3) {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.solution-ai-proposal-row input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.solution-ai-apply {
  width: 100%;
  margin-top: 8px;
}

.microsoft-settings-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, .8fr);
  gap: 14px;
  align-items: start;
}

.microsoft-settings-layout .business-form {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
}

.microsoft-capability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.microsoft-capability-list span {
  padding: 5px 8px;
  border: 1px solid #cfd9f2;
  border-radius: 999px;
  background: #f2f6ff;
  color: #38568e;
  font-size: .72rem;
  font-weight: 750;
}

.microsoft-connected-account {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border-radius: 11px;
  background: #edf8f1;
}

.microsoft-connected-account > span:last-child {
  display: grid;
  gap: 2px;
}

.microsoft-connected-account small { color: var(--muted); }

.microsoft-permission-note {
  padding: 9px 10px;
  border-radius: 10px;
  background: #f6f6f7;
  color: var(--muted);
  font-size: .74rem;
}

.microsoft-permission-note p { margin: 3px 0 0; }
.microsoft-connect-link { justify-content: center; text-decoration: none; }

#crm-project-form[data-solution-architect="true"] label:has(#crm-project-name),
#crm-project-form[data-solution-architect="true"] label:has(#crm-project-description),
#crm-project-form[data-solution-architect="true"] .commercial-brief-panel,
#crm-project-form[data-solution-architect="true"] .technical-brief-readonly,
#crm-project-form[data-solution-architect="true"] label:has(#crm-project-status),
#crm-project-form[data-solution-architect="true"] label:has(#crm-project-opportunity),
#crm-project-form[data-solution-architect="true"] label:has(#crm-project-address-book),
#crm-project-form[data-solution-architect="true"] label:has(#crm-project-importance),
#crm-project-form[data-solution-architect="true"] label:has(#crm-project-urgency),
#crm-project-form[data-solution-architect="true"] label:has(#crm-project-expected-close-date),
#crm-project-form[data-solution-architect="true"] .project-value-field,
#crm-project-form[data-solution-architect="true"] .crm-work-hour-summary,
#crm-project-form[data-solution-architect="true"] [data-action="reset-project-form"],
#crm-project-form[data-solution-architect="true"] .project-workflow-heading,
#crm-project-form[data-solution-architect="true"] #crm-project-conversion-panel {
  display: none !important;
}

#crm-project-form:not([data-solution-architect="true"]) .project-solution-association-panel {
  display: none !important;
}

.project-solution-association-panel {
  display: grid;
  gap: 7px;
  margin: 0 0 10px;
  padding: 9px;
  border: 1px solid #dbe3f1;
  border-radius: 12px;
  background: #f7f9fd;
}

.project-solution-association-panel[hidden] { display: none !important; }

.project-solution-association-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-solution-association-head > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.project-solution-association-head strong { font-size: .82rem; }
.project-solution-association-head small { color: var(--muted); font-size: .68rem; }

.project-solution-association-list {
  display: grid;
  gap: 4px;
}

.project-solution-association-row {
  display: grid;
  grid-template-columns: 112px minmax(180px, 1fr) 68px 28px;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 34px;
  padding: 4px 7px;
  border: 1px solid #e0e5ee;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: default;
}

.project-solution-association-row:has(.project-solution-association-copy > button:hover) { border-color: #94a9df; }
.project-solution-association-row.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(47, 86, 197, .12);
}
.project-solution-association-row.parent { border-left: 3px solid var(--blue); }
.project-solution-association-row.component {
  width: calc(100% - 16px);
  min-height: 30px;
  margin-left: 16px;
  background: #fbfcfe;
  cursor: default;
  opacity: 1;
}

.project-solution-association-copy > button {
  width: 100%;
  padding: 0;
  overflow: hidden;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.project-solution-association-code,
.project-solution-association-quantity {
  overflow: hidden;
  font-size: .72rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-solution-association-quantity { text-align: right; }

.project-solution-association-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.project-solution-association-copy strong {
  overflow: hidden;
  font-size: .75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-solution-association-copy small {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: .58rem;
  font-weight: 800;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .solution-project-workspace { grid-template-columns: 300px minmax(0, 1fr); }
  .solution-review-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .solution-review-notes { grid-column: 1 / -1; }
  .solution-project-metrics { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .solution-ai-layout { grid-template-columns: 1fr; }
  .microsoft-settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .solution-project-toolbar,
  .solution-project-workspace { grid-template-columns: 1fr; }
  .solution-project-workspace.is-list-collapsed { grid-template-columns: 1fr; }
  .solution-project-workspace.is-list-collapsed .solution-project-list-panel { width: 48px; }
  .solution-quote-context { grid-template-columns: 1fr; align-items: stretch; }
  .solution-rejected-quotes { max-width: none; text-align: left; }
  .solution-project-list { max-height: 320px; }
  .solution-review-form { grid-template-columns: 1fr; }
  .solution-review-notes { grid-column: auto; }
  .solution-material-row { grid-template-columns: minmax(0, 1fr) auto; }
  .solution-material-row > span:last-child { grid-column: 1 / -1; }
  .solution-ai-empty { grid-template-columns: 38px minmax(0, 1fr); }
  .solution-ai-empty button { grid-column: 1 / -1; }
  .solution-ai-chat-form { grid-template-columns: 1fr; }
}

.business-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.business-summary-card {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.business-summary-card span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.business-summary-card strong {
  font-size: 26px;
  line-height: 1;
}

.crm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.crm-tab {
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 760;
}

.crm-tab.active {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.crm-tab-group {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
}

.crm-tab-group > span {
  padding: 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.crm-tab-group .crm-tab {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.crm-tab-group .crm-tab.active {
  color: white;
  background: var(--ink);
}

.crm-tab-group.active {
  border-color: #bdc5d0;
}

.crm-section[hidden] {
  display: none;
}

.business-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(420px, 1.14fr);
  gap: 16px;
  align-items: start;
}

.business-layout.single-panel {
  grid-template-columns: minmax(0, 1fr);
}

.business-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.opportunity-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(560px, 1.28fr);
  gap: 16px;
  align-items: start;
}

.opportunity-board-shell {
  display: grid;
  gap: 14px;
}

.opportunity-board-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.opportunity-board-toolbar .panel-heading {
  margin: 0;
}

.opportunity-board-toolbar .opportunity-filters {
  grid-template-columns: minmax(220px, 1.4fr) minmax(140px, 0.8fr) minmax(180px, 1fr) auto;
  align-items: end;
  margin: 0;
}

.opportunity-board-toolbar .opportunity-filters .field:first-child,
.opportunity-board-toolbar .opportunity-filters .secondary-button {
  grid-column: auto;
}

.opportunity-filter-actions,
.opportunity-view-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}

.opportunity-filter-actions {
  justify-content: flex-end;
}

.opportunity-view-switch {
  padding: 3px;
  background: #f0eee7;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.opportunity-view-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 5px;
}

.opportunity-view-button:hover,
.opportunity-view-button.active {
  color: var(--blue);
  background: white;
  box-shadow: 0 1px 4px rgba(36, 41, 39, 0.12);
}

.opportunity-view-button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.opportunity-main-list-panel {
  display: contents;
}

.opportunity-main-list-head {
  display: none;
}

.opportunity-view-area.is-split {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(330px, 0.4fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 16px 38px rgba(36, 41, 39, 0.09);
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.opportunity-view-area.is-split.is-list-collapsed {
  grid-template-columns: 52px minmax(0, 1fr);
}

.opportunity-view-area.is-split .opportunity-main-list-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 16px 12px;
  background: #f5f4ee;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.opportunity-view-area.is-split .opportunity-main-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 13px;
  border-bottom: 1px solid var(--line);
}

.opportunity-main-list-head strong,
.opportunity-main-list-head small {
  display: block;
}

.opportunity-main-list-head strong {
  font-size: 13px;
}

.opportunity-main-list-head small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.opportunity-list-collapse {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink-soft);
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.opportunity-list-collapse:hover {
  color: var(--blue);
  border-color: rgba(53, 88, 212, 0.4);
}

.opportunity-list-collapse svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms ease;
}

.opportunity-view-area.is-split.is-list-collapsed .opportunity-main-list-panel {
  padding: 12px 10px;
}

.opportunity-view-area.is-split.is-list-collapsed .opportunity-main-list-head {
  justify-content: center;
  padding: 0;
  border: 0;
}

.opportunity-view-area.is-split.is-list-collapsed .opportunity-main-list-head > span,
.opportunity-view-area.is-split.is-list-collapsed .opportunity-board {
  display: none;
}

.opportunity-view-area.is-split.is-list-collapsed .opportunity-list-collapse svg {
  transform: rotate(180deg);
}

.opportunity-view-area.is-split .opportunity-board {
  min-width: 0;
  max-height: calc(100dvh - 285px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 7px;
  padding: 12px 4px 4px 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.opportunity-view-area.is-split .opportunity-detail-panel {
  min-width: 0;
  padding: 26px;
  background: rgba(255, 253, 248, 0.94);
}

.crm-entity-board-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.crm-entity-toolbar-actions,
.crm-entity-sidebar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-status-filter {
  display: grid;
  grid-template-columns: auto minmax(112px, auto);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.crm-status-filter > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.crm-status-filter select {
  width: auto;
  min-width: 112px;
  height: 36px;
  padding: 0 30px 0 10px;
  border-radius: 9px;
}

.crm-entity-toolbar-actions .primary-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.crm-entity-toolbar-actions .primary-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.crm-entity-board-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.crm-entity-board-card .commission-board-description {
  min-height: 42px;
  margin: 0;
}

.crm-entity-view-area.is-split .crm-entity-board {
  grid-template-columns: minmax(0, 1fr);
}

.opportunity-split-row {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.opportunity-split-row:hover,
.opportunity-split-row.active {
  border-color: rgba(53, 88, 212, 0.42);
  box-shadow: inset 3px 0 0 var(--blue), 0 7px 18px rgba(53, 88, 212, 0.08);
}

.opportunity-split-row.is-complete {
  background: #f5fbf6;
}

.opportunity-split-row.is-complete.is-lost,
.opportunity-management-row.is-lost {
  color: #fff4f3;
  background: #54282e;
  border-color: #71363e;
}

.opportunity-split-row.is-lost:hover,
.opportunity-split-row.is-lost.active,
.opportunity-management-row.is-lost:hover,
.opportunity-management-row.is-lost.active {
  color: #fff;
  background: #642e36;
  border-color: #a7525e;
  box-shadow: inset 3px 0 0 #e17880, 0 7px 18px rgba(69, 25, 31, 0.18);
}

.opportunity-split-row.is-lost small,
.opportunity-management-row.is-lost small {
  color: #e9c9cc;
}

.opportunity-split-row-head,
.opportunity-split-row-meta {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.opportunity-split-row-head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-split-row .client-name-badge {
  justify-self: start;
}

.opportunity-split-row-meta small {
  color: var(--ink-soft);
  font-size: 9px;
}

.opportunity-board-card.is-complete.is-lost {
  color: #fff5f3;
  background: linear-gradient(145deg, #572a31, #3f2025);
  border-color: #743842;
  box-shadow: 0 12px 28px rgba(66, 25, 31, 0.2);
}

.opportunity-board-card.is-lost .commission-board-kicker,
.opportunity-board-card.is-lost .commission-next-task > span {
  color: #ffadb2;
}

.opportunity-board-card.is-lost .commission-board-description,
.opportunity-board-card.is-lost .object-creator,
.opportunity-board-card.is-lost .commission-date-range,
.opportunity-board-card.is-lost .commission-address-book small,
.opportunity-board-card.is-lost .commission-progress strong,
.opportunity-board-card.is-lost .commission-next-task p {
  color: #e9c9cc;
}

.opportunity-board-card.is-lost .secondary-button {
  color: #fff5f3;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
}

.opportunity-board-card.is-lost .secondary-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.42);
}

.opportunity-board-card.is-lost .commission-business-meta,
.opportunity-board-card.is-lost .opportunity-board-value > span,
.opportunity-board-card.is-lost .commission-next-task.is-complete {
  color: #fff5f3;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.opportunity-board-card.is-lost .commission-progress > span {
  background: rgba(255, 255, 255, 0.2);
}

.opportunity-board-card.is-complete.is-lost .commission-progress i {
  background: #e17880;
}

.business-badge.lost {
  color: #fff1f1;
  background: #722f38;
  border-color: #a9505c;
}

.business-badge.won {
  color: #176239;
  background: #dff4e8;
  border-color: #9fd1b4;
}

.opportunity-board-value {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(72px, 0.5fr));
  gap: 8px;
  margin-top: 12px;
}

.opportunity-board-value > span {
  min-width: 0;
  padding: 9px 10px;
  background: #f8f7f2;
  border: 1px solid #ebe8df;
  border-radius: 8px;
}

.opportunity-board-value strong,
.opportunity-board-value small {
  display: block;
}

.opportunity-board-value strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-board-value small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.opportunity-task-list .commission-sequence,
.opportunity-event-list .opportunity-linked-list {
  display: grid;
  gap: 7px;
}

.opportunity-task-list .opportunity-add-panel {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding: 10px 0 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.business-list-panel,
.business-form {
  padding: 18px;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(36, 41, 39, 0.07);
}

.business-list-panel.full {
  width: 100%;
}

.business-stack {
  display: grid;
  gap: 16px;
}

.warehouse-dashboard {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(420px, 1.35fr);
  gap: 16px;
  align-items: start;
}

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

.warehouse-panel-heading h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.warehouse-form-note {
  display: block;
  margin-top: 10px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.warehouse-inherit-field {
  align-self: end;
  min-height: 42px;
}

.warehouse-stock-quantity {
  min-width: 52px;
  display: grid;
  place-items: center;
  padding: 7px 10px;
  color: #1f674b;
  background: #e5f4ec;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.warehouse-stock-quantity.empty {
  color: #8a4c20;
  background: #fff0dc;
}

.warehouse-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.warehouse-row-tags span {
  padding: 3px 7px;
  color: var(--ink-soft);
  background: #f1efe9;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.task-material-builder {
  display: grid;
  gap: 9px;
  margin: 12px 0;
  padding: 12px;
  background: #f8f6f0;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.task-material-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px auto;
  gap: 8px;
}

.task-material-controls select,
.task-material-controls input {
  min-width: 0;
}

.task-material-list {
  display: grid;
  gap: 5px;
}

.task-material-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .warehouse-dashboard {
    grid-template-columns: 1fr;
  }
}

.business-form h2,
.business-form h3 {
  margin: 0 0 18px;
  font-size: 22px;
  line-height: 1.1;
}

.business-form h3 {
  font-size: 18px;
}

.compact-form {
  box-shadow: none;
}

.opportunity-list-panel,
.opportunity-detail-panel {
  min-width: 0;
}

.opportunity-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0;
}

.opportunity-filters .field {
  margin: 0;
}

.opportunity-filters .field:first-child,
.opportunity-filters .secondary-button {
  grid-column: 1 / -1;
}

.opportunity-detail-panel {
  display: grid;
  gap: 16px;
}

.opportunity-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.opportunity-detail-head > div {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.opportunity-detail-head > div > .business-badge,
.opportunity-detail-head > div > .document-code-badge,
.opportunity-detail-head > div > .quote-supply-badge {
  width: auto;
  min-height: 22px;
  height: 22px;
  margin: 0;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  line-height: 20px;
  letter-spacing: .025em;
  white-space: nowrap;
}

.opportunity-detail-head > div > .document-code-badge {
  border: 1px solid #cfd7ff;
}

.opportunity-detail-head h2 {
  flex: 0 0 100%;
  margin: 2px 0 10px;
  font-size: 24px;
  line-height: 1.15;
}

.opportunity-detail-metrics,
.opportunity-detail-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

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

.opportunity-recent-events {
  min-width: 0;
  margin: 4px 0 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.opportunity-recent-events-heading {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

.opportunity-recent-events-heading strong {
  font-size: 12px;
}

.opportunity-recent-events-heading small {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
}

.opportunity-recent-events-grid {
  min-width: 0;
}

.opportunity-recent-events-header,
.opportunity-recent-event-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(90px, .7fr) minmax(150px, 1.8fr) minmax(112px, .72fr);
  align-items: center;
  gap: 8px;
}

.opportunity-recent-events-header {
  min-height: 25px;
  padding: 4px 10px;
  color: var(--ink-soft);
  background: #f4f5f2;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.opportunity-recent-events-header > span:last-child {
  text-align: right;
}

.opportunity-recent-event-row {
  width: 100%;
  min-height: 42px;
  padding: 5px 10px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(218, 216, 207, .72);
  border-radius: 0;
}

.opportunity-recent-events-header + .opportunity-recent-event-row {
  border-top: 0;
}

.opportunity-recent-event-row:hover,
.opportunity-recent-event-row:focus-visible {
  background: #f5f7ff;
}

.opportunity-recent-event-row strong,
.opportunity-recent-event-description,
.opportunity-recent-event-row time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-recent-event-row strong {
  font-size: 10px;
}

.opportunity-recent-event-description,
.opportunity-recent-event-row time {
  font-size: 9px;
}

.opportunity-recent-event-row time {
  color: var(--ink-soft);
  text-align: right;
}

.crm-event-icon.opportunity-recent-event-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 6px;
}

.crm-event-icon.opportunity-recent-event-icon svg {
  width: 14px;
  height: 14px;
}

.opportunity-recent-events-empty {
  margin: 0;
  padding: 12px 10px;
}

@media (max-width: 600px) {
  .opportunity-recent-events-header,
  .opportunity-recent-event-row {
    grid-template-columns: 25px 72px minmax(0, 1fr) 82px;
    gap: 6px;
    padding-right: 7px;
    padding-left: 7px;
  }

  .opportunity-recent-event-row time {
    font-size: 8px;
  }
}

.opportunity-detail-metrics > span,
.opportunity-detail-fields > span {
  min-width: 0;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.opportunity-detail-metrics strong,
.opportunity-detail-metrics small,
.opportunity-detail-fields strong {
  display: block;
}

.opportunity-detail-metrics strong {
  font-size: 17px;
  line-height: 1.2;
}

.opportunity-detail-metrics small,
.opportunity-detail-fields strong {
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.opportunity-detail-note {
  margin: 0 0 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.opportunity-readonly-scores {
  margin-top: 16px;
}

.opportunity-readonly-scores input,
.opportunity-readonly-probability input {
  pointer-events: none;
}

.opportunity-readonly-probability {
  margin: 0 0 18px;
}

.opportunity-readonly-note {
  margin-bottom: 14px;
}

.opportunity-readonly-note > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 760;
}

.opportunity-readonly-note p {
  min-height: 68px;
  box-sizing: border-box;
  margin: 0;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.45;
}

.opportunity-linked-grid,
.opportunity-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.opportunity-action-button {
  min-width: 0;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.opportunity-action-button:hover {
  border-color: rgba(53, 88, 212, 0.38);
  box-shadow: 0 10px 24px rgba(53, 88, 212, 0.09);
}

.opportunity-action-button svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.opportunity-action-button strong,
.opportunity-action-button small {
  display: block;
}

.opportunity-action-button strong {
  font-size: 13px;
}

.opportunity-action-button small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
}

.project-linked-quotes {
  display: grid;
  gap: 9px;
  margin: 12px 0;
  padding: 12px;
  background: #f2f5fc;
  border: 1px solid #d7deef;
  border-radius: 8px;
}

.project-linked-quotes-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.project-linked-quotes-heading > span {
  display: grid;
  gap: 2px;
}

.project-form-linked-quotes {
  margin: 0;
  padding: 10px;
}

.quote-commission-preparation {
  display: grid;
  gap: 8px;
  margin: 4px 0 10px;
  scroll-margin-top: 72px;
}

.quote-commission-preparation[hidden] {
  display: none;
}

.quote-commission-preparation .project-delivery-approved-input,
.quote-commission-preparation .project-delivery-panel {
  margin: 0;
}

.quote-commission-preparation .project-delivery-final-row {
  justify-content: flex-end;
}

.quote-commission-group {
  display: grid;
  gap: 2px;
  min-width: 128px;
}

.quote-commission-group > span {
  color: var(--ink-soft);
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
}

.quote-commission-group select {
  width: 100%;
  min-height: 28px;
  padding: 3px 24px 3px 7px;
  border: 1px solid #d9deeb;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 9px;
}

.quote-commission-preparation .project-delivery-baseline-list {
  max-height: none;
  overflow: visible;
}

.quote-commission-preparation .quote-commission-plan-row {
  grid-template-columns: 22px minmax(180px, 1fr) minmax(112px, max-content) 73px;
  min-height: 36px;
  padding: 3px 5px;
}

.quote-commission-preparation .quote-commission-plan-row > span:nth-child(2) {
  align-self: center;
  overflow: hidden;
}

.quote-commission-preparation .quote-commission-plan-row strong,
.quote-commission-preparation .quote-commission-plan-row small {
  display: block;
  max-width: 100%;
}

.quote-commission-preparation .quote-commission-plan-row.editable {
  border-color: #d8c7ed;
  background: #fdfbff;
  cursor: grab;
}

.quote-commission-preparation .quote-commission-plan-row.editable:active { cursor: grabbing; }

.quote-commission-preparation .quote-commission-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.quote-commission-preparation .quote-commission-controls .quote-commission-group {
  min-width: 0;
  display: block;
}

.quote-commission-preparation .quote-commission-controls .quote-commission-group > span { display: none; }

.quote-commission-preparation .quote-commission-controls .quote-commission-group select {
  width: 140px;
  height: 28px;
  min-height: 28px;
}

.quote-commission-plan-actions {
  display: grid;
  grid-template-columns: repeat(3, 22px);
  gap: 3px;
  justify-content: end;
  align-items: center;
  min-width: 72px;
}

.quote-commission-plan-actions .icon-button {
  width: 22px;
  min-width: 22px;
  height: 27px;
  min-height: 27px;
  padding: 0;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1;
  background: #fff;
}

.quote-commission-plan-lock {
  display: grid;
  width: 22px;
  height: 27px;
  place-items: center;
  color: var(--ink-soft);
  font-size: 11px;
}

.quote-commission-plan-actions.locked {
  visibility: hidden;
}

@media (max-width: 760px) {
  .quote-commission-preparation .quote-commission-plan-row {
    grid-template-columns: 22px minmax(0, 1fr) 73px;
  }

  .quote-commission-preparation .quote-commission-plan-row > .quote-commission-controls {
    grid-column: 2;
    min-width: 0;
  }

  .quote-commission-preparation .quote-commission-plan-row > .quote-commission-plan-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

.project-delivery-operational-row[draggable="true"] { cursor: grab; }
.project-delivery-operational-row[draggable="true"]:active { cursor: grabbing; }

.delivery-dragging { opacity: .45; }

.delivery-drop-before,
.delivery-drop-after {
  position: relative;
}

.delivery-drop-before::before,
.delivery-drop-after::after {
  content: "";
  position: absolute;
  z-index: 5;
  left: 5px;
  right: 5px;
  height: 3px;
  border-radius: 999px;
  background: #3158d4;
  pointer-events: none;
}

.delivery-drop-before::before { top: -4px; }
.delivery-drop-after::after { bottom: -4px; }

.project-linked-quotes-heading small {
  color: var(--ink-soft);
}

.project-linked-quotes-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.project-linked-quotes-list .opportunity-action-button {
  min-height: 58px;
  padding: 10px 12px;
}

.project-linked-quote-copy {
  min-width: 0;
  flex: 1 1 auto;
}

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

.quote-status-display {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: max-content;
  margin-left: auto;
  padding: 4px 7px 4px 5px;
  color: #72521c;
  background: #fff8df;
  border: 1px solid #e4d39c;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(39, 45, 58, .08);
}

.quote-status-display b {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.quote-status-display.compact {
  gap: 5px;
  padding: 3px 6px 3px 4px;
}

.quote-status-display.compact b {
  font-size: 9px;
}

.commission-board-kicker.quote-card-status .quote-status-display {
  margin-left: 0;
}

.quote-status-display.status-rejected,
.quote-status-display.status-expired {
  color: #811e1a;
  background: #fde9e7;
  border-color: #d89c97;
}

.quote-status-display.status-accepted {
  color: #086a3a;
  background: #e2f8eb;
  border-color: #84d2a7;
}

.quote-status-display.status-draft {
  color: #535f73;
  background: #f0f3f7;
  border-color: #c9d0db;
}

.quote-traffic-light {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: auto;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.quote-traffic-light i {
  display: block;
  width: 6px;
  height: 6px;
  background: #c7ccd4;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(61, 70, 84, .16);
}

.quote-status-display.status-rejected .quote-traffic-light .red,
.quote-status-display.status-expired .quote-traffic-light .red {
  background: #ed3d35;
  box-shadow: 0 0 5px rgba(237, 61, 53, .95);
}

.quote-status-display.status-sent .quote-traffic-light .amber {
  background: #ffc331;
  box-shadow: 0 0 5px rgba(255, 195, 49, .9);
}

.quote-status-display.status-accepted .quote-traffic-light .green {
  background: #22d36d;
  box-shadow: 0 0 5px rgba(34, 211, 109, .9);
}

.opportunity-linked-grid > section {
  min-width: 0;
  padding: 12px;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.opportunity-commission-layout {
  display: grid;
  gap: 12px;
}

.opportunity-add-panel {
  margin: 0;
}

.opportunity-sequence-row {
  grid-template-columns: auto minmax(0, 1fr);
}

.opportunity-linked-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.opportunity-linked-heading strong {
  font-size: 12px;
}

.opportunity-linked-heading span {
  color: var(--ink-soft);
  font-size: 11px;
}

.opportunity-linked-heading-actions {
  justify-content: flex-start;
}

.opportunity-linked-heading-actions strong {
  margin-right: auto;
}

.opportunity-linked-heading-actions .secondary-button {
  min-height: 28px;
  margin-left: 4px;
}

.opportunity-simple-supply {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #e6dcc7;
  border-radius: 10px;
  background: #fffdf8;
}

.opportunity-simple-supply .opportunity-linked-heading-actions > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 220px;
  margin-right: auto;
}

.opportunity-simple-supply .opportunity-linked-heading-actions > span:first-child small {
  color: var(--ink-soft);
  font-weight: 500;
}

.opportunity-simple-supply .secondary-button.warm {
  border-color: #dfb76c;
  background: #fff4dc;
  color: #7b4c08;
}

.opportunity-link-chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.opportunity-linked-list {
  display: grid;
  gap: 7px;
}

.project-value {
  display: inline-block;
  color: #bd6618;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.project-value.compact {
  font-size: 11px;
  white-space: nowrap;
}

.project-value-won,
.project-value-summary .won strong {
  color: #247451;
}

.project-value-lost,
.project-value-summary .lost strong {
  color: #b63d34;
}

.project-value-open,
.project-value-summary .open strong {
  color: #bd6618;
}

.project-value-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 2px;
}

.project-value-summary > span {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-value-summary small {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-value-summary strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.project-value-summary.compact {
  gap: 4px;
  margin-top: 7px;
}

.project-value-summary.compact > span {
  padding: 5px 7px;
}

.project-value-summary.compact small {
  font-size: 8px;
}

.project-value-summary.compact strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-project-value {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.opportunity-project-value i {
  color: var(--ink-soft);
  font-size: 17px;
  font-style: normal;
}

.project-value-field output {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: #fff8ef;
  border: 1px solid #efd5b7;
  border-radius: 8px;
  font-size: 16px;
}

.project-value-field output.project-value-won {
  background: #eef8f3;
  border-color: #bee0cf;
}

.project-value-field output.project-value-lost {
  background: #fff1ef;
  border-color: #edc3bd;
}

.quote-approval-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f5f7fd;
  border: 1px solid #dce3f4;
  border-radius: 10px;
}

.quote-customer-supply-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.quote-customer-heading,
.quote-new-address {
  display: grid;
  gap: 12px;
  align-items: end;
}

.quote-customer-heading {
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1fr);
  align-items: stretch;
}

.quote-customer-identity,
.quote-shipping-summary {
  display: grid;
  gap: 8px;
  align-content: start;
}

.quote-customer-identity > div,
.quote-shipping-summary > div:not(.quote-shipping-summary-heading) {
  display: grid;
  gap: 3px;
}

.quote-customer-heading small,
.quote-supply-validation small {
  color: var(--text-muted);
}

.quote-customer-identity span,
.quote-shipping-summary > span {
  line-height: 1.35;
}

.quote-shipping-summary {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.quote-shipping-summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quote-supply-validation-row {
  display: flex;
  justify-content: flex-end;
}

.quote-supply-validation {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.quote-new-address {
  gap: 14px;
}

.quote-address-description-field,
.quote-new-address-grid {
  width: 100%;
}

.quote-address-default-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 600;
}

.quote-address-default-choice input { margin: 0; }

.quote-address-choice-section,
.quote-address-add-section {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.quote-address-choice-section h3,
.quote-address-add-section h3 {
  margin: 0;
  font-size: 1rem;
}

.quote-address-choice-list {
  display: grid;
  gap: 0;
  max-height: 250px;
  overflow: auto;
}

.quote-address-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 7px 2px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.quote-address-choice:hover,
.quote-address-choice.selected {
  color: var(--primary);
  background: transparent;
}

.quote-address-choice-radio {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border: 1px solid #8a929d;
  border-radius: 50%;
}

.quote-address-choice.selected .quote-address-choice-radio {
  background: #1768d5;
  border-color: #1768d5;
}

.quote-address-choice-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-address-choice em {
  color: var(--primary);
  font-size: .76rem;
  font-style: normal;
  font-weight: 700;
}

.quote-fulfillment-route {
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
}

.quote-new-address .quote-new-address-grid .address-street { grid-column: 1 / 5; }
.quote-new-address .quote-new-address-grid .address-number { grid-column: 5; }
.quote-new-address .quote-new-address-grid .address-postal { grid-column: 1; }
.quote-new-address .quote-new-address-grid .address-city { grid-column: 2 / 4; }
.quote-new-address .quote-new-address-grid .address-province { grid-column: 4; }
.quote-new-address .quote-new-address-grid .address-country { grid-column: 5; }

@media (max-width: 800px) {
  .quote-customer-heading,
  .quote-new-address { grid-template-columns: 1fr; }
  .quote-shipping-summary { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  .quote-supply-validation { justify-content: flex-start; }
  .quote-supply-validation-row { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .quote-new-address .quote-new-address-grid .address-street { grid-column: 1; }
  .quote-new-address .quote-new-address-grid .address-number { grid-column: 2; }
  .quote-new-address .quote-new-address-grid .address-postal { grid-column: 1; }
  .quote-new-address .quote-new-address-grid .address-city { grid-column: 1 / -1; }
  .quote-new-address .quote-new-address-grid .address-province { grid-column: 2; }
  .quote-new-address .quote-new-address-grid .address-country { grid-column: 1 / -1; }
}

.quote-approval-toolbar .field {
  min-width: 220px;
  margin: 0;
}

.quote-approval-accepted { color: #247451; background: #e8f5ee; }
.quote-approval-rejected { color: #b63d34; background: #fdecea; }
.quote-approval-exported,
.quote-approval-sent { color: #9a5a16; background: #fff1d9; }

.quote-header-details-grid {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(0, 2fr);
  /* Le quattro righe a sinistra e l'area Note sono un unico blocco verticale. */
  grid-template-rows: 306px;
  gap: 16px;
  align-items: stretch;
  min-width: 0;
  margin: 0 0 16px;
}

.quote-header-meta {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.quote-header-meta > .field:first-child {
  /* Allinea il bordo superiore del controllo Opportunità con quello delle Note. */
  transform: translateY(5px);
}

.quote-header-meta .field,
.quote-header-notes {
  display: grid;
  grid-template-rows: 12px minmax(34px, auto);
  min-width: 0;
  gap: 3px;
  margin: 0;
}

.quote-header-meta .field > span,
.quote-header-notes > span {
  box-sizing: border-box;
  height: 12px;
  line-height: 12px;
}

.quote-header-notes {
  grid-template-rows: 12px minmax(0, 1fr);
  align-self: stretch;
}

#crm-quote-form .quote-header-notes {
  margin-bottom: 0;
  min-height: 306px;
}

.quote-header-meta .field[hidden] { display: none; }

#crm-quote-form .quote-header-meta input,
#crm-quote-form .quote-header-meta select {
  min-height: 34px;
  height: 34px;
  padding-inline: 9px;
}

#crm-quote-form .quote-header-notes textarea {
  box-sizing: border-box;
  min-height: 0;
  height: 100%;
  padding: 9px 10px;
  resize: none;
}

.quote-compact-valuation {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-top: 2px;
  flex: 0 0 auto;
}

.quote-compact-valuation[hidden] { display: none; }

.quote-compact-valuation-title {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  line-height: 12px;
  text-transform: uppercase;
}

.quote-compact-valuation > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 84px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.quote-compact-valuation > div > span {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
  padding: 5px 8px;
  border-left: 1px solid var(--line);
}

.quote-compact-valuation > div > span:nth-child(3n + 1) { border-left: 0; }
.quote-compact-valuation > div > span:nth-child(n + 4) { border-top: 1px solid var(--line); }
.quote-compact-valuation small { color: var(--ink-soft); font-size: 9px; }
.quote-compact-valuation strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.quote-compact-valuation .quote-valuation-cost strong { color: #b53d35; }
.quote-compact-valuation .quote-valuation-margin strong { color: #247451; }

.business-form.is-commission-preparation [data-quote-bottom-editor] {
  display: none !important;
}

@media (max-width: 720px) {
  .quote-header-details-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
  }
  .quote-header-meta {
    height: auto;
    gap: 6px;
  }
  #crm-quote-form .quote-header-notes textarea { min-height: 100px; }
}

.business-form.is-readonly .quote-builder,
.business-form.is-readonly .quote-workflow-builder {
  opacity: 0.72;
}

.quote-signed-document {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  gap: 12px;
  padding: 12px;
  margin-top: 16px;
  background: #eef8f3;
  border: 1px solid #bee0cf;
  border-radius: 10px;
}

.quote-signed-document > span {
  display: grid;
  gap: 3px;
}

.quote-signed-document small { color: var(--ink-soft); }
.quote-signed-document input[type="file"] { max-width: 280px; }

.quote-preview-dialog {
  width: min(1180px, calc(100vw - 28px));
  max-width: none;
}

.quote-preview-dialog .crm-dialog-form { width: 100%; }
.quote-preview-dialog iframe {
  width: 100%;
  height: min(78vh, 900px);
  background: #e8e9ed;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-send-dialog { width: min(560px, calc(100vw - 28px)); }
.quote-signature-required,
.quote-signature-ready {
  padding: 9px 10px;
  border-radius: 8px;
  font-weight: 750;
}
.quote-signature-required { color: #9b3b31; background: #fff0ed; }
.quote-signature-ready { color: #247451; background: #e8f5ee; }

.opportunity-linked-row {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.opportunity-linked-row-icon {
  justify-content: flex-start;
}

.opportunity-linked-row:hover {
  border-color: rgba(53, 88, 212, 0.35);
}

.opportunity-empty-project {
  width: 100%;
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  color: var(--ink);
  background: rgba(53, 88, 212, 0.045);
  border: 1px dashed rgba(53, 88, 212, 0.45);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
}

.opportunity-empty-project:hover {
  background: rgba(53, 88, 212, 0.09);
  border-color: var(--blue);
}

.opportunity-empty-project-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  position: relative;
  color: white;
  background: var(--blue);
  border-radius: 50%;
  font-size: 0;
}

.opportunity-empty-project-icon::before,
.opportunity-empty-project-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: white;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.opportunity-empty-project-icon::before {
  width: 12px;
  height: 3px;
}

.opportunity-empty-project-icon::after {
  width: 3px;
  height: 12px;
}

.opportunity-empty-project strong,
.opportunity-empty-project small {
  display: block;
}

.opportunity-empty-project strong {
  font-size: 12px;
}

.opportunity-empty-project small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.opportunity-linked-row.static:hover {
  border-color: var(--line);
}

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

.opportunity-linked-row strong {
  font-size: 12px;
  line-height: 1.25;
}

.opportunity-linked-row small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.opportunity-empty-detail {
  padding: 26px;
  background: white;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

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

.crm-event-detail-grid span,
.crm-event-detail-summary {
  min-width: 0;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.crm-event-detail-type {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-event-detail-grid strong,
.crm-event-detail-summary strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.crm-event-detail-summary {
  margin-top: 12px;
}

#crm-removal-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
#crm-removal-dialog .business-form-actions {
  position: static;
  flex-wrap: wrap;
  margin-top: 16px;
}
#crm-removal-dialog textarea { width: 100%; box-sizing: border-box; }

.crm-event-detail-summary p {
  margin: 0;
  line-height: 1.5;
}

.opportunity-empty-detail h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.business-dialog .crm-opportunity-dialog-form,
.business-dialog .crm-dialog-form {
  --dialog-content-padding: 28px;
  padding: var(--dialog-content-padding);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.task-dialog.opportunity-management-dialog {
  width: min(1480px, calc(100vw - 8px));
  height: min(1220px, calc(100dvh - 8px));
  max-height: calc(100dvh - 8px);
  box-sizing: border-box;
  overflow: hidden;
}

.opportunity-management-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.32fr) minmax(0, 1fr);
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.crm-entity-management-layout {
  transition: grid-template-columns 180ms ease;
}

.crm-entity-management-layout.is-list-collapsed {
  grid-template-columns: 54px minmax(0, 1fr);
}

.crm-entity-management-layout.is-list-collapsed .crm-entity-management-sidebar {
  padding: 14px 10px;
}

.crm-entity-management-layout.is-list-collapsed .opportunity-management-sidebar-head {
  justify-content: center;
  padding: 0;
  border: 0;
}

.crm-entity-management-layout.is-list-collapsed .opportunity-management-sidebar-head > div:first-child,
.crm-entity-management-layout.is-list-collapsed .opportunity-management-list,
.crm-entity-management-layout.is-list-collapsed .crm-quote-origin-filter,
.crm-entity-management-layout.is-list-collapsed .crm-entity-sidebar-actions .icon-button {
  display: none;
}

.crm-entity-management-layout.is-list-collapsed .crm-entity-sidebar-actions {
  display: grid;
}

.crm-entity-management-layout.is-list-collapsed .opportunity-list-collapse svg {
  transform: rotate(180deg);
}

.opportunity-management-sidebar {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 22px 16px;
  background: #f5f4ee;
  border-right: 1px solid var(--line);
  overflow: hidden;
}
#crm-quote-dialog .crm-entity-management-sidebar {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.opportunity-management-sidebar-head,
.opportunity-management-linked-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.opportunity-management-sidebar-head {
  padding: 0 4px 14px;
  border-bottom: 1px solid var(--line);
}
.crm-quote-origin-filter {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 4px;
  background: #f5f4ee;
  border-bottom: 1px solid #e1dfd8;
}
.crm-quote-origin-filter > span { color: #46505d; font-size: 10px; font-weight: 850; }
.crm-quote-origin-filter > select {
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  height: 34px;
  padding: 0 31px 0 12px;
  border: 1px solid #cbd4e8;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff 0%, #f5f7fc 100%);
  color: #24345f;
  font-size: 11px;
  font-weight: 750;
  box-shadow: 0 2px 6px rgba(45,64,108,.08);
  cursor: pointer;
  outline: none;
}
.crm-quote-origin-filter::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 16px;
  width: 7px;
  height: 7px;
  border-right: 2px solid #3558d4;
  border-bottom: 2px solid #3558d4;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.crm-quote-origin-filter > select:hover { border-color: #9eadd2; background: #fff; }
.crm-quote-origin-filter > select:focus { border-color: #6681d5; box-shadow: 0 0 0 3px rgba(53,88,212,.12); }

.opportunity-management-sidebar-head strong,
.opportunity-management-sidebar-head span {
  display: block;
}

.opportunity-management-sidebar-head strong {
  font-size: 15px;
}

.opportunity-management-sidebar-head span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
}

.opportunity-management-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-color: rgba(53, 88, 212, 0.55) rgba(53, 88, 212, 0.1);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  padding: 12px 3px 12px 0;
}

.opportunity-management-list::-webkit-scrollbar {
  width: 8px;
}

.opportunity-management-list::-webkit-scrollbar-track {
  background: rgba(53, 88, 212, 0.1);
  border-radius: 999px;
}

.opportunity-management-list::-webkit-scrollbar-thumb {
  background: rgba(53, 88, 212, 0.55);
  border: 2px solid #f5f4ee;
  border-radius: 999px;
}

.opportunity-management-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 11px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
}

.opportunity-management-row:hover {
  background: white;
  border-color: var(--line);
}

.opportunity-management-row.active {
  background: white;
  border-color: rgba(53, 88, 212, 0.4);
  box-shadow: inset 3px 0 0 var(--blue);
}

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

.opportunity-management-row strong {
  font-size: 12px;
  line-height: 1.3;
}

.opportunity-management-row small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-management-row .business-badge {
  font-size: 7px;
}

.business-dialog .crm-opportunity-dialog-form {
  height: 100%;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  padding-bottom: 0;
  scroll-padding-bottom: 76px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.business-dialog .crm-entity-dialog-form {
  height: 100%;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  padding: 28px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.crm-entity-dialog-form .dialog-header {
  position: static;
  margin: 0 0 18px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.crm-entity-dialog-form .business-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: 18px -28px 0;
  padding: 14px 28px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 18px rgba(247, 245, 239, 0.92);
}

.crm-entity-dialog-form .conversion-panel {
  margin: 18px 0 0;
}

.crm-opportunity-dialog-form .dialog-header {
  position: static;
  margin: 0 0 18px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.crm-management-reference {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.crm-management-reference[hidden] {
  display: none;
}

.crm-management-reference .document-code-badge,
.crm-management-reference .business-badge {
  width: auto;
  min-height: 22px;
  height: 22px;
  margin: 0;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  line-height: 20px;
  letter-spacing: .025em;
  white-space: nowrap;
}

.crm-management-reference .document-code-badge {
  border: 1px solid #cfd7ff;
}

.crm-opportunity-dialog-form .business-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: 18px calc(-1 * var(--dialog-content-padding)) 0;
  padding: 14px var(--dialog-content-padding) 18px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 18px rgba(247, 245, 239, 0.92);
}

.business-dialog > form.crm-dialog-form {
  box-sizing: border-box;
  max-height: min(calc(100vh - 30px), calc(100dvh - 30px));
  padding-bottom: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: 76px;
  scrollbar-gutter: stable;
}

.business-dialog > form.crm-dialog-form > .business-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  isolation: isolate;
  margin: 18px calc(-1 * var(--dialog-content-padding)) 0;
  padding: 14px var(--dialog-content-padding) 18px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 18px rgba(247, 245, 239, 0.92);
}

.opportunity-management-linked {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.opportunity-management-linked[hidden] {
  display: none;
}

.opportunity-management-linked-head > div:first-child strong,
.opportunity-management-linked-head > div:first-child span {
  display: block;
}

.opportunity-management-linked-head > div:first-child strong {
  font-size: 16px;
}

.opportunity-management-linked-head > div:first-child span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
}

.opportunity-management-linked-head > div:last-child {
  display: flex;
  gap: 7px;
}

.opportunity-management-linked .opportunity-add-panel {
  margin: 0;
}

.opportunity-management-linked-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.opportunity-management-linked-grid > .opportunity-lineage-section {
  grid-column: 1 / -1;
}

.opportunity-lineage-list {
  display: grid;
  gap: 10px;
}

.crm-lineage-card {
  margin: 12px 0 18px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(53, 88, 212, 0.08), rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(53, 88, 212, 0.22);
  border-radius: 10px;
}

.crm-lineage-card[hidden] {
  display: none;
}

.crm-lineage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.crm-lineage-head strong {
  font-size: 12px;
}

.crm-lineage-head span {
  color: var(--ink-soft);
  font-size: 9px;
  text-align: right;
}

.crm-lineage-flow {
  display: flex;
  align-items: stretch;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.crm-lineage-step {
  min-width: 130px;
  flex: 1 0 130px;
  display: block;
  padding: 9px 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

button.crm-lineage-step {
  cursor: pointer;
}

button.crm-lineage-step:hover {
  border-color: rgba(53, 88, 212, 0.55);
  box-shadow: 0 3px 10px rgba(53, 88, 212, 0.1);
}

.crm-lineage-step-label,
.crm-lineage-step strong,
.crm-lineage-step small {
  display: block;
}

.crm-lineage-step-label {
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crm-lineage-step strong {
  font-size: 11px;
  line-height: 1.3;
}

.crm-lineage-step small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.35;
}

.crm-lineage-arrow {
  align-self: center;
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
}

.text-link-button {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 850;
  text-decoration: underline;
  cursor: pointer;
}

.opportunity-badge-link {
  cursor: pointer;
}

.opportunity-badge-link:hover {
  box-shadow: 0 0 0 2px rgba(53, 88, 212, 0.16);
}

.opportunity-project-list .opportunity-linked-row,
.opportunity-project-section .opportunity-linked-row {
  width: 100%;
  justify-content: space-between;
  text-align: left;
}

.opportunity-management-linked-grid > section {
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.opportunity-management-linked-grid .commission-sequence,
.opportunity-management-linked-grid .opportunity-linked-list {
  display: grid;
  gap: 7px;
}

.opportunity-management-linked-grid > section:not(.opportunity-lineage-section) .opportunity-empty-project,
.opportunity-management-linked-grid > section:not(.opportunity-lineage-section) .opportunity-sequence-row,
.opportunity-management-linked-grid > section:not(.opportunity-lineage-section) .opportunity-linked-row {
  min-height: 88px;
  box-sizing: border-box;
}

.crm-event-type-field {
  min-width: 0;
}

.crm-event-type-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.crm-event-type-row .icon-button {
  height: 42px;
}

.crm-event-type-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.crm-event-type-panel[hidden] {
  display: none;
}

.crm-event-type-preview {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.crm-event-type-preview span:last-child {
  min-width: 0;
}

.field input[type="color"] {
  padding: 5px;
}

.crm-opportunity-dialog-form .dialog-header,
.crm-dialog-form .dialog-header {
  margin-bottom: 18px;
}

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

.business-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.business-row:hover,
.business-row.active {
  border-color: rgba(53, 88, 212, 0.42);
  box-shadow: 0 10px 22px rgba(53, 88, 212, 0.08);
}

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

.business-row strong {
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.business-row small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
}

.business-row-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.business-row-main.text-button {
  width: 100%;
  height: auto;
  min-height: 0;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 3px;
  padding: 0;
  color: var(--ink);
  font-size: inherit;
  font-weight: inherit;
  text-align: left;
}

.business-row-main.text-button:hover {
  color: var(--ink);
}

.opportunity-list-panel .business-row {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 13px;
}

.opportunity-list-panel .business-row-meta {
  width: 100%;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  white-space: normal;
}

.opportunity-list-panel .business-row-meta small {
  margin: 0;
  text-align: right;
}

.business-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: #294b3e;
  background: #dff2e9;
  border: 1px solid #bee4d1;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.business-badge.neutral {
  color: #56618a;
  background: var(--blue-pale);
  border-color: #cfd7ff;
}

.business-badge.warm {
  color: #80530b;
  background: #fff0ca;
  border-color: #f1d588;
}

.business-form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: center;
  margin-top: 4px;
}

.score-field.probability {
  margin-bottom: 16px;
}

.score-field.probability { --metric-color: var(--green); }

.quote-builder {
  margin-bottom: 14px;
  padding: 12px;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-builder-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 68px 72px repeat(4, 92px);
  gap: 9px;
  align-items: end;
}

.quote-builder-row .field {
  margin-bottom: 0;
}

.quote-builder-row > .secondary-button {
  width: 92px;
  padding-right: 8px;
  padding-left: 8px;
  white-space: nowrap;
}

.quote-workflow-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.quote-workflow-actions > .primary-button,
.quote-workflow-actions > .secondary-button,
.quote-workflow-actions > .danger-button {
  width: auto;
  min-width: 92px;
  min-height: 42px;
  padding-right: 8px;
  padding-left: 8px;
  white-space: nowrap;
}

/* Griglia standard per i pannelli: etichette e controlli condividono la stessa base. */
.prisma-form-grid {
  --prisma-grid-gap: 7px;
  --prisma-control-height: 35px;
  display: grid;
  gap: var(--prisma-grid-gap);
  align-items: end;
}

.prisma-form-grid > * {
  min-width: 0;
  box-sizing: border-box;
}

.prisma-form-grid > .field,
.prisma-form-grid > .prisma-grid-field {
  margin: 0;
}

.prisma-grid-field {
  display: grid;
  grid-template-rows: auto var(--prisma-control-height);
  gap: 7px;
  min-width: 0;
}

.prisma-grid-field > span {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--ui-field-font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.prisma-grid-field > :last-child {
  width: 100%;
  min-width: 0;
  height: var(--prisma-control-height);
  min-height: var(--prisma-control-height);
  box-sizing: border-box;
}

.quote-payment-editor {
  border: 1px solid #dce3ee;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.quote-payment-heading,
.quote-installment-summary,
.realtes-data-heading,
.realtes-data-section-heading,
.user-signature-field,
.user-signature-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quote-payment-toggle {
  min-height: 32px;
}

.quote-payment-toggle,
.quote-installment-toggle-button {
  position: relative;
  display: inline-flex;
  height: 32px;
  min-height: 32px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #fff;
  color: #526174;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.quote-payment-toggle input,
.quote-installment-toggle-button input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quote-payment-toggle:has(input:checked) {
  border-color: #5574ca;
  background: #edf2ff;
  color: #3151a5;
}

.quote-installment-toggle-button:has(input:checked) {
  border-color: #6842d8;
  background: #6842d8;
  color: #fff;
  box-shadow: 0 2px 7px rgba(104, 66, 216, .22);
}

.quote-installment-toggle-button:has(input:disabled) { opacity: .45; cursor: default; }

.quote-installment-controls {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
}

.quote-installment-controls .quote-installment-toggle-button {
  width: auto;
  height: 42px;
  min-height: 42px;
  padding: 0 13px;
}

.quote-installment-count {
  display: grid;
  width: 86px;
  min-width: 86px;
  height: 42px;
  min-height: 42px;
  box-sizing: border-box;
  grid-template-columns: auto 42px;
  align-items: center;
  gap: 4px;
  padding-left: 8px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #fff;
  color: #526174;
  flex: 0 0 86px;
}
.quote-installment-count[hidden] { display: none; }

.quote-installment-count > span { font-size: 9px; font-weight: 800; }
.quote-installment-count select {
  width: 42px;
  min-height: 40px;
  height: 40px;
  padding: 0 17px 0 5px;
  border: 0;
  border-left: 1px solid #e2e7ef;
  border-radius: 0 7px 7px 0;
  font-size: 11px;
}

.form-grid.quote-payment-fields {
  grid-template-columns: 220px minmax(260px, 340px) 220px 190px;
  justify-content: start;
  gap: 7px;
}

.form-grid.quote-payment-fields .field { margin: 0; }
.form-grid.quote-payment-fields .field > span { font-size: 8px; }
.form-grid.quote-payment-fields select,
.form-grid.quote-payment-fields input { min-height: 34px; height: 34px; padding-inline: 9px; font-size: 11px; }
.form-grid.quote-payment-fields #crm-quote-vat-rate {
  width: 100%;
  min-width: 0;
  padding: 0 30px 0 10px;
  text-align: left;
}

.quote-single-payment-term[hidden] {
  display: none;
}

.form-grid.quote-payment-fields .quote-first-due-date,
.form-grid.quote-payment-fields .quote-first-due-date input {
  display: none;
}

.quote-installment-summary {
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
  color: #526174;
  font-size: .82rem;
}

.quote-installment-summary output {
  color: #10233f;
  font-size: 1rem;
  font-weight: 800;
}

.quote-installment-list {
  display: grid;
  width: min(100%, 650px);
  max-width: 650px;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.quote-installment-row {
  display: grid;
  width: 100%;
  box-sizing: border-box;
  grid-template-columns: minmax(130px, 180px) 105px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 3px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.quote-installment-row input {
  min-width: 0;
  height: 30px;
  border: 1px solid #d7dee9;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 4px 8px;
  color: #17243a;
  font: inherit;
  font-size: .78rem;
}

.quote-installment-amount-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
}

.quote-installment-amount-field span {
  color: #657286;
  font-size: .68rem;
  font-weight: 800;
}

.quote-installment-amount {
  text-align: left;
  font-weight: 800 !important;
}

.quote-installment-date {
  width: 126px;
  min-width: 126px !important;
  flex: 0 0 126px;
  padding-right: 4px !important;
}

.quote-installment-due-field {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
}

.quote-installment-due-mode {
  width: 0;
  flex: 1 1 130px;
  min-width: 0;
  height: 30px;
  border: 1px solid #d7dee9;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 3px 24px 3px 7px;
  color: #17243a;
  font: inherit;
  font-size: .75rem;
}

.realtes-data-form {
  max-width: 1500px;
  margin: 0 auto;
  gap: 16px;
}

.realtes-data-heading {
  align-items: flex-start;
}

.realtes-data-heading p,
.realtes-data-section-heading p {
  margin: 3px 0 0;
  color: #657286;
}

.realtes-data-card {
  padding: 16px;
  border: 1px solid #dfe5ee;
  border-radius: 16px;
  background: #fbfcfe;
  display: grid;
  gap: 12px;
}

.realtes-data-card h3 {
  margin: 0;
}

.realtes-signature-upload {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.realtes-signature-upload input[type="file"] {
  min-width: 0;
  height: 36px;
  padding: 6px 8px;
  border: 1px solid #dce3ee;
  border-radius: 10px;
  background: #fff;
}

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

.realtes-wide-field {
  grid-column: span 2;
}

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

.realtes-repeater-row {
  display: grid;
  grid-template-columns: 130px minmax(170px, 1fr) minmax(170px, 1fr) minmax(245px, 1.35fr) 125px auto auto 38px;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e0e6ef;
  border-radius: 12px;
  background: #fff;
}

.realtes-repeater-row.payment-method-row {
  grid-template-columns: minmax(190px, 1fr) minmax(240px, 1.6fr) 150px auto auto 38px;
}

.realtes-repeater-row .compact-check {
  min-height: 42px;
  white-space: nowrap;
}

.inline-unit {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inline-unit input {
  min-width: 0;
}

.user-signature-field {
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid #dfe5ee;
  border-radius: 12px;
  background: #f8fafc;
}

.user-signature-field > div:first-child {
  display: grid;
  gap: 3px;
}

.user-signature-field small {
  color: #657286;
}

@media (max-width: 1150px) {
  .form-grid.quote-payment-fields,
  .realtes-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .realtes-repeater-row,
  .realtes-repeater-row.payment-method-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .quote-payment-heading,
  .realtes-data-heading,
  .realtes-data-section-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .quote-installment-count { width: 100%; }
  .form-grid.quote-payment-fields,
  .realtes-profile-grid,
  .quote-installment-list,
  .quote-installment-row,
  .realtes-repeater-row,
  .realtes-repeater-row.payment-method-row {
    grid-template-columns: 1fr;
  }
  .realtes-wide-field { grid-column: auto; }
}

.manual-quote-item-dialog {
  width: min(680px, calc(100vw - 32px));
  max-width: 680px;
}

.manual-quote-item-dialog form {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.manual-quote-item-dialog .dialog-header {
  margin-bottom: 8px;
}

.manual-quote-item-dialog .dialog-header h2 {
  font-size: 25px;
}

.product-summary-dialog {
  width: min(1180px, calc(100vw - 28px));
  max-width: 1180px;
  height: min(850px, calc(100dvh - 28px));
  max-height: calc(100dvh - 28px);
  overflow: hidden;
}

.product-summary-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.product-summary-shell > .dialog-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.product-summary-content {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 0;
  overflow: auto;
  padding: 18px 22px 24px;
}

.product-summary-identity {
  display: grid;
  grid-template-columns: minmax(170px, .7fr) minmax(160px, .7fr) minmax(300px, 1.6fr);
  gap: 8px;
}

.product-summary-identity > span {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid #dfe3eb;
  border-radius: 10px;
}

.product-summary-identity > .full {
  grid-column: 1 / -1;
}

.product-summary-identity small,
.product-summary-section-title small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.product-summary-identity strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.product-summary-identity p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-line;
}

.product-supplier-section {
  display: grid;
  gap: 8px;
}

.product-summary-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.product-summary-section-title h3,
.product-price-chart h3 {
  margin: 2px 0 0;
  font-size: 15px;
}

.product-summary-section-title > strong {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 26px;
  color: #3558d4;
  background: #e7edff;
  border-radius: 13px;
}

.product-supplier-table {
  min-width: 0;
  overflow-x: auto;
  background: #fff;
  border: 1px solid #dfe3eb;
  border-radius: 10px;
}

.product-supplier-header,
.product-supplier-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) minmax(100px, .8fr) minmax(170px, 1.2fr)
    92px 104px 90px;
  gap: 8px;
  align-items: center;
  min-width: 820px;
  padding: 8px 11px;
}

.product-supplier-header {
  color: var(--muted);
  background: #f4f6f9;
  border-bottom: 1px solid #dfe3eb;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.product-supplier-row {
  min-height: 44px;
  border-bottom: 1px solid #edf0f4;
  font-size: 11px;
}
.product-supplier-row.is-selectable {
  width: 100%;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #edf0f4;
  cursor: pointer;
}
.product-supplier-row.is-selectable:hover,
.product-supplier-row.is-selectable:focus-visible { background: #edf3ff; outline: none; }
.product-supplier-row.is-selectable.is-selected {
  background: #e9f7ef;
  box-shadow: inset 3px 0 #2e9b61;
}

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

.product-supplier-row > span:first-child {
  display: grid;
  min-width: 0;
}

.product-supplier-row > span:first-child strong,
.product-supplier-row > span:first-child small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-supplier-row > span:first-child small {
  color: var(--muted);
  font-size: 9px;
}

.product-supplier-choice {
  justify-self: start;
  margin-top: 2px;
  padding: 2px 6px;
  color: #3159cc;
  background: #edf3ff;
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.product-supplier-row.is-selected .product-supplier-choice {
  color: #247247;
  background: #d9f1e3;
}

.product-supplier-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.product-supplier-row > span:nth-child(2) > strong,
.product-supplier-row > span:nth-child(2) > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-supplier-row > span:nth-child(2) > small {
  color: var(--muted);
  font-size: 9px;
}

.product-supplier-header > :nth-child(4),
.product-supplier-header > :nth-child(5),
.product-supplier-row > :nth-child(4),
.product-supplier-row > :nth-child(5) {
  text-align: right;
}

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

.product-price-chart {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid #dfe3eb;
  border-radius: 12px;
}

.product-price-chart.blue {
  border-top: 3px solid #4d70dc;
}

.product-price-chart.green {
  border-top: 3px solid #2c8a62;
}

.product-chart-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.product-chart-metrics > span {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  background: #f5f7fa;
  border-radius: 7px;
}

.product-chart-metrics small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.product-chart-metrics strong {
  font-size: 12px;
}

.product-price-chart svg {
  display: block;
  width: 100%;
  min-height: 190px;
  overflow: visible;
}

.product-price-chart svg text {
  fill: #748078;
  font-size: 10px;
}

.product-chart-grid {
  stroke: #e7eaf0;
  stroke-width: 1;
}

.product-chart-line {
  fill: none;
  stroke: #4d70dc;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.product-price-chart.green .product-chart-line {
  stroke: #2c8a62;
}

.product-chart-point {
  fill: #fff;
  stroke: #4d70dc;
  stroke-width: 3;
}

.product-price-chart.green .product-chart-point {
  stroke: #2c8a62;
}

.product-chart-average {
  stroke: #d59b28;
  stroke-dasharray: 7 5;
  stroke-width: 2;
}

.product-chart-quoted {
  stroke: #9b59b6;
  stroke-dasharray: 2 5;
  stroke-width: 2;
}

.product-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 9px;
}

.product-chart-legend span::before {
  display: inline-block;
  width: 13px;
  height: 3px;
  margin-right: 5px;
  vertical-align: middle;
  content: "";
  background: #4d70dc;
}

.product-price-chart.green .product-chart-legend .series::before {
  background: #2c8a62;
}

.product-chart-legend .average::before {
  background: #d59b28;
}

.product-chart-legend .quoted::before {
  background: #9b59b6;
}

.product-chart-empty {
  display: grid;
  place-items: center;
  min-height: 190px;
  margin: 0;
  color: var(--muted);
  background: #f8f9fb;
  border-radius: 8px;
  font-size: 11px;
}

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

.manual-quote-item-grid .field {
  margin-bottom: 0;
}

.manual-quote-item-grid .full {
  grid-column: 1 / -1;
}

#quote-manual-description[readonly] {
  color: var(--ink-soft);
  background: #f3f4f7;
}

.manual-quote-supplier-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.manual-quote-supplier-row .secondary-button {
  padding-right: 10px;
  padding-left: 10px;
  white-space: nowrap;
}

.quote-catalog-search-field {
  position: relative;
}

.quote-catalog-popup {
  position: absolute;
  z-index: 80;
  top: calc(100% + 4px);
  left: 0;
  width: min(980px, calc(100vw - 72px));
  max-height: 330px;
  overflow: auto;
  padding: 6px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c9cfdc;
  border-radius: 10px;
  box-shadow: 0 18px 42px rgba(28, 36, 62, 0.2);
}

.quote-catalog-header,
.quote-catalog-result {
  display: grid;
  grid-template-columns: minmax(100px, .8fr) minmax(210px, 2.2fr) minmax(105px, .9fr)
    minmax(105px, .9fr) minmax(125px, 1fr) minmax(130px, 1.2fr);
  gap: 10px;
  align-items: center;
}

.quote-catalog-header {
  position: sticky;
  z-index: 1;
  top: -6px;
  padding: 8px 10px;
  color: var(--muted);
  background: #f3f5f9;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.quote-catalog-result {
  width: 100%;
  padding: 9px 10px;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #eceef3;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}

.quote-catalog-result:hover,
.quote-catalog-result.selected {
  background: #edf2ff;
}

.quote-product-code-link {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: #254aa8;
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 850;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(37, 74, 168, .28);
  text-underline-offset: 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.quote-product-code-link:hover,
.quote-product-code-link:focus-visible {
  color: #173b9a;
  text-decoration-color: currentColor;
}

.quote-catalog-result > span,
.quote-catalog-result > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-catalog-header > :nth-child(3),
.quote-catalog-header > :nth-child(4),
.quote-catalog-result > :nth-child(3),
.quote-catalog-result > :nth-child(4) {
  text-align: right;
}

.quote-catalog-empty {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.quote-catalog-note {
  display: block;
  min-height: 16px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.quote-selected-item {
  display: grid;
  grid-template-columns: auto minmax(105px, .8fr) minmax(260px, 2.5fr)
    minmax(130px, 1fr) minmax(110px, .8fr) minmax(110px, .8fr);
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  padding: 10px 12px;
  background: #edf3ff;
  border: 1px solid #c8d6fa;
  border-radius: 8px;
  font-size: 12px;
}

.quote-selected-item[hidden] {
  display: none;
}

.quote-selected-label {
  color: #3154a4;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.quote-selected-description {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-selected-item > span:not(.quote-selected-label, .quote-selected-description) {
  display: grid;
  min-width: 0;
}

.quote-selected-item small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.quote-selected-item > :nth-last-child(-n + 2) {
  text-align: right;
}

.quote-draft-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 10px;
  padding-right: 5px;
  overflow-x: auto;
}

.quote-draft-groups,
.quote-draft-header,
.quote-draft-row {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 140px minmax(0, 1fr) 291px 210px 25px;
  gap: 0;
  align-items: center;
}

.quote-offer-columns,
.quote-analysis-columns {
  display: grid;
  align-items: center;
  min-width: 0;
  height: 100%;
}

.quote-offer-columns {
  grid-template-columns: 92px 46px 50px 103px;
}

.quote-analysis-columns {
  grid-template-columns: 74px 136px;
}

.quote-offer-columns > *,
.quote-analysis-columns > * {
  min-width: 0;
  padding: 0 6px;
}

.quote-offer-columns > :not(:first-child),
.quote-analysis-columns > :not(:first-child) {
  border-left: 1px solid #e2e6ea;
}

.quote-offer-columns > *,
.quote-analysis-columns > :first-child {
  text-align: right;
}

.quote-draft-groups {
  min-height: 24px;
  padding: 0 10px;
  color: #536078;
  font-size: 9px;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
}

.quote-draft-groups > span:first-child {
  grid-column: 1 / 3;
}

.quote-draft-offer-group {
  grid-column: 3;
  padding: 6px 8px;
  color: #294aa8;
  background: #dfe8ff;
  border: 1px solid #b9c9f2;
  border-radius: 6px;
  font-weight: 850;
  box-shadow: 0 1px 2px rgba(53, 88, 212, .08);
}

.quote-draft-margin-group {
  grid-column: 4;
  margin-left: 10px;
  padding: 5px 8px;
  color: #245c45;
  background: #dcefe4;
  border: 1px solid #bfdfcc;
  border-radius: 6px;
}

.quote-draft-groups > span:last-child {
  grid-column: 5;
}

.quote-draft-header {
  padding: 0 10px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.quote-draft-row {
  position: relative;
  min-height: 48px;
  padding: 0 0 0 10px;
  background: transparent;
  border: 0;
  font-size: 12px;
}

.quote-draft-header > *,
.quote-draft-row > * {
  min-width: 0;
  padding: 0 8px;
}

.quote-draft-row > :first-child,
.quote-draft-row > :nth-child(2),
.quote-draft-row > .quote-offer-columns {
  align-self: stretch;
  display: grid;
  align-content: center;
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.quote-draft-row > :first-child {
  padding-left: 10px;
  border-left: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
}

.quote-draft-row > .quote-offer-columns {
  padding: 0;
  border-right: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
}

.quote-draft-header > .quote-offer-columns,
.quote-draft-header > .quote-analysis-columns {
  padding: 0;
}

.quote-draft-header > .quote-analysis-columns,
.quote-draft-row > .quote-analysis-columns {
  width: calc(100% - 10px);
  margin-left: 10px;
}

.quote-draft-header > .quote-analysis-columns {
  color: #315f4b;
  background: #eaf5ef;
  border: 1px solid #d3e9dc;
  border-radius: 6px;
}

.quote-draft-header > .quote-analysis-columns > * {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 4px;
  padding-left: 4px;
  text-align: center;
}

.quote-draft-row > .quote-analysis-columns {
  align-self: stretch;
  padding: 0;
  background: #f1f8f4;
  border: 1px solid #d3e9dc;
  border-radius: 8px;
}

.quote-draft-row > .quote-line-delete {
  align-self: center;
  justify-self: end;
  width: 25px;
  min-width: 25px;
  height: 25px;
  margin-left: 0;
  padding: 5px;
  border-radius: 6px;
  transform: translateX(5px);
}

.quote-draft-row > .quote-line-delete svg {
  width: 13px;
  height: 13px;
}

.quote-code-cell {
  display: flex !important;
  align-items: center;
  gap: 7px;
}

.quote-bundle-parent > :first-child,
.quote-bundle-parent > :nth-child(2),
.quote-bundle-parent > .quote-offer-columns {
  background: #f7f8ff;
  border-color: #cfd8f4;
}

.quote-bundle-component > :first-child,
.quote-bundle-component > :nth-child(2),
.quote-bundle-component > .quote-offer-columns {
  background: #fbfcfe;
}

.quote-bundle-component > :first-child {
  padding-left: 22px;
  border-left-color: #9aace3;
}

.quote-bundle-component {
  min-height: 42px;
  padding-left: 18px;
  font-size: 11px;
}

.quote-bundle-component .quote-component-final-price {
  color: #a8adb5;
  font-weight: 600;
}

.quote-bundle-parent-expanded::before,
.quote-bundle-parent-expanded::after,
.quote-bundle-component::before,
.quote-bundle-component::after {
  position: absolute;
  z-index: 2;
  content: "";
  pointer-events: none;
  background: #7189d4;
}

.quote-bundle-parent-expanded::before {
  top: 50%;
  bottom: -6px;
  left: 4px;
  width: 2px;
}

.quote-bundle-parent-expanded::after {
  top: calc(50% - 1px);
  left: 4px;
  width: 6px;
  height: 2px;
}

.quote-bundle-component::before {
  top: -6px;
  bottom: -6px;
  left: 4px;
  width: 2px;
}

.quote-bundle-component-last::before {
  bottom: 50%;
}

.quote-bundle-component::after {
  top: calc(50% - 1px);
  left: 4px;
  width: 14px;
  height: 2px;
}

.quote-bundle-badge,
.quote-component-prefix {
  width: max-content;
  margin: 0 0 2px !important;
  color: #3558d4 !important;
  font-size: 8px !important;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.quote-bundle-summary {
  margin-top: 4px !important;
  color: var(--ink-soft) !important;
  font-size: 9px !important;
  font-weight: 600;
  line-height: 1.35;
  white-space: pre-line;
}

.quote-bundle-tools {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.quote-bundle-tools button {
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 0;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.project-commercial-compositions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: #f7f8fc;
  border: 1px solid #dfe4ef;
  border-radius: 10px;
}

.project-commercial-compositions > div,
.project-commercial-compositions article {
  display: grid;
  gap: 4px;
}

.project-commercial-compositions article {
  padding: 9px 10px;
  background: white;
  border: 1px solid #e2e6ef;
  border-radius: 8px;
}

.project-commercial-compositions small,
.project-commercial-compositions li,
.project-commercial-compositions p {
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.4;
}

.project-commercial-compositions ul,
.project-commercial-compositions p {
  margin: 2px 0 0;
  white-space: pre-line;
}

.project-commercial-compositions ul {
  padding-left: 18px;
}

.quote-draft-row strong {
  font-size: 12px;
}

.quote-line-number {
  display: flex;
  gap: 2px;
  align-items: center;
  min-height: 25px;
  padding: 1px 3px;
  background: #f7f8fb;
  border: 1px solid #d8dce5;
  border-radius: 7px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.quote-draft-row .quote-offer-columns > .quote-line-number {
  margin-right: 4px;
  margin-left: 4px;
  padding-right: 2px;
  padding-left: 2px;
}

.quote-line-number:focus-within {
  background: #fff;
  border-color: #8097dd;
  box-shadow: 0 0 0 3px rgba(72, 102, 194, .12);
}

.quote-line-number input {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  height: 21px;
  padding: 1px 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  outline: 0;
  font-size: 10px;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
}

.quote-line-number input:focus {
  border: 0;
  box-shadow: none;
  outline: 0;
}

.quote-line-number input::-webkit-inner-spin-button,
.quote-line-number input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.quote-line-number small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
}

.quote-line-discount-field {
  padding-right: 4px;
}

.quote-draft-description {
  display: grid;
  min-width: 0;
}

.quote-description-selector {
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.quote-draft-row[data-quote-select-key] > .quote-code-cell,
.quote-draft-row[data-quote-select-key] > .quote-draft-description {
  cursor: pointer;
}

.quote-draft-description:has(.quote-work-association-markers:not(:empty)) .quote-description-selector {
  padding-right: 42px;
}

.quote-bundle-parent > .quote-draft-description {
  background: #f7f8ff;
}

.quote-draft-row.quote-composition-target > :first-child,
.quote-draft-row.quote-composition-target > :nth-child(2),
.quote-draft-row.quote-composition-target > .quote-offer-columns {
  background: #edf2ff;
  border-color: #6e89db;
}

.quote-draft-row.quote-composition-target > :first-child {
  box-shadow: inset 3px 0 0 #3558d4;
}

.quote-supply-only-toggle {
  color: #975100;
  background: #fffdfa;
  border-color: #e5a24a;
}

.quote-supply-only-toggle:hover,
.quote-supply-only-toggle:focus-visible,
.quote-supply-only-toggle.is-active {
  color: #7d4100;
  background: #fff3df;
  border-color: #d9871d;
}

.quote-draft-row.quote-supply-only-line > :first-child,
.quote-draft-row.quote-supply-only-line > :nth-child(2),
.quote-draft-row.quote-supply-only-line > .quote-offer-columns,
.quote-draft-row.quote-supply-only-line > .quote-analysis-columns {
  border-color: #e5a24a;
}

.quote-draft-row.quote-supply-only-line > :first-child {
  box-shadow: inset 2px 0 0 #e5a24a;
}

.quote-draft-row.quote-supply-only-line.quote-composition-target > :first-child {
  box-shadow: inset 3px 0 0 #3558d4;
}

.quote-aggregate-description {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 7px;
  color: var(--ink);
  background: white;
  border: 1px solid #cfd8ef;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 750;
}

.quote-draft-description > strong,
.quote-draft-description > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-draft-supplier {
  overflow: hidden;
  color: #3e4b69;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-margin-value {
  display: grid;
  color: #18734c;
  line-height: 1.15;
  text-align: right;
}

.quote-margin-value strong {
  font-size: 11px;
  white-space: nowrap;
}

.quote-margin-value small {
  color: #4a8069;
  font-size: 10px;
  font-weight: 700;
}

.quote-margin-value.negative,
.quote-margin-value.negative strong,
.quote-margin-value.negative small,
.quote-compact-valuation .quote-valuation-margin strong.negative,
#crm-quote-rental-margin-amount.negative {
  color: #b23a32;
  font-weight: 800;
}

.quote-draft-total {
  background: transparent;
}

.conversion-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.conversion-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
  background: #eef6f1;
  border: 1px solid #cbe4d7;
  border-radius: 8px;
}

.conversion-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.conversion-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.project-commission-conversion {
  background: #f4f6ff;
  border-color: #cdd6f5;
}

.project-responsibility-panel {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  background: linear-gradient(135deg, #f7f8fd, #fffdfa);
  border: 1px solid #d8ddec;
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(49, 70, 124, .045);
}

.project-responsibility-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-responsibility-head > span:first-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.project-responsibility-head strong { font-size: 13px; }
.project-responsibility-head small { color: var(--ink-soft); font-size: 9px; }

.project-responsibility-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.project-responsibility-actions .compact {
  min-height: 32px;
  height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 9px;
}

.project-responsibility-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.project-responsibility-controls label {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.project-responsibility-controls label > span {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.project-responsibility-controls select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  font-size: 11px;
}

.project-responsibility-controls select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(53, 88, 212, .09);
}

.project-responsibility-controls select:disabled { opacity: .62; }
.project-responsibility-strip { padding: 4px 6px; }
.project-responsibility-history { margin-top: 0; }

.project-delivery-approved-input {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 9px;
  background: #f7f8fb;
  border: 1px solid #dce0e8;
  border-radius: 12px;
}

.project-delivery-input-head,
.project-approved-workflow-head,
.project-delivery-phase-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-delivery-input-head { justify-content: space-between; padding: 0 2px; }
.project-delivery-input-head > span:first-child,
.project-delivery-phase-heading > span { min-width: 0; display: grid; gap: 1px; }
.project-delivery-input-head strong,
.project-delivery-phase-heading strong { font-size: 12px; }
.project-delivery-input-head small,
.project-delivery-phase-heading small { color: var(--ink-soft); font-size: 8px; }

.project-technical-validation {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 8px 9px;
  background: #fff8e7;
  border: 1px solid #ead39a;
  border-radius: 9px;
}

.project-technical-validation.validated {
  background: #edf8f1;
  border-color: #b9dcc5;
}

.project-technical-validation-head,
.project-technical-validation-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.project-technical-validation-head { justify-content: space-between; }
.project-technical-validation-head > span:first-child { min-width: 0; display: grid; gap: 1px; }
.project-technical-validation-head strong { font-size: 11px; }
.project-technical-validation-head small,
.project-technical-validation-permission { color: var(--ink-soft); font-size: 8px; }
.project-technical-validation-actions { flex: 0 0 auto; }

.project-technical-validation-detail {
  min-width: 0;
  padding-top: 5px;
  border-top: 1px solid rgba(114, 102, 72, .16);
}

.project-technical-validation-detail summary {
  width: fit-content;
  color: #3d4e78;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.project-technical-validation-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-top: 7px;
}

.project-technical-validation-grid > span {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 6px 7px;
  background: rgba(255, 255, 255, .7);
  border-radius: 7px;
}

.project-technical-validation-grid small {
  color: var(--ink-soft);
  font-size: 7px;
  font-weight: 850;
  text-transform: uppercase;
}

.project-technical-validation-grid strong,
.project-technical-validation-grid p { margin: 0; font-size: 9px; }

@media (max-width: 760px) {
  .project-technical-validation-head { align-items: stretch; flex-direction: column; }
  .project-technical-validation-actions { flex-wrap: wrap; }
  .project-technical-validation-grid { grid-template-columns: 1fr; }
}

.project-approved-workflow {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 7px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid #dce1ec;
  border-radius: 9px;
}

.project-approved-workflow-head > span:first-child { min-width: 150px; display: grid; gap: 1px; margin-right: auto; }
.project-approved-workflow-head strong { font-size: 11px; }
.project-approved-workflow-head small { color: var(--ink-soft); font-size: 8px; }
.project-approved-workflow-head label { width: min(370px, 42vw); display: grid; gap: 2px; }
.project-approved-workflow-head label > span { color: var(--ink-soft); font-size: 7px; font-weight: 850; text-transform: uppercase; }
.project-approved-workflow-head select {
  width: 100%;
  min-width: 0;
  height: 31px;
  padding: 0 8px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 10px;
}

.project-delivery-phase-heading {
  margin: 3px 0 -1px;
  padding: 7px 9px;
  color: #293f80;
  background: linear-gradient(90deg, #edf1ff, rgba(237, 241, 255, .18));
  border-left: 3px solid var(--blue);
  border-radius: 7px;
}

.project-delivery-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cfd7ee;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(246, 248, 255, .96), rgba(255, 253, 248, .98));
  box-shadow: 0 8px 22px rgba(49, 70, 124, .06);
}

.project-delivery-head {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: left;
}

button.project-delivery-head:hover {
  background: rgba(53, 88, 212, .045);
}

.project-delivery-head > span:first-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.project-delivery-head strong {
  font-size: 13px;
}

.project-delivery-head small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.technical-status-badge.delivery-waiting_acceptance {
  color: #5d6570;
  background: #f1f2f4;
  border-color: #d1d5db;
}

.technical-status-badge.delivery-to_prepare {
  color: #865108;
  background: #fff4d9;
  border-color: #e8c36d;
}

.technical-status-badge.delivery-preparing {
  color: #294fa9;
  background: #edf1ff;
  border-color: #bdc9f3;
}

.technical-status-badge.delivery-ready,
.technical-status-badge.delivery-converted {
  color: #246844;
  background: #eaf7ef;
  border-color: #acd7bd;
}

.project-delivery-body {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px 11px 11px;
  border-top: 1px solid #dce2f0;
}

.project-delivery-notice {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  color: #80530b;
  background: #fff5dc;
  border: 1px solid #ead18c;
  border-radius: 9px;
  font-size: 11px;
}

.project-delivery-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, .35fr) auto;
  gap: 6px;
  align-items: end;
}

.project-delivery-panel .project-delivery-controls {
  grid-template-columns: minmax(150px, 220px);
}

.project-delivery-controls > label,
.project-delivery-close-date {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.project-delivery-controls label > span,
.project-delivery-close-date > span {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.project-delivery-controls select,
.project-delivery-note-row input,
.project-delivery-entry-row > input,
.project-delivery-entry-row > select,
.project-delivery-operational-row input,
.project-delivery-operational-row select,
.project-delivery-close-date input,
.project-delivery-ai-form input,
.project-delivery-ai-tools select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  font-size: 11px;
}

.project-delivery-controls select:focus,
.project-delivery-note-row input:focus,
.project-delivery-entry-row input:focus,
.project-delivery-entry-row select:focus,
.project-delivery-operational-row input:focus,
.project-delivery-operational-row select:focus,
.project-delivery-close-date input:focus,
.project-delivery-ai-form input:focus,
.project-delivery-ai-tools select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(53, 88, 212, .09);
}

.project-delivery-controls select:disabled,
.project-delivery-body input:disabled,
.project-delivery-body select:disabled,
.project-delivery-body button:disabled {
  opacity: .62;
  cursor: default;
}

.project-delivery-role-strip {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  padding: 5px 7px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .68);
  border-radius: 8px;
  font-size: 9px;
}

.project-delivery-role-strip > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.project-delivery-role-strip b {
  color: #55617a;
  font-size: 8px;
  text-transform: uppercase;
}

.project-delivery-role-strip i {
  color: #8894ad;
  font-style: normal;
}

.project-delivery-signature {
  margin-left: auto;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
}

.project-delivery-controls > .project-delivery-signature {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  margin-left: 0;
  padding: 0 9px;
  border-radius: 8px;
}

.project-delivery-signature.valid { color: #246844; background: #e7f5ec; }
.project-delivery-signature.warning { color: #995012; background: #fff0df; }

.project-delivery-role-strip .project-delivery-takeover {
  min-height: 24px;
  height: 24px;
  margin-left: auto;
  padding: 0 7px;
  font-size: 8px;
}

.project-delivery-role-strip .project-delivery-takeover + .project-delivery-signature {
  margin-left: 0;
}

.project-delivery-note-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.project-delivery-panel .primary-button.compact,
.project-delivery-panel .secondary-button.compact {
  min-height: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 10px;
  white-space: nowrap;
}

.project-delivery-checks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.project-delivery-checks span {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 750;
}

.project-delivery-checks .valid { color: #246844; background: #e7f5ec; }
.project-delivery-checks .warning { color: #915010; background: #fff0df; }

.project-delivery-supply {
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, .72);
  border: 1px solid #dce1ec;
  border-radius: 9px;
}

.project-delivery-supply > summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 5px 8px;
  cursor: pointer;
  list-style: none;
}

.project-delivery-supply > summary::-webkit-details-marker { display: none; }
.project-delivery-supply > summary > span { min-width: 0; display: grid; gap: 1px; }
.project-delivery-supply > summary strong { font-size: 11px; }
.project-delivery-supply > summary small { color: var(--ink-soft); font-size: 8px; }
.project-delivery-supply > summary > i { color: var(--ink-soft); font-style: normal; transition: transform .16s ease; }
.project-delivery-supply[open] > summary > i { transform: rotate(180deg); }

.project-delivery-supply-list {
  display: grid;
  gap: 4px;
  padding: 0 6px 6px;
}

.project-delivery-supply-row {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 5px 6px;
  background: #fbfcff;
  border: 1px solid #e4e7ef;
  border-radius: 7px;
}

.project-delivery-supply-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(72px, .22fr) minmax(160px, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.project-delivery-supply-main b,
.project-delivery-supply-main strong,
.project-delivery-supply-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-delivery-supply-main b { font-size: 9px; }
.project-delivery-supply-main strong { font-size: 10px; }
.project-delivery-supply-main small { color: var(--ink-soft); font-size: 8px; text-align: right; }

.project-delivery-supply-components {
  display: grid;
  gap: 2px;
  padding-left: 30px;
}

.project-delivery-supply-components > span {
  min-width: 0;
  display: grid;
  grid-template-columns: 12px minmax(70px, .22fr) minmax(130px, 1fr) auto;
  align-items: center;
  gap: 4px;
  color: #586174;
  font-size: 8px;
}

.project-delivery-supply-components i { font-style: normal; }
.project-delivery-supply-components em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; }

.project-delivery-supply-links,
.project-delivery-unassociated {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

.project-delivery-supply-links { padding-left: 30px; }
.project-delivery-supply-links span,
.project-delivery-unassociated span {
  padding: 3px 6px;
  color: #3152a7;
  background: #edf1ff;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 700;
}

.project-delivery-supply-unlinked { padding-left: 30px; color: #9b5b19; font-size: 8px; }
.project-delivery-service-note { padding-left: 30px; color: #737b80; font-size: 8px; font-weight: 400; line-height: 1.2; }
.project-delivery-unassociated { margin: 0 6px 6px; padding: 5px 6px; background: #fff8e9; border-radius: 7px; }
.project-delivery-unassociated b { margin-right: 3px; color: #7d5517; font-size: 8px; }

.project-delivery-plan-summary,
.project-delivery-subhead,
.project-delivery-final-row,
.project-delivery-ai-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.project-delivery-plan-summary {
  padding-top: 3px;
  border-top: 1px solid #e2e5ec;
}

.project-delivery-plan-summary > span,
.project-delivery-subhead > span:first-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.project-delivery-plan-summary strong,
.project-delivery-subhead strong {
  font-size: 11px;
}

.project-delivery-plan-summary small,
.project-delivery-subhead small {
  color: var(--ink-soft);
  font-size: 8px;
}

.project-delivery-baseline-list,
.project-delivery-operational-list {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.project-delivery-baseline-list {
  max-height: 230px;
  overflow-y: auto;
  padding: 5px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid #e0e4ed;
  border-radius: 9px;
}

.project-delivery-baseline-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 4px 6px;
  background: #fff;
  border: 1px solid #e3e6ec;
  border-radius: 7px;
}

.project-delivery-baseline-row > span:first-child {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #5268ac;
  background: #edf1ff;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 850;
}

.project-delivery-baseline-row > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.project-delivery-baseline-row strong,
.project-delivery-baseline-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-delivery-baseline-row strong { font-size: 10px; }
.project-delivery-baseline-row small { color: var(--ink-soft); font-size: 8px; }

.delivery-origin {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: #53607b;
  background: #eef1f6;
  border: 1px solid #d8dde7;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.delivery-origin.origin-quote { color: #275f43; background: #e8f6ee; border-color: #bcdfca; }
.delivery-origin.origin-solution_architect { color: #3652a0; background: #edf1ff; border-color: #ccd5f5; }
.delivery-origin.origin-pm_template { color: #855308; background: #fff3d7; border-color: #e8c875; }
.delivery-origin.origin-pm_ai { color: #683b95; background: #f3eaff; border-color: #d8c0ee; }

.project-delivery-entry-row,
.project-delivery-operational-row {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 5px;
}

.project-delivery-entry-row {
  grid-template-columns: 76px minmax(155px, 1fr) minmax(125px, .7fr) 106px 104px 116px 68px;
  grid-template-areas: "type title group duration position economic button";
  padding: 6px;
  background: #f2f4fb;
  border: 1px solid #dce1ee;
  border-radius: 9px;
}

#project-delivery-entry-type { grid-area: type; }
#project-delivery-entry-title,
#project-delivery-entry-template { grid-area: title; }
#project-delivery-entry-group { grid-area: group; }
.project-delivery-entry-row > .project-delivery-mini-duration { grid-area: duration; }
#project-delivery-entry-position { grid-area: position; }
#project-delivery-entry-economic { grid-area: economic; }
.project-delivery-entry-row > button { grid-area: button; }

.project-delivery-operational-row {
  grid-template-columns: 58px minmax(155px, 1fr) minmax(125px, .72fr) 47px 22px 106px 104px 116px;
  grid-template-areas: "origin copy group move delete duration position economic";
  padding: 3px 5px;
  background: #fff;
  border: 1px solid #e0e3ea;
  border-radius: 8px;
}

.project-delivery-operational-row > .delivery-origin { grid-area: origin; }
.project-delivery-step-copy { grid-area: copy; min-width: 0; display: grid; gap: 1px; }
.project-delivery-step-copy small { color: var(--ink-soft); font-size: 7px; padding-left: 4px; }
.project-delivery-step-group { grid-area: group; }
.project-delivery-operational-row > .project-delivery-mini-duration { grid-area: duration; }
.project-delivery-step-position { grid-area: position; }
.project-delivery-step-economic { grid-area: economic; }
.project-delivery-move-actions {
  grid-area: move;
  display: grid;
  grid-template-columns: repeat(2, 22px);
  gap: 3px;
}
.project-delivery-move-actions .icon-button {
  width: 22px;
  min-width: 22px;
  height: 27px;
  min-height: 27px;
  padding: 0;
  border-radius: 6px;
  font-size: 10px;
}
.project-delivery-delete {
  grid-area: delete;
  width: 22px;
  min-width: 22px;
  height: 27px;
  min-height: 27px;
  padding: 0;
  border-radius: 8px;
}

.project-delivery-operational-row input,
.project-delivery-operational-row select {
  height: 31px;
  font-size: 10px;
}

.project-delivery-mini-duration {
  min-width: 0;
  height: 34px;
  display: grid;
  grid-template-columns: minmax(28px, 1fr) 12px minmax(28px, 1fr) 12px;
  align-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-delivery-mini-duration input {
  width: 100%;
  min-width: 0;
  height: 30px !important;
  padding: 0 2px !important;
  border: 0 !important;
  border-radius: 0 !important;
  text-align: right;
  box-shadow: none !important;
  appearance: textfield;
  -moz-appearance: textfield;
}

.project-delivery-mini-duration input::-webkit-inner-spin-button,
.project-delivery-mini-duration input::-webkit-outer-spin-button { appearance: none; }

.project-delivery-mini-duration span {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 750;
}

.project-delivery-delete {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  height: 30px;
  padding: 0;
  border-radius: 7px;
  font-size: 15px;
}

.project-delivery-ai {
  overflow: hidden;
  background: rgba(245, 247, 255, .72);
  border: 1px solid #d9dff0;
  border-radius: 9px;
}

.project-delivery-subhead {
  width: 100%;
  min-height: 40px;
  padding: 6px 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: left;
}

.project-delivery-ai-provider {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.project-delivery-ai-provider .business-badge {
  min-height: 22px;
  font-size: 8px;
  text-transform: none;
}

.project-delivery-ai-provider img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.project-delivery-subhead > .project-delivery-ai-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.project-delivery-ai-title > img {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  object-fit: contain;
}

.project-delivery-ai-title > span { min-width: 0; display: grid; gap: 1px; }

.project-manager-ai-section {
  margin: 0;
  padding: 10px;
  border-radius: 12px;
}

.project-delivery-ai-heading {
  min-width: 0;
  display: flex !important;
  align-items: center;
  gap: 8px !important;
}

.project-delivery-ai-heading > img {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  object-fit: contain;
}

.project-delivery-ai-heading > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.project-delivery-ai-heading strong { font-size: 12px; }
.project-delivery-ai-heading small { font-size: 9px; }

.project-manager-ai-layout {
  grid-template-columns: minmax(300px, .9fr) minmax(390px, 1.1fr);
  gap: 8px;
}

.project-manager-ai-chat,
.project-manager-ai-proposal {
  margin: 0;
  padding: 8px;
  border-radius: 10px;
}

.project-manager-ai-chat .solution-ai-messages {
  min-height: 102px;
  max-height: 250px;
  margin-top: 7px;
}

.project-manager-ai-chat-form textarea {
  min-height: 46px;
  max-height: 100px;
  padding: 7px 9px;
  border: 1px solid #d6dbea;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}

.project-manager-ai-chat-form .primary-button,
.project-manager-ai-section .solution-ai-heading-actions .compact {
  min-height: 32px;
  height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 9px;
}

.project-manager-ai-proposal .solution-ai-proposal-list {
  max-height: 300px;
}

.project-manager-ai-proposal .solution-ai-proposal-row {
  padding: 6px;
  font-size: 10px;
}

.quote-delivery-ai-proposal-row > span:nth-child(3) {
  overflow-wrap: anywhere;
}

.quote-delivery-ai-proposal-row > span:last-child {
  min-width: 48px;
  justify-content: center;
  white-space: nowrap;
}

.project-manager-ai-proposal .solution-workflow-index {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 9px;
}

.project-delivery-ai-empty {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--ink-soft);
  text-align: left;
}

.project-delivery-ai-empty > span:last-child { display: grid; gap: 2px; }
.project-delivery-ai-empty strong { color: var(--ink); font-size: 10px; }
.project-delivery-ai-empty small { font-size: 8px; }

@media (max-width: 760px) {
  .project-approved-workflow-head { align-items: flex-start; flex-wrap: wrap; }
  .project-approved-workflow-head > span:first-child { width: 100%; }
  .project-approved-workflow-head label { width: 100%; }
  .project-manager-ai-section .solution-section-heading,
  .project-manager-ai-section .solution-ai-heading-actions { align-items: flex-start; }
  .project-manager-ai-section .solution-ai-heading-actions { flex-wrap: wrap; }
  .project-manager-ai-layout { grid-template-columns: minmax(0, 1fr); }
  .project-delivery-supply-main {
    grid-template-columns: auto minmax(65px, .3fr) minmax(120px, 1fr);
  }
  .project-delivery-supply-main > small { grid-column: 2 / -1; text-align: left; }
  .project-delivery-supply-components { padding-left: 12px; }
  .project-delivery-supply-components > span {
    grid-template-columns: 12px minmax(60px, .35fr) minmax(100px, 1fr);
  }
  .project-delivery-supply-components > span > small { grid-column: 2 / -1; }
  .project-delivery-supply-links,
  .project-delivery-supply-unlinked { padding-left: 12px; }
  .project-delivery-service-note { padding-left: 12px; }
}

.project-delivery-ai.expanded .project-delivery-ai-provider > i { transform: rotate(180deg); }

.project-delivery-ai-body {
  display: grid;
  gap: 6px;
  padding: 7px;
  border-top: 1px solid #dde2f1;
}

.project-delivery-ai-tools {
  justify-content: flex-end;
}

.project-delivery-ai-tools > span {
  margin-right: auto;
  color: var(--ink-soft);
  font-size: 8px;
}

.project-delivery-ai-tools label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-delivery-ai-tools select { width: 116px; height: 30px; }

.project-delivery-ai-messages {
  display: grid;
  gap: 4px;
  max-height: 150px;
  overflow-y: auto;
}

.project-delivery-ai-messages p {
  max-width: 92%;
  margin: 0;
  padding: 5px 7px;
  color: var(--ink-soft);
  background: #fff;
  border-radius: 7px;
  font-size: 9px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.project-delivery-ai-messages p.user {
  justify-self: end;
  background: #eaf0ff;
}

.project-delivery-ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
}

.project-delivery-ai-proposal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  max-height: 210px;
  overflow-y: auto;
}

.project-delivery-ai-proposal label {
  min-width: 0;
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  padding: 5px 6px;
  background: #fff;
  border: 1px solid #e0e4ed;
  border-radius: 7px;
}

.project-delivery-ai-proposal input { width: 14px; height: 14px; margin: 0; }
.project-delivery-ai-proposal span { min-width: 0; display: grid; gap: 1px; }
.project-delivery-ai-proposal strong,
.project-delivery-ai-proposal small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-delivery-ai-proposal strong { font-size: 9px; }
.project-delivery-ai-proposal small { color: var(--ink-soft); font-size: 7px; }

.project-delivery-final-row {
  justify-content: flex-end;
  flex-wrap: wrap;
  padding-top: 3px;
  border-top: 1px solid #e2e5ec;
}

.project-delivery-close-date {
  width: 170px;
  margin-right: auto;
}

.project-delivery-history {
  padding: 5px 7px;
  background: rgba(255, 255, 255, .58);
  border-radius: 7px;
  font-size: 8px;
}

.project-delivery-history summary {
  color: #526284;
  font-weight: 800;
  cursor: pointer;
}

.project-delivery-history p {
  margin: 5px 0 0;
  color: var(--ink-soft);
}

@media (max-width: 1180px) {
  .project-responsibility-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-delivery-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-delivery-controls > label:first-child { grid-column: 1 / -1; }

  .project-delivery-entry-row {
    grid-template-columns: 76px minmax(145px, 1fr) minmax(120px, .8fr) 106px;
    grid-template-areas:
      "type title title group"
      "duration position economic button";
  }

  .project-delivery-operational-row {
    grid-template-columns: 58px minmax(145px, 1fr) minmax(120px, .8fr) 47px 22px 104px 116px;
    grid-template-areas:
      "origin copy group move delete position economic"
      ". duration duration . . position economic";
  }
  .realtes-signature-upload {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .project-assignment-heading > span { align-items: flex-start; flex-direction: column; gap: 1px; }
  .project-assignment-fields { grid-template-columns: minmax(0, 1fr); }
  .project-brief-grid,
  .project-brief-readonly-grid,
  .solution-review-form { grid-template-columns: minmax(0, 1fr); }
  .project-responsibility-head { align-items: flex-start; }
  .project-responsibility-controls { grid-template-columns: minmax(0, 1fr); }
  .project-responsibility-actions { flex-wrap: wrap; justify-content: flex-end; }
  .project-delivery-controls { grid-template-columns: minmax(0, 1fr); }
  .project-delivery-controls > label:first-child { grid-column: auto; }
  .project-delivery-entry-row,
  .project-delivery-operational-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: none;
  }
  .project-delivery-entry-row > *,
  .project-delivery-operational-row > * { grid-area: auto; }
  .project-delivery-step-copy,
  .project-delivery-entry-row > input,
  .project-delivery-entry-row > select[hidden] + select,
  .project-delivery-operational-row > .project-delivery-step-copy { grid-column: 1 / -1; }
  .project-delivery-ai-proposal { grid-template-columns: minmax(0, 1fr); }
  .project-delivery-final-row { align-items: stretch; }
  .project-delivery-close-date { width: 100%; }
}

.project-conversion-close-date {
  width: min(100%, 320px);
  margin-top: 12px;
}

.resource-availability-card {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.4;
}

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

.resource-availability-card.available {
  color: #286343;
  background: #edf8f1;
  border-color: #bfe0cc;
}

.resource-availability-card.conflict {
  color: #86410a;
  background: #fff4df;
  border-color: #edcc91;
}

.resource-availability-card.neutral {
  color: #536071;
  background: #f5f7fa;
  border-color: #d9dee7;
}

.resource-availability-card small {
  font-weight: 750;
}

.resource-override-button {
  justify-self: start;
  margin-top: 7px;
}

.resource-override-button.active,
.resource-override-button[aria-pressed="true"] {
  color: #8a4100;
  background: #fff0d5;
  border-color: #e5b35a;
}

.workflow-builder {
  display: grid;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f8ff;
  container-type: inline-size;
}

.crm-work-hour-summary {
  margin: 8px 0;
}

.crm-work-hour-summary output {
  display: flex;
  min-height: 40px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  color: var(--text);
  font-weight: 700;
}

.quote-workflow-builder .crm-work-hour-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
}

.quote-workflow-builder .crm-work-hour-summary .field {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.quote-workflow-builder .crm-work-hour-summary output {
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
}

.field > .duration-input-mask {
  display: grid;
  grid-template-columns: minmax(68px, 1fr) auto minmax(68px, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

.duration-input-mask:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.duration-input-mask input[type="number"] {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 3px 4px;
  border: 0;
  background: transparent;
  text-align: center;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.duration-input-mask input[type="number"]::-webkit-inner-spin-button,
.duration-input-mask input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.duration-input-part {
  display: grid;
  grid-template-columns: 24px minmax(24px, 1fr) 24px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 2%, white);
}

.duration-input-part:focus-within {
  border-color: var(--accent);
}

.duration-input-part button {
  display: grid;
  min-width: 24px;
  min-height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, white);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.duration-input-part button:first-child {
  border-right: 1px solid var(--line);
}

.duration-input-part button:last-child {
  border-left: 1px solid var(--line);
}

.duration-input-part button:hover,
.duration-input-part button:focus-visible {
  color: white;
  background: var(--accent);
  outline: 0;
}

.duration-input-part button:active {
  transform: scale(0.94);
}

.duration-input-part button:disabled {
  color: color-mix(in srgb, var(--ink-soft) 55%, white);
  background: #f5f6f9;
  cursor: default;
  transform: none;
}

.field > .duration-input-mask b {
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

.workflow-builder-heading,
.workflow-step-editor,
.workflow-step-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}

.workflow-builder-heading {
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.workflow-builder-heading-actions {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  max-width: 100%;
  gap: 7px;
}

.workflow-builder-heading div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.workflow-builder-heading small,
.workflow-step-copy small {
  color: var(--ink-soft);
}

.workflow-step-editor {
  flex-wrap: wrap;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

.quote-workflow-entry-editor {
  display: grid;
  grid-template-columns: 47px minmax(180px, 1fr) 150px 180px 72px 90px 170px auto;
  align-items: end;
  gap: 7px;
  padding: 8px 8px 8px 0;
  border: 1px solid color-mix(in srgb, var(--accent) 13%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 2%, white);
}

.quote-workflow-entry-editor .field {
  min-width: 0;
  margin: 0;
}

.quote-workflow-entry-editor.workflow-step-editor .compact-number {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
}

#crm-quote-step-skill,
#crm-project-step-skill { padding-right: 22px; }

.quote-workflow-rate-input {
  display: flex;
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  align-items: center;
  gap: 3px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.quote-workflow-rate-input[hidden] { display: none; }

.quote-workflow-rate-input input {
  width: 0;
  min-width: 0;
  min-height: 38px !important;
  flex: 1;
  padding: 0 !important;
  border: 0 !important;
  text-align: right;
  box-shadow: none !important;
}

.quote-workflow-rate-input b { color: var(--ink-soft); font-size: 10px; white-space: nowrap; }
.quote-workflow-rate-input button {
  display: grid;
  width: 20px;
  min-width: 20px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
}
.quote-workflow-rate-input button:hover { color: var(--blue); background: #f2f5ff; }

.quote-workflow-entry-editor.workflow-step-editor .duration-field {
  width: 170px;
  min-width: 0;
  max-width: 170px;
  grid-column: 7;
}

.quote-workflow-entry-editor .workflow-people-field { grid-column: 5; }
.quote-workflow-entry-editor .workflow-location-field { grid-column: 6; }
.quote-workflow-entry-editor.workflow-step-editor .workflow-people-field {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
}
.quote-workflow-entry-editor .workflow-location-field {
  width: 90px;
  min-width: 90px;
  max-width: 90px;
}

.quote-workflow-entry-editor .workflow-location-field select {
  width: 90px;
  min-width: 90px;
  max-width: 90px;
  padding: 6px 17px 6px 5px;
  font-size: 10px;
}

.quote-workflow-entry-editor:not(:has(#crm-quote-use-activity-template:checked)) #crm-quote-step-skill-field[hidden] {
  display: block !important;
  visibility: hidden;
  pointer-events: none;
}

.quote-workflow-entry-editor:has(#crm-quote-use-activity-template:checked) .quote-workflow-description-field {
  grid-column: 2 / 7;
}

.quote-workflow-entry-editor:has(#crm-quote-use-activity-template:checked) #crm-quote-activity-template {
  height: 42px;
  min-height: 42px;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background-color: color-mix(in srgb, var(--accent) 4%, white);
  color: var(--ink);
  font-weight: 700;
}

.project-workflow-entry-editor:has(#crm-project-use-activity-template:checked) .quote-workflow-description-field {
  grid-column: 2 / 7;
}

.project-workflow-entry-editor:has(#crm-project-use-activity-template:checked) #crm-project-step-phase-template {
  height: 42px;
  min-height: 42px;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background-color: color-mix(in srgb, var(--accent) 4%, white);
  color: var(--ink);
  font-weight: 700;
}

.project-workflow-entry-editor:not(:has(#crm-project-use-activity-template:checked)) #crm-project-step-skill-field[hidden] {
  display: block !important;
  visibility: hidden;
  pointer-events: none;
}

.quote-workflow-template-toggle {
  position: relative;
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  align-self: end;
  justify-self: start;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.quote-workflow-template-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quote-workflow-template-switch {
  display: none;
}

.quote-workflow-template-icon {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.quote-workflow-template-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(23, 33, 31, 0.22);
  transition: transform 150ms ease;
}

.quote-workflow-template-toggle:has(input:checked) {
  border-color: #6842d8;
  background: #6842d8;
  color: #fff;
  box-shadow: 0 3px 10px rgba(104, 66, 216, 0.34);
}

.quote-workflow-template-toggle:has(input:checked)::after {
  content: "✓";
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #20a464;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
}

.quote-workflow-template-toggle input:checked + .quote-workflow-template-switch {
  background: var(--accent);
}

.quote-workflow-template-toggle input:checked + .quote-workflow-template-switch::after {
  transform: translateX(12px);
}

.quote-workflow-template-toggle:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.quote-workflow-entry-editor .duration-input-mask {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: minmax(48px, 1fr) auto minmax(48px, 1fr) auto;
  gap: 2px;
  height: 42px;
  min-height: 42px;
  padding: 3px;
  box-sizing: border-box;
}

.quote-workflow-entry-editor .duration-field > .duration-input-mask { height: 42px; min-height: 42px; }

.project-workflow-entry-editor #crm-project-step-duration-note { display: none; }

.quote-workflow-entry-editor .duration-input-part {
  min-width: 0;
  grid-template-columns: 18px minmax(14px, 1fr) 18px;
}

.quote-workflow-entry-editor .duration-input-part button {
  width: 18px;
  min-width: 18px;
  min-height: 26px;
  padding: 0;
  font-size: 13px;
}

.quote-workflow-entry-editor .duration-input-mask input[type="number"] {
  min-height: 26px;
  padding-inline: 1px;
}

.workflow-insert-icon {
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  align-self: end;
  place-items: center;
  padding: 0;
  line-height: 1;
}

.quote-workflow-insert-actions {
  display: flex;
  grid-column: 8;
  align-self: end;
  justify-self: end;
  gap: 6px;
  padding-left: 2px;
  min-width: 90px;
  flex: 0 0 90px;
}

.project-workflow-extra {
  margin: -2px 0 0 54px;
  padding: 0;
  border: 0;
}

.project-workflow-extra > summary {
  width: max-content;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.project-workflow-extra-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
  align-items: end;
  gap: 7px;
  margin-top: 5px;
  padding: 7px;
  border: 1px solid #dfe4ef;
  border-radius: 8px;
  background: rgba(255, 255, 255, .65);
}

.project-workflow-extra-grid .field { margin: 0; }
.project-workflow-extra-grid textarea { min-height: 34px; height: 34px; resize: vertical; }
.project-workflow-extra-grid small { font-size: 9px; }

@media (max-width: 820px) {
  .project-workflow-extra { margin-left: 0; }
  .project-workflow-extra-grid { grid-template-columns: 1fr; }
}

.workflow-insert-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quote-labor-row > :first-child,
.quote-labor-row > :nth-child(2),
.quote-labor-row > .quote-offer-columns {
  background: #f8faff;
  border-color: #cfd8f4;
}

.quote-labor-row .quote-draft-description input {
  width: 100%;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.quote-labor-row .quote-draft-description input:hover,
.quote-labor-row .quote-draft-description input:focus {
  border-color: #b9c9f2;
  background: white;
  outline: 0;
}

.workflow-step-editor .field {
  min-width: 135px;
  flex: 1 1 145px;
}

.workflow-step-editor .workflow-step-title {
  flex-basis: 220px;
}

.workflow-step-editor .compact-number {
  max-width: 120px;
}

.workflow-step-editor .duration-field {
  min-width: 300px;
  max-width: 360px;
  flex: 1 1 320px;
}

.workflow-step-list {
  display: grid;
  gap: 6px;
}

.workflow-step-row {
  align-items: center;
  padding: 7px 9px;
  border: 1px solid #d9dfef;
  border-radius: 8px;
  background: #fff;
}

.workflow-step-row.is-branch {
  margin-left: 18px;
  border-left: 3px solid #7c8fec;
}

.workflow-step-position {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  background: #3558d4;
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}

.workflow-step-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.timeline-list {
  display: grid;
  gap: 9px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 13px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.timeline-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--event-color, var(--ink));
  border-radius: 8px;
}

.crm-event-icon {
  flex: 0 0 auto;
  background: var(--event-color, var(--ink));
}

.crm-event-icon.compact {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 8px;
}

.crm-event-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.timeline-row small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 11px;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.placeholder-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.placeholder-card svg {
  color: var(--blue);
}

.placeholder-card strong {
  font-size: 18px;
}

.placeholder-card span {
  color: var(--ink-soft);
  font-size: 12px;
}

.empty-business {
  padding: 18px;
  color: var(--ink-soft);
  background: white;
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.empty-business.compact {
  padding: 12px;
  font-size: 11px;
}

.inline-toggle {
  min-height: 42px;
  align-self: end;
  margin-bottom: 16px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.section-heading > div:first-child {
  min-width: 0;
}

.section-heading .eyebrow {
  margin-bottom: 6px;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.section-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  min-width: 0;
}

.section-actions[hidden] {
  display: none !important;
}

.gantt-actions {
  width: max-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.search-box {
  min-width: 270px;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 88, 212, 0.1);
}

.search-box svg {
  width: 17px;
  color: #858b88;
}

.search-box input {
  width: 100%;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
}

.filter-count {
  min-width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  color: white;
  background: var(--blue);
  border-radius: 10px;
  font-size: 10px;
}

.completed-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
  white-space: nowrap;
}

.completed-toggle > span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: transparent;
  background: white;
  border: 1.5px solid #aeb5b1;
  border-radius: 6px;
}

.completed-toggle svg {
  width: 13px;
  height: 13px;
}

.completed-toggle.active {
  color: #257150;
  background: #edf8f2;
  border-color: #b7dccb;
}

.completed-toggle.active > span {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.scheduled-filter-toggle.active {
  color: #3151b5;
  background: #eef2ff;
  border-color: #cbd7ff;
}

.scheduled-filter-toggle.active > span {
  background: #3151b5;
  border-color: #3151b5;
}

.filters-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  align-items: stretch;
  gap: 12px;
  margin-top: 24px;
  padding: 17px;
  background: #f5f3ed;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.filter-field {
  min-width: 0;
  margin: 0;
  padding: 13px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.filter-field legend,
.sort-field > span,
.template-tools label > span,
.field {
  color: var(--ink-soft);
}

.filter-field legend,
.sort-field > span,
.template-tools label > span,
.field > span {
  font-family: var(--ui-field-font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field > small {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.45;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.filter-options label {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.filter-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-options label span {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  color: var(--ink-soft);
  background: #f7f5ef;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 680;
}

.filter-options input:checked + span {
  color: var(--blue);
  background: var(--blue-pale);
  border-color: #cbd4ff;
}

.filter-options .admin-option input:checked + span {
  color: #257150;
  background: #e6f4ed;
  border-color: #b7dccb;
}

.sort-field,
.template-tools label,
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sort-field {
  align-self: end;
}

.sort-field select,
.template-tools select,
.template-tools input,
.field input,
.field textarea,
.field select,
.quote-line-subscription-term {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  font-size: 13px;
  font-family: var(--ui-field-font);
}

.field-label {
  font-family: var(--ui-field-font);
}

.filter-footer {
  display: flex;
  align-items: end;
}

.template-tools {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(180px, 1fr) auto auto minmax(190px, 1fr) auto;
  align-items: end;
  gap: 9px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.template-heading {
  align-self: center;
}

.template-heading strong {
  display: block;
  font-size: 12px;
}

.template-heading span {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.danger-icon {
  color: #b94736;
}

.price-list-delete {
  width: 30px;
  height: 30px;
}

.field textarea {
  min-height: 84px;
  padding-top: 11px;
  resize: vertical;
}

.sort-field select:focus,
.template-tools select:focus,
.template-tools input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus,
.quote-line-subscription-term:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 88, 212, 0.09);
}

.text-button {
  height: 42px;
  padding: 0 8px;
  color: var(--blue);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 750;
}

.list-meta,
.gantt-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 1px 14px;
  color: var(--ink-soft);
  font-size: 11px;
}

.list-meta p,
.gantt-caption p {
  margin: 0;
}

.list-meta strong {
  color: var(--ink);
}

.priority-legend {
  display: flex;
  gap: 14px;
}

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

.legend-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
}

.legend-dot.critical { background: var(--coral); }
.legend-dot.high { background: var(--amber); }
.legend-dot.medium { background: var(--blue); }
.legend-dot.low { background: var(--green); }

.task-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.overdue-task-section {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
  background: #fff4ee;
  border: 1px solid #f2b9a4;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(164, 62, 48, 0.08);
}

.overdue-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 4px 4px 8px;
  color: #8d4035;
  background: transparent;
  border: 0;
  text-align: left;
}

.overdue-task-header strong {
  display: block;
  color: #8d4035;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overdue-task-header small {
  display: block;
  margin-top: 2px;
  color: #a96555;
  font-size: 11px;
  font-weight: 650;
}

.overdue-task-toggle {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: #8d4035;
  background: #ffe4da;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.overdue-task-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.overdue-task-section.is-collapsed .overdue-task-list {
  display: none;
}

.overdue-task-section .task-card {
  border-color: #f0b39f;
}

.task-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 1.45fr) 125px 50px auto;
  align-items: center;
  gap: 18px;
  min-height: 96px;
  padding: 14px 15px 14px 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: 160ms ease;
  overflow: hidden;
}

.task-card.has-no-deadline {
  grid-template-columns: minmax(280px, 1.6fr) 50px auto;
}

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

.task-card:hover {
  border-color: #bbb7ae;
  box-shadow: 0 10px 24px rgba(32, 38, 36, 0.07);
  transform: translateY(-1px);
}

.task-card.is-done {
  background: #fbfaf7;
}

.task-card.is-action-blocked {
  background: #fff8ed;
}

.task-card.has-closed-action {
  border: 4px solid #00e676;
  box-shadow: 0 0 0 2px rgba(0, 230, 118, 0.24);
}

.task-card.is-done .task-name {
  color: #7b827f;
  text-decoration: line-through;
}

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

.task-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-name-highlight {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 6px;
  padding: 4px 8px;
  color: #174e75;
  background: #e8f3fb;
  border: 1px solid #c3deef;
  border-radius: 7px;
}

.client-name-highlight > strong {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-name-highlight.compact {
  margin-top: 4px;
  padding: 3px 6px;
  border-radius: 6px;
}

.client-name-highlight.compact > strong {
  font-size: 9px;
}

.task-description {
  flex: 1 0 100%;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}

.object-creator {
  color: #777d79;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.3;
}

.object-creator-block {
  display: block;
  margin-top: 6px;
}

.task-subline {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  overflow: visible;
  margin-top: 5px;
  white-space: normal;
}

.task-operational-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  color: #244aa5;
  background: #eef3ff;
  border: 1px solid #bfd0ff;
  border-radius: 9px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.task-operational-link:hover:not(:disabled) {
  color: #173683;
  background: #e1eaff;
  border-color: #91acf8;
}

.task-operational-link.compact {
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
}

.task-operational-link svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-operational-link:disabled {
  color: #777d86;
  background: #f1f2f4;
  border-color: #d8dbe1;
  cursor: not-allowed;
  opacity: .75;
}

.task-assignment-panel > .task-operational-link {
  margin-bottom: 10px;
}

.active-work-meta .task-operational-link {
  color: #173c91;
  background: rgba(255, 255, 255, .92);
  border-color: rgba(255, 255, 255, .72);
}

.commission-badge {
  max-width: min(100%, 320px);
  white-space: normal;
}

.group-badge {
  flex: 0 0 auto;
  padding: 3px 6px;
  color: var(--blue);
  background: var(--blue-pale);
  border-radius: 5px;
  font-size: 9px;
  font-weight: 760;
}

.commission-badge,
.opportunity-badge,
.blocked-badge,
.assignment-badge,
.action-badge,
.action-closed-badge,
.schedule-badge,
.scheduled-work-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.commission-badge {
  color: #6d5318;
  background: #fff2cf;
}

.opportunity-badge {
  color: #235a84;
  background: #e1f1ff;
}

.blocked-badge {
  color: #8d4035;
  background: #fbe3de;
}

.action-badge {
  color: #a05710;
  background: #fff1dc;
}

.action-closed-badge {
  color: #257150;
  background: #e6f4ed;
}

.schedule-badge {
  color: #3151b5;
  background: #e7edff;
}

.schedule-badge.due {
  color: #b9362c;
  background: #ffe0db;
}

.scheduled-work-badge {
  color: #25604b;
  background: #e5f3ed;
}

.task-schedule-inline {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.task-schedule-inline > span {
  flex: 0 0 auto;
  padding-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.schedule-occurrence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.schedule-occurrence {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  color: #3151b5;
  background: #eef2ff;
  border: 1px solid #cbd7ff;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 850;
  text-align: left;
}

.schedule-occurrence.compact {
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
}

.schedule-occurrence:not(:disabled):hover {
  border-color: #8fa5f0;
  background: #e3eaff;
}

.schedule-occurrence:disabled {
  cursor: default;
  opacity: 0.72;
}

.schedule-occurrence.is-due:not(.is-completed) {
  color: #b9362c;
  background: #ffe0db;
  border-color: #f0b6aa;
}

.schedule-occurrence.is-completed {
  color: #257150;
  background: #e6f4ed;
  border-color: #bcdaca;
}

.schedule-occurrence-check {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: white;
  border: 1.4px solid currentColor;
  border-radius: 999px;
}

.schedule-occurrence-check svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.schedule-occurrence-date {
  white-space: nowrap;
}

.schedule-occurrence small {
  display: block;
  color: inherit;
  font-size: 9px;
  font-weight: 650;
  opacity: 0.78;
}

.mini-action-bell {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #a05710;
  background: #fff1dc;
  border-radius: 999px;
  vertical-align: -3px;
}

.mini-action-bell svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scheduled-clock {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #3151b5;
  background: #eef2ff;
  border-radius: 999px;
  vertical-align: -3px;
}

.scheduled-clock.due {
  color: #b9362c;
  background: #ffd8d1;
}

.scheduled-clock svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assignment-badge {
  color: #5c4d79;
  background: #eee8f8;
}

.assignment-badge.mine {
  color: #257150;
  background: #e6f4ed;
}

.task-context-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  color: #235a84;
  background: #e1f1ff;
  border: 1px solid #b9daf5;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 760;
}

.task-linked-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  padding: 9px 10px;
  background: linear-gradient(135deg, #f1f5ff, #f8f6ff);
  border: 1px solid #ccd6f6;
  border-radius: 11px;
}

.task-linked-context-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.task-linked-context-copy strong {
  font-size: 12px;
  line-height: 1.2;
}

.task-linked-context-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.task-linked-context-button {
  min-height: 32px;
  padding: 5px 10px;
  color: #294b9d;
  background: #fff;
  border-color: #bfcdf2;
}

.task-linked-context-button.repair {
  color: #8b5318;
  border-color: #e5c590;
}

.task-linked-context-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 660px) {
  .task-linked-context {
    align-items: stretch;
    flex-direction: column;
  }

  .task-linked-context-actions,
  .task-linked-context-button {
    width: 100%;
  }
}

.task-card.is-blocked {
  background: #f1f0ec;
  filter: saturate(0.55);
}

.task-card.is-action-blocked {
  background: #fff8ed;
}

.task-card.is-assigned-locked {
  background: #f7f6f2;
}

.task-card.is-blocked .task-name {
  color: #707773;
}

.metric {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5px 8px;
}

.metric-label {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

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

.metric-bar {
  height: 4px;
  grid-column: 1 / -1;
  overflow: hidden;
  background: #ebe9e3;
  border-radius: 10px;
}

.metric-bar i {
  height: 100%;
  display: block;
  background: var(--metric-color);
  border-radius: inherit;
}

.due-block {
  min-width: 0;
}

.due-block span {
  display: block;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.due-block strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.due-block.overdue strong,
.due-block.today strong {
  color: #c34f3d;
}

.priority-score {
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  color: var(--priority-color);
  background: color-mix(in srgb, var(--priority-color) 11%, white);
  border: 1px solid color-mix(in srgb, var(--priority-color) 28%, white);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.edit-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}

.edit-button:hover {
  color: var(--blue);
  background: var(--blue-pale);
}

.edit-button svg {
  width: 15px;
  height: 15px;
}

.task-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.dashboard-claim-button {
  min-height: 34px;
  padding: 0 10px;
  color: #257150;
  background: #e6f4ed;
  border: 1px solid #bcdaca;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-claim-button:hover {
  color: #184e38;
  background: #d9eee4;
}

.task-action-request {
  min-height: 34px;
  padding: 0 10px;
  color: #a05710;
  background: #fff7e8;
  border-color: #efd2a9;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 850;
}

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

.task-schedule-button {
  min-height: 34px;
  padding: 0 10px;
  color: #3151b5;
  background: #eef2ff;
  border-color: #cbd7ff;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 850;
}

.task-schedule-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.dashboard-assignment-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 13px 0 1px 31px;
  border-top: 1px solid var(--line);
}

.dashboard-assignment-controls .field {
  margin: 0;
}

.dashboard-assignment-controls textarea {
  min-height: 70px;
  resize: vertical;
}

.dashboard-assignment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 1px;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 50px 20px;
  text-align: center;
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 12px, rgba(23, 33, 31, 0.015) 12px, rgba(23, 33, 31, 0.015) 24px);
  border: 1px dashed #c9c5bb;
  border-radius: 15px;
}

.empty-state-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  color: var(--blue);
  background: var(--blue-pale);
  border-radius: 50%;
}

.empty-state h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 400;
}

.empty-state p {
  max-width: 380px;
  margin: 8px auto 18px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.commission-board-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 10px;
}

.commission-board-meta p {
  margin: 0;
}

.commission-completed-controls,
.commission-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.commission-board > .empty-state {
  grid-column: 1 / -1;
}

.commission-board-card {
  min-width: 0;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 8px 22px rgba(32, 38, 36, 0.04);
}

.commission-board-card.is-complete {
  background: #f0f8f2;
  border-color: #bfd9c8;
}

.commission-board-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.commission-board-header h3 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 400;
}

.commission-board-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.commission-board-header-actions .secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.commission-board-header-actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.commission-board-card.stacked-card-layout .commission-board-header {
  position: relative;
  display: block;
}

.commission-board-card.stacked-card-layout .commission-board-header > div:first-child {
  width: 100%;
  min-width: 0;
}

.commission-board-card.stacked-card-layout .commission-board-header h3 {
  width: 100%;
  max-width: none;
}

.commission-board-card.stacked-card-layout .commission-board-kicker {
  display: block;
  max-width: 52%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-card-creator {
  position: absolute;
  top: 0;
  right: 0;
  max-width: 44%;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-card-creator {
  right: 42px;
  max-width: calc(44% - 42px);
}

.quote-card-corner-clone {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
}

.dialog-header .crm-quote-header-clone {
  margin-left: auto;
}

.dialog-header .crm-quote-header-clone + [data-action="close-crm-entity-dialog"] {
  margin-left: 0;
}

.crm-quote-management-row {
  box-sizing: border-box;
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-height: 68px;
  padding: 8px 36px 8px 9px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.crm-quote-management-row:hover {
  border-color: rgba(53, 88, 212, 0.28);
  background: white;
}

.crm-quote-management-row:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.crm-quote-management-identities,
.crm-quote-management-footer {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  overflow: hidden;
}

.crm-quote-management-identities .document-code-inline,
.crm-quote-management-identities .client-name-highlight {
  box-sizing: border-box;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 1px 5px;
  font-size: 10px;
  line-height: 14px;
}

.crm-quote-management-identities .document-code-inline {
  flex: 0 0 auto;
}

.crm-quote-management-identities .client-name-highlight {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-quote-management-identities .client-name-highlight strong {
  overflow: hidden;
  font-size: 10px;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-quote-management-title {
  overflow: hidden;
  font-size: 11px !important;
  line-height: 15px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-quote-management-footer {
  min-height: 17px;
}

.crm-quote-management-footer .business-badge,
.crm-quote-management-footer .quote-status-display {
  margin: 0;
}

.crm-quote-management-row .crm-quote-row-clone {
  position: absolute;
  right: 7px;
  bottom: 6px;
  width: 23px;
  min-width: 23px;
  height: 23px;
  min-height: 23px;
  padding: 4px;
}

.commission-board-card.stacked-card-layout .commission-board-header-actions {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
}

.commission-board-card.stacked-card-layout .opportunity-card-actions {
  margin-top: 10px;
}

.commission-board-card.stacked-card-layout .commission-board-header-actions button:not(.quote-clone-button) {
  flex: 1 1 0;
  min-width: 0;
}

.commission-board-card.stacked-card-layout .commission-board-header-actions .quote-clone-button {
  flex: 0 0 auto;
}

@media (max-width: 680px) {
  .commission-board-card.stacked-card-layout .commission-board-header-actions {
    flex-wrap: wrap;
  }

  .commission-board-card.stacked-card-layout .commission-board-header-actions button:not(.quote-clone-button) {
    flex-basis: calc(50% - 4px);
  }
}

.commission-board-kicker {
  color: var(--blue);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.commission-board-card.is-complete .commission-board-kicker {
  color: var(--green);
}

.commission-board-description {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.commission-business-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 11px;
  background: #f8f7f2;
  border: 1px solid #ebe8df;
  border-radius: 10px;
}

.commission-date-range {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
}

.commission-estimated-value {
  display: grid;
  gap: 1px;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.commission-estimated-value strong {
  color: #c76b18;
  font-size: 12px;
  line-height: 1.1;
}

.commission-estimated-value small {
  color: var(--ink-soft);
  font-size: 8px;
}

.commission-address-book {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.commission-address-book > span:last-child {
  min-width: 0;
}

.commission-address-book .client-name-highlight {
  margin-top: 0;
}

.commission-address-book strong,
.commission-address-book small {
  display: block;
}

.commission-address-book strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-address-book .client-name-highlight > strong {
  font-size: 11px;
}

.commission-address-book small,
.commission-address-book.empty {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
}

.commission-score-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 15px;
}

.commission-score-grid {
  margin: 14px 0;
}

.commission-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
}

.commission-progress > span {
  height: 7px;
  overflow: hidden;
  background: #ebe9e2;
  border-radius: 999px;
}

.commission-progress i {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
}

.commission-board-card.is-complete .commission-progress i {
  background: var(--green);
}

.commission-progress strong {
  color: var(--ink-soft);
  font-size: 9px;
}

.commission-row-progress {
  display: block;
  width: min(180px, 100%);
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e9ee;
}

.commission-row-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.commission-row.is-complete .commission-row-progress i { background: var(--green); }

.commission-next-task {
  margin-top: 15px;
  padding: 13px;
  background: var(--blue-pale);
  border-radius: 11px;
}

.commission-next-task.is-complete {
  background: #e6f4ed;
}

.commission-next-task > span,
.commission-next-task strong {
  display: block;
}

.commission-next-task > span {
  color: var(--blue);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.commission-next-task.is-complete > span {
  color: var(--green);
}

.commission-next-task strong {
  margin-top: 5px;
  font-size: 12px;
}

.commission-next-task p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.commission-active-models {
  display: grid;
  gap: 8px;
}

.commission-active-model {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.commission-active-model > strong {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-model-status {
  display: flex;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  overflow: hidden;
  border: 1px solid #aeb4b7;
  border-radius: 8px;
  background: linear-gradient(#fafafa, #e7e9ea);
  box-shadow: inset 0 1px rgba(255, 255, 255, .9), 0 2px 0 #aeb4b7;
  color: #4f575b;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-model-status.is-claimed {
  border-color: #59a479;
  background: linear-gradient(#effaf3, #cfeada);
  box-shadow: inset 0 1px rgba(255, 255, 255, .9), 0 2px 0 #59a479;
  color: #17653b;
}

.commission-model-status.is-commented {
  border-color: #d2ad3e;
  background: linear-gradient(#fffbea, #f5e7a9);
  box-shadow: inset 0 1px rgba(255, 255, 255, .9), 0 2px 0 #d2ad3e;
  color: #765b05;
}

.commission-model-status.is-action {
  border-color: #df8339;
  background: linear-gradient(#fff4e8, #f7c994);
  box-shadow: inset 0 1px rgba(255, 255, 255, .9), 0 2px 0 #df8339;
  color: #8a3e08;
}

.commission-active-model.is-standalone .commission-model-status {
  min-width: 70px;
}

.activity-model-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.activity-model-preview span,
.workflow-card-model {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid #d7dded;
  border-radius: 999px;
  background: #f2f5ff;
  color: #3650a8;
  font-size: 9px;
  font-weight: 800;
}

.activity-model-preview b {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: #dce5ff;
}

.activity-model-inserter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.activity-model-inserter .activity-model-preview {
  grid-column: 1 / -1;
}

.activity-model-inserter .workflow-phase-template-head {
  grid-template-columns: minmax(210px, .8fr) minmax(190px, 1fr) auto;
}

.quote-activity-model-inserter {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf9f5;
}

.activity-model-insert-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.workflow-model-header {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  margin: -2px 0 5px;
  padding: 4px 5px 5px;
  border-bottom: 1px solid #dce3f3;
  border-radius: 7px 7px 0 0;
  background: #f2f5fc;
}
.workflow-model-header.is-standalone { grid-template-columns: auto minmax(0, 1fr) auto; }
.workflow-model-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: max-content;
  flex: 0 0 auto;
}
.quote-work-association-button,
.quote-work-association-marker {
  position: relative;
  z-index: 2;
}
.quote-work-association-button {
  width: 25px;
  min-width: 25px;
  height: 25px;
  min-height: 25px;
  padding: 0;
  color: #315bc4;
  font-size: 13px;
}
.quote-work-association-marker {
  width: auto;
  min-width: 0;
  height: 12px;
  min-height: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #9b6100;
  font: 850 8px/12px system-ui, sans-serif;
  letter-spacing: 0;
  cursor: pointer;
}
.quote-work-association-marker:hover,
.quote-work-association-marker:focus-visible {
  background: #ffedb1;
  outline: 0;
}
.quote-draft-description {
  position: relative;
}
.quote-work-association-markers {
  position: absolute;
  z-index: 2;
  top: 4px;
  right: 5px;
  display: inline-flex;
  height: 12px;
  align-items: center;
  gap: 1px;
}
.workflow-unit-drag {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 6px;
  color: #6980b4;
  cursor: grab;
  font-size: 16px;
  line-height: 1;
}
.workflow-unit-drag:hover { background: #e4eaf8; color: #3557a6; }
.workflow-model-name {
  min-width: 0;
  height: 27px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #2f4f96;
  font-size: 11px;
  font-weight: 850;
}
.workflow-model-name:hover,
.workflow-model-name:focus { border-color: #bdcbea; background: #fff; outline: 0; }
.workflow-association-group-name {
  min-width: 0;
  overflow: hidden;
  color: #245e50;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-model-header.is-association-group {
  border-bottom-color: #cfe5de;
  background: #eef8f4;
}
.workflow-unit-card.is-association-group {
  border-color: #bcdacf;
  border-left: 3px solid #4b9a76;
}
.workflow-model-header > span { color: #778197; font-size: 10px; font-weight: 750; white-space: nowrap; }
.workflow-model-toggle { width: 25px; min-width: 25px; height: 25px; min-height: 25px; flex: 0 0 25px; padding: 0; }
.commission-sequence-row.model-first,
.commission-sequence-row.model-middle,
.commission-sequence-row.model-last,
.workflow-step-row.model-first,
.workflow-step-row.model-middle,
.workflow-step-row.model-last {
  border-left: 3px solid #6f8bd2;
  background: linear-gradient(90deg, #f5f7fd, #fff 28%);
}
.workflow-model-card.is-collapsed {
  border: 1px solid #bfcbea;
  border-left: 4px solid #5878c6;
  background: linear-gradient(135deg, #f4f7ff, #fff);
  box-shadow: 0 3px 9px rgb(51 78 142 / 8%);
}

.workflow-unit-canvas { position: relative; display: grid; gap: 8px; min-width: 0; }
.workflow-unit-canvas-project { gap: 20px; }
.workflow-unit-canvas-project .workflow-unit-stage { align-items: start; }
.workflow-unit-canvas-project .workflow-unit-stage > span {
  align-self: start;
  padding-top: 8px;
}
.workflow-unit-canvas-project .workflow-unit-stage-grid > .workflow-unit-card {
  grid-row: 1;
  align-self: start;
}
.workflow-unit-canvas-project .workflow-unit-stage-grid { row-gap: 20px; }
.workflow-unit-stage {
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: stretch;
  gap: 7px;
}
.workflow-unit-stage.drop-common-before,
.workflow-unit-stage.drop-common-after {
  border-radius: 9px;
  box-shadow: 0 0 0 2px #ffe8e2;
}
.workflow-unit-stage.drop-common-before::after,
.workflow-unit-stage.drop-common-after::after {
  content: '';
  position: absolute;
  right: 0;
  left: 55px;
  z-index: 20;
  height: 5px;
  pointer-events: none;
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .82), 0 2px 7px rgba(162, 76, 52, .22);
}
.workflow-unit-stage.drop-common-before::after { top: 0; }
.workflow-unit-stage.drop-common-after::after { bottom: 0; }
.workflow-unit-stage > span {
  align-self: center;
  color: #8a91a0;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.workflow-unit-stage-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; }
.workflow-unit-card {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce1e9;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 7px rgb(36 47 68 / 5%);
  cursor: grab;
}
.workflow-unit-stage-grid > .workflow-unit-card.commission-sequence-row {
  display: block;
  padding: 0;
}
.workflow-unit-card.is-model { border-color: #cbd5ec; }
.workflow-unit-card.is-standalone .workflow-unit-activity { border-top: 0; }
.workflow-unit-card.is-collapsed {
  min-height: 58px;
  border-left: 4px solid #5878c6;
  background: linear-gradient(135deg, #f4f7ff, #fff);
}
.workflow-unit-card.is-dragging { opacity: .58; cursor: grabbing; }
.workflow-unit-card .workflow-model-header { margin: 0; border-radius: 0; }
.workflow-unit-activity {
  display: grid;
  grid-template-columns: 24px minmax(180px, 390px) minmax(250px, 300px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 7px;
  border-top: 1px solid #edf0f5;
}
.workflow-unit-activity:has(.quote-workflow-step-rate:not([hidden])) {
  grid-template-columns: 24px minmax(150px, 340px) minmax(345px, 395px) minmax(0, 1fr) auto;
}
.workflow-unit-activity:has(.quote-workflow-step-people) {
  grid-template-columns: 24px minmax(130px, 300px) minmax(350px, 400px) minmax(0, 1fr) auto;
}
.workflow-unit-activity:has(.quote-workflow-step-people):has(.quote-workflow-step-rate:not([hidden])) {
  grid-template-columns: 24px minmax(120px, 270px) minmax(410px, 455px) minmax(0, 1fr) auto;
}
.workflow-unit-activity:hover { background: #fafbfe; }
.workflow-unit-activity .workflow-step-position {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  background: #e8eefc;
  color: #4966aa;
  font-size: 9px;
  font-weight: 850;
}
.workflow-unit-activity .workflow-step-copy { min-width: 0; }
.workflow-unit-activity .workflow-step-copy strong,
.workflow-unit-activity .workflow-step-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-unit-activity .workflow-step-copy strong { font-size: 11px; }
.workflow-unit-activity .workflow-step-copy small { margin-top: 2px; color: #78808d; font-size: 9px; }
.workflow-unit-activity:not(:has(.quote-workflow-activity-editors)) {
  grid-template-columns: 24px minmax(0, 1fr) auto;
}
.workflow-unit-activity-actions {
  display: inline-flex;
  grid-column: 5;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: max-content;
}
.workflow-unit-activity:not(:has(.quote-workflow-activity-editors)) .workflow-unit-activity-actions {
  grid-column: 3;
}
.workflow-unit-activity-actions .danger-icon {
  width: 25px;
  min-width: 25px;
  height: 25px;
  min-height: 25px;
  padding: 0;
}
.quote-workflow-activity-editors {
  display: grid;
  grid-template-columns: minmax(140px, 180px) 52px 52px;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.quote-workflow-activity-editors:has(.quote-workflow-step-rate:not([hidden])) {
  grid-template-columns: minmax(105px, 145px) 80px 52px 52px;
}
.quote-workflow-activity-editors:has(.quote-workflow-step-people):not(:has(.quote-workflow-step-rate:not([hidden]))) {
  grid-template-columns: minmax(100px, 140px) 44px 90px 48px 48px;
}
.quote-workflow-activity-editors:has(.quote-workflow-step-people):has(.quote-workflow-step-rate:not([hidden])) {
  grid-template-columns: minmax(90px, 120px) 65px 44px 90px 48px 48px;
}
.quote-workflow-activity-editors select,
.quote-workflow-step-rate,
.quote-workflow-step-people,
.quote-workflow-duration-part {
  width: 100%;
  min-width: 0;
  height: 27px;
  box-sizing: border-box;
  border: 1px solid #d5dceb;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 10px;
}
.quote-workflow-activity-editors select {
  padding: 2px 28px 2px 6px;
}
.quote-workflow-duration-part {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
}
.quote-workflow-step-rate {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
}
.quote-workflow-step-rate[hidden] { display: none; }
.quote-workflow-step-rate input,
.quote-workflow-step-people input {
  width: 0;
  min-width: 0;
  height: 24px;
  flex: 1;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: right;
  outline: 0;
  appearance: textfield;
  -moz-appearance: textfield;
}
.quote-workflow-step-rate input::-webkit-inner-spin-button,
.quote-workflow-step-rate input::-webkit-outer-spin-button,
.quote-workflow-step-people input::-webkit-inner-spin-button,
.quote-workflow-step-people input::-webkit-outer-spin-button { appearance: none; -webkit-appearance: none; }
.quote-workflow-step-rate small,
.quote-workflow-step-people small { color: #778197; font-size: 8px; font-weight: 800; white-space: nowrap; }
.quote-workflow-step-people {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
}
.quote-workflow-step-location {
  width: 90px;
  min-width: 90px;
  max-width: 90px;
  padding: 2px 17px 2px 5px !important;
  font-size: 9px !important;
}
.quote-workflow-duration-steppers {
  display: grid;
  width: 11px;
  min-width: 11px;
  align-self: stretch;
  grid-template-rows: 1fr 1fr;
  margin: 0 1px 0 -3px;
}
.quote-workflow-duration-steppers button {
  display: grid;
  width: 11px;
  min-width: 11px;
  min-height: 0;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6476a8;
  font-size: 8px;
  line-height: 1;
}
.quote-workflow-duration-steppers button:hover { color: var(--blue); background: #eef2ff; }
.quote-workflow-duration-part input {
  width: 0;
  min-width: 0;
  height: 24px;
  flex: 1 1 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: right;
  outline: 0;
  appearance: textfield;
  -moz-appearance: textfield;
}
.quote-workflow-duration-part input::-webkit-inner-spin-button,
.quote-workflow-duration-part input::-webkit-outer-spin-button { appearance: none; -webkit-appearance: none; }
.quote-workflow-duration-part small { color: #778197; font-size: 9px; font-weight: 800; }
.quote-workflow-activity-editors select:focus,
.quote-workflow-step-rate:focus-within,
.quote-workflow-step-people:focus-within,
.quote-workflow-duration-part:focus-within {
  border-color: #8097dd;
  box-shadow: 0 0 0 2px rgba(72, 102, 194, .12);
  outline: 0;
}
@media (max-width: 760px) {
  .quote-workflow-entry-editor {
    grid-template-columns: 42px minmax(0, 1fr) 90px;
  }
  .quote-workflow-entry-editor .quote-workflow-description-field,
  .quote-workflow-entry-editor:has(#crm-quote-use-activity-template:checked) .quote-workflow-description-field,
  .project-workflow-entry-editor:has(#crm-project-use-activity-template:checked) .quote-workflow-description-field {
    grid-column: 2;
  }
  .quote-workflow-entry-editor .quote-workflow-insert-actions {
    grid-column: 3;
    grid-row: 1;
  }
  .quote-workflow-entry-editor #crm-quote-step-group-field,
  .quote-workflow-entry-editor #crm-quote-step-skill-field,
  .quote-workflow-entry-editor #crm-project-step-group-field,
  .quote-workflow-entry-editor #crm-project-step-skill-field,
  .quote-workflow-entry-editor .workflow-people-field,
  .quote-workflow-entry-editor .workflow-location-field,
  .quote-workflow-entry-editor.workflow-step-editor .duration-field {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}
@container (max-width: 1050px) {
  .quote-workflow-entry-editor:not(.repair-plan-work-add) {
    grid-template-columns: 42px minmax(150px, 1fr) minmax(105px, 130px) minmax(115px, 145px) 62px 82px 160px auto;
  }
  .quote-workflow-entry-editor:not(.repair-plan-work-add) .quote-workflow-description-field,
  .quote-workflow-entry-editor:not(.repair-plan-work-add):has(#crm-quote-use-activity-template:checked) .quote-workflow-description-field,
  .project-workflow-entry-editor:not(.repair-plan-work-add):has(#crm-project-use-activity-template:checked) .quote-workflow-description-field {
    grid-column: 2;
  }
  .quote-workflow-entry-editor:not(.repair-plan-work-add) #crm-quote-step-group-field,
  .quote-workflow-entry-editor:not(.repair-plan-work-add) #crm-project-step-group-field { grid-column: 3; }
  .quote-workflow-entry-editor:not(.repair-plan-work-add) #crm-quote-step-skill-field,
  .quote-workflow-entry-editor:not(.repair-plan-work-add) #crm-project-step-skill-field {
    grid-column: 4;
    width: auto;
    min-width: 0;
    max-width: none;
  }
  .quote-workflow-entry-editor:not(.repair-plan-work-add) .workflow-people-field {
    grid-column: 5;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .quote-workflow-entry-editor:not(.repair-plan-work-add) .workflow-location-field {
    grid-column: 6;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .quote-workflow-entry-editor:not(.repair-plan-work-add) .workflow-location-field select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .quote-workflow-entry-editor:not(.repair-plan-work-add).workflow-step-editor .duration-field {
    grid-column: 7;
    grid-row: 1;
  }
  .quote-workflow-entry-editor:not(.repair-plan-work-add) .quote-workflow-insert-actions {
    grid-column: 8;
    grid-row: 1;
  }
}
@container (max-width: 880px) {
  .workflow-builder-heading-actions { width: 100%; }
  .quote-workflow-entry-editor:not(.repair-plan-work-add) {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 7px;
  }
  .quote-workflow-entry-editor:not(.repair-plan-work-add) .quote-workflow-description-field,
  .quote-workflow-entry-editor:not(.repair-plan-work-add):has(#crm-quote-use-activity-template:checked) .quote-workflow-description-field,
  .project-workflow-entry-editor:not(.repair-plan-work-add):has(#crm-project-use-activity-template:checked) .quote-workflow-description-field {
    grid-column: 2;
  }
  .quote-workflow-entry-editor:not(.repair-plan-work-add) .quote-workflow-insert-actions {
    grid-column: 3;
    grid-row: 1;
  }
  .quote-workflow-entry-editor:not(.repair-plan-work-add) #crm-quote-step-group-field,
  .quote-workflow-entry-editor:not(.repair-plan-work-add) #crm-quote-step-skill-field,
  .quote-workflow-entry-editor:not(.repair-plan-work-add) #crm-project-step-group-field,
  .quote-workflow-entry-editor:not(.repair-plan-work-add) #crm-project-step-skill-field,
  .quote-workflow-entry-editor:not(.repair-plan-work-add) .workflow-people-field,
  .quote-workflow-entry-editor:not(.repair-plan-work-add) .workflow-location-field,
  .quote-workflow-entry-editor:not(.repair-plan-work-add).workflow-step-editor .duration-field {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .workflow-recurrence-strip { grid-template-columns: minmax(0, 1fr); }
  .workflow-recurrence-toggle { justify-self: start; }
  .workflow-recurrence-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 520px) {
  .workflow-builder-heading-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workflow-builder-heading-actions > button { box-sizing: border-box; width: 100%; }
  .workflow-recurrence-fields { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 520px) {
  .workflow-unit-activity:has(.quote-workflow-activity-editors) {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }
  .workflow-unit-activity .quote-workflow-activity-editors {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: minmax(100px, 1fr) 50px 50px;
  }
  .workflow-unit-activity .workflow-unit-activity-actions {
    grid-column: 3;
    grid-row: 1 / 3;
  }
}
.workflow-unit-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border-top: 1px solid #e9edf4;
  background: #fafbfc;
  color: #697384;
  font-size: 9px;
}
.workflow-unit-card > footer span { font-weight: 850; white-space: nowrap; }
.workflow-unit-card > footer small { overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

/* I modelli generano attività del flusso; non sono più stati interni di una singola attività. */
.task-phase-builder,
[data-workflow-phase-scope="commission"] {
  display: none !important;
}

.commission-task-list {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.commission-task-list summary {
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.commission-task-list > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 9px;
}

.commission-task-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  color: var(--ink);
  background: #f8f7f3;
  border: 1px solid transparent;
  border-radius: 9px;
  text-align: left;
}

.commission-task-row:hover {
  background: white;
  border-color: var(--line);
}

.commission-task-row.is-blocked {
  opacity: 0.62;
}

.commission-task-row.is-unlocked {
  background: #eef7f1;
  border-color: #c7e0d1;
}

.commission-task-row.is-done .commission-task-copy strong {
  color: var(--ink-soft);
  text-decoration: line-through;
}

.commission-task-position {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
  border-radius: 7px;
  font-size: 9px;
  font-weight: 850;
}

.commission-task-row.is-done .commission-task-position {
  background: var(--green);
}

.commission-task-copy {
  min-width: 0;
}

.commission-task-copy strong,
.commission-task-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-task-copy strong {
  font-size: 10px;
}

.commission-task-copy small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.commission-task-state {
  color: var(--ink-soft);
  font-size: 15px;
}

.gantt-frame {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.gantt-chart {
  position: relative;
  min-width: 2032px;
}

.gantt-header,
.gantt-row {
  display: grid;
  grid-template-columns: 240px 1fr;
}

.gantt-label-head,
.gantt-task-label {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #fbfaf6;
  border-right: 1px solid var(--line);
}

.gantt-label-head {
  height: 72px;
  display: flex;
  align-items: flex-end;
  padding: 0 16px 12px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gantt-days {
  display: grid;
  grid-template-columns: repeat(28, minmax(64px, 1fr));
  background: #fbfaf6;
}

.gantt-day {
  min-width: 64px;
  height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding: 6px 3px 5px;
  color: var(--ink-soft);
  border-right: 1px solid #ebe8e0;
  font-size: 9px;
  text-transform: uppercase;
}

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

.gantt-day.today {
  color: var(--blue);
  background: var(--blue-pale);
}

.gantt-day.today strong {
  color: var(--blue);
}

.gantt-day.weekend:not(.today) {
  background: #f4f3ef;
}

.gantt-day-hours {
  width: 100%;
  display: flex;
  justify-content: space-between;
  color: #929993;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0;
}

.gantt-day-hours small {
  font-size: inherit;
}

.gantt-row {
  min-height: 63px;
  border-top: 1px solid #ebe8e0;
}

.gantt-task-label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  color: inherit;
  background: white;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.gantt-task-label:hover {
  background: #f8f6f1;
}

.gantt-task-label i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--priority-color);
  border-radius: 50%;
}

.gantt-row.standalone .gantt-task-label i {
  border-radius: 2px;
  transform: rotate(45deg);
}

.gantt-row.standalone .gantt-bar {
  background: color-mix(in srgb, var(--priority-color) 13%, white);
  border-style: dashed;
}

.gantt-task-label div {
  min-width: 0;
}

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

.gantt-task-label span {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.35;
}

.gantt-task-label small {
  display: block;
  margin-top: 3px;
  color: var(--blue);
  font-size: 8px;
  font-weight: 750;
}

.gantt-track {
  position: relative;
  background-image:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(1.7857% - 1px),
      rgba(213, 216, 211, 0.42) calc(1.7857% - 1px),
      rgba(213, 216, 211, 0.42) 1.7857%
    ),
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(3.5714% - 1px),
      #d8d7d1 calc(3.5714% - 1px),
      #d8d7d1 3.5714%
    );
}

.gantt-track.today-column::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: var(--today-position);
  width: 2px;
  background: rgba(53, 88, 212, 0.38);
}

.gantt-bar {
  position: absolute;
  z-index: 2;
  top: 17px;
  left: var(--bar-left);
  width: var(--bar-width);
  min-width: 10px;
  height: 28px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 10px;
  color: var(--bar-text);
  background: color-mix(in srgb, var(--priority-color) 23%, white);
  border: 1px solid color-mix(in srgb, var(--priority-color) 45%, white);
  border-radius: 7px;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.gantt-bar.milestone {
  width: 28px;
  min-width: 28px;
  padding: 0;
  transform: rotate(45deg);
  border-radius: 5px;
}

.gantt-bar.milestone span {
  display: none;
}

.task-dialog {
  position: relative;
  width: min(900px, calc(100% - 28px));
  max-height: calc(100vh - 30px);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: 22px;
  box-shadow: 0 30px 100px rgba(23, 33, 31, 0.28);
}

#task-dialog {
  overflow: hidden;
}

#task-dialog #task-form {
  --dialog-content-padding: 28px;
  box-sizing: border-box;
  max-height: min(calc(100vh - 30px), calc(100dvh - 30px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: 76px;
  scrollbar-gutter: stable;
}

#task-dialog .dialog-footer {
  position: sticky;
  bottom: 0;
  z-index: 4;
  isolation: isolate;
  margin: 18px calc(-1 * var(--dialog-content-padding)) 0;
  padding: 14px var(--dialog-content-padding) 18px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 20px rgba(247, 245, 239, 0.92);
}

.task-dialog::backdrop {
  background: rgba(19, 27, 25, 0.55);
  backdrop-filter: blur(4px);
}

.task-phase-template-grid {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(520px, 1.6fr);
  gap: 18px;
}

.task-phase-template-management .task-phase-template-grid {
  grid-template-columns: minmax(230px, .65fr) minmax(620px, 2fr);
  gap: 12px;
}

.task-phase-template-management .task-phase-template-grid > section,
.task-phase-template-management .task-phase-template-grid > form {
  padding: 13px;
  border-color: #e3e6ec;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgb(37 48 69 / 4%);
}

.task-phase-template-management .task-phase-editor-list { gap: 5px; margin: 8px 0; }
.task-phase-template-management .task-phase-editor-row {
  grid-template-columns: 23px minmax(0, 1fr) auto;
  gap: 6px;
  padding: 5px 6px;
  border-color: #e6e9ef;
  border-radius: 8px;
  background: #fbfcfd;
}
.task-phase-template-management .task-phase-number { width: 22px; height: 22px; font-size: 10px; }
.task-phase-template-management .task-phase-editor-fields { display: flex; align-items: center; gap: 6px; }
.task-phase-template-management .task-phase-editor-fields > input:first-child { flex: 1.5 1 230px; }
.task-phase-template-management .task-phase-editor-fields > select { flex: 1 1 155px; min-width: 120px; }
.task-phase-template-management .task-phase-editor-fields > .task-model-panel { flex: 0 1 150px; min-width: 132px; }
.task-phase-template-management .task-phase-editor-fields > [hidden] { display: none; }
.task-phase-template-management .task-phase-editor-fields input,
.task-phase-template-management .task-phase-editor-fields select {
  min-height: 30px;
  height: 30px;
  border-color: #e1e5ec;
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
}
.task-phase-template-management .task-phase-hours { flex: 0 0 auto; gap: 3px; font-size: 9px; }
.task-phase-template-management .task-phase-hours input { width: 45px; }
.task-phase-template-management .task-phase-row-actions .icon-button { width: 25px; height: 25px; }

.task-phase-template-grid > section,
.task-phase-template-grid > form,
.task-phase-builder,
.task-phase-progress {
  border: 1px solid var(--line-color, #d9dee8);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
}

.task-phase-builder,
.task-phase-progress,
.workflow-phase-template {
  border-color: #dfe4ec;
  background: linear-gradient(180deg, #fbfcfe 0%, #f7f9fc 100%);
  box-shadow: 0 1px 2px rgb(20 32 54 / 4%);
}

#task-dialog .task-phase-builder {
  border: 0;
  border-radius: 18px;
  background: #f6f8fb;
  box-shadow: none;
  padding: 14px 15px;
}

#task-dialog .task-phase-builder .task-phase-template-picker select {
  min-height: 40px;
  border: 1px solid #e1e6ee;
  border-radius: 11px;
  background: #fff;
  box-shadow: none;
}

#task-dialog .task-phase-builder .task-phase-editor-row {
  border-color: #e8ebf1;
  border-radius: 12px;
  background: rgb(255 255 255 / 78%);
}

#task-dialog .task-phase-builder .task-phase-editor-fields input,
#task-dialog .task-phase-builder .task-phase-editor-fields select {
  border: 1px solid #e1e6ee;
  border-radius: 9px;
  background: #fff;
  box-shadow: none;
}

.task-phase-builder .eyebrow,
.task-phase-progress .eyebrow {
  color: var(--accent, #315fd4);
  font-size: .68rem;
  letter-spacing: .1em;
}

.task-phase-builder,
.task-phase-progress {
  grid-column: 1 / -1;
}

.task-phase-builder-heading,
.task-phase-editor-heading,
.task-phase-transition-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-phase-builder-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.task-phase-template-picker {
  display: flex;
  gap: 8px;
  min-width: min(100%, 360px);
}

.task-phase-template-picker select { min-width: 220px; }
.task-phase-editor-list { display: grid; gap: 8px; margin: 12px 0; }
.task-phase-editor-list.compact { margin: 9px 0 6px; gap: 6px; }
.task-phase-editor-list.compact .task-phase-editor-row { padding: 6px; background: #fff; }
.task-phase-editor-list.compact .task-phase-number { width: 23px; height: 23px; }
.task-phase-editor-list.compact .task-phase-editor-fields input,
.task-phase-editor-list.compact .task-phase-editor-fields select { min-height: 32px; font-size: .8rem; }

.task-phase-editor-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid #e1e5ed;
  border-radius: 10px;
  background: #f8fafc;
}

.task-phase-number {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8efff;
  color: #315fd4;
  font-weight: 800;
  font-size: .78rem;
}

.task-phase-editor-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(150px, 1fr) 90px;
  gap: 8px;
}

.task-phase-editor-fields input,
.task-phase-editor-fields select { min-height: 36px; }
.task-phase-hours { display: flex; align-items: center; gap: 5px; }
.task-phase-hours input { width: 58px; }
.task-phase-row-actions { display: flex; gap: 3px; }
.task-phase-row-actions .icon-button { width: 30px; height: 30px; }
.task-phase-empty { color: var(--muted-color, #6d7480); margin: 10px 0; }
.task-phase-add { padding-left: 0; }

.task-phase-timeline { display: grid; gap: 7px; margin: 14px 0; }
.task-phase-step { display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #f5f6f8; color: #747b87; }
.task-phase-step > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #e1e5eb; font-weight: 800; font-size: .75rem; }
.task-phase-step > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.task-phase-step.current { background: #edf3ff; color: #244fae; box-shadow: inset 3px 0 #3b67d9; }
.task-phase-step.current > span { background: #3b67d9; color: white; }
.task-phase-step.completed { color: #32714b; background: #edf8f1; }
.task-phase-step.completed > span { background: #3f9663; color: white; }
.task-phase-history { margin-top: 12px; }
.task-phase-history ul { display: grid; gap: 7px; padding: 8px 0 0; list-style: none; }
.task-phase-history li { padding: 8px 10px; border-left: 2px solid #d9dfeb; }
.task-phase-history li span { margin-left: 8px; color: #747b87; font-size: .78rem; }
.task-phase-history li p { margin: 3px 0 0; }
.task-phase-badge { border-radius: 999px; padding: 3px 8px; background: #edf3ff; color: #315bb5; font-weight: 750; }
.task-phase-completion-note { color: #315bb5; font-weight: 750; font-size: .82rem; }
.task-phase-claim-notice { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; color: #5f6877; font-size: .8rem; }
.workflow-card-phase-count { border-radius: 999px; padding: 2px 7px; background: #f0ebff; color: #6d43b8; font-weight: 750; font-size: .7rem; white-space: nowrap; }

.workflow-phase-template {
  padding: 11px 12px;
  border: 1px solid #dfe4ec;
  border-radius: 12px;
}

.workflow-phase-template-head {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(200px, 1.2fr);
  align-items: end;
  gap: 14px;
}

.workflow-phase-template-head > div {
  display: grid;
  gap: 2px;
  padding-bottom: 4px;
}

.workflow-phase-template-head > div strong { color: #2e4f94; }
.workflow-phase-template-head > div small { color: #717986; }
.workflow-phase-template > .text-button { padding: 3px 0; font-size: .78rem; }
.workflow-phase-template .task-phase-editor-row {
  grid-template-columns: 24px minmax(0, 1fr) 76px;
  gap: 6px;
}
.workflow-phase-template .task-phase-editor-fields {
  grid-template-columns: minmax(125px, 1.35fr) minmax(95px, .9fr) 52px;
  gap: 5px;
}
.workflow-phase-template .task-phase-hours input { width: 52px; }
.workflow-phase-template .task-phase-hours span { display: none; }
.workflow-phase-template .task-phase-row-actions { gap: 1px; }
.workflow-phase-template .task-phase-row-actions .icon-button { width: 24px; height: 26px; padding: 0; }

@media (max-width: 900px) {
  .task-phase-template-grid { grid-template-columns: 1fr; }
  .task-phase-template-management .task-phase-template-grid { grid-template-columns: 1fr; }
  .task-phase-template-management .task-phase-editor-fields { flex-wrap: wrap; }
  .task-phase-builder-heading { align-items: stretch; flex-direction: column; }
  .task-phase-editor-fields { grid-template-columns: 1fr; }
  .task-phase-template-picker { min-width: 0; }
  .workflow-phase-template-head,
  .activity-model-inserter .workflow-phase-template-head { grid-template-columns: 1fr; }
}

/* Entrata merce da ordini di acquisto */
.goods-receipts-page {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.goods-receipts-page[hidden] { display: none; }

.goods-receipts-head,
.goods-receipt-order-card > header,
.goods-receipt-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.goods-receipts-head {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

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

.goods-receipts-head h2 { font-size: 18px; }
.goods-receipts-head > div > span { color: var(--muted); font-size: 12px; }

.goods-receipts-summary {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.goods-receipts-summary > span {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid #d8def3;
  border-radius: 999px;
  background: #f5f7ff;
}

.goods-receipts-summary strong { color: var(--primary); }
.goods-receipts-summary small { color: var(--muted); }

.goods-receipts-layout {
  display: grid;
  grid-template-columns: minmax(240px, .55fr) minmax(0, 1.7fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.goods-receipt-orders,
.goods-receipt-entry,
.goods-receipt-history {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.goods-receipt-order-card {
  margin-top: 7px;
  overflow: hidden;
  border: 1px solid #dfe3ef;
  border-radius: 10px;
  background: #fbfcff;
}

.goods-receipt-order-card > header { padding: 7px 9px; }
.goods-receipt-order-card > header div { display: grid; gap: 1px; }
.goods-receipt-order-card > header span,
.goods-receipt-order-card > header small { color: var(--muted); font-size: 11px; }

.goods-receipt-line {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-top: 1px solid #e5e8f1;
  border-radius: 0;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.goods-receipt-line:hover { background: #f3f6ff; }
.goods-receipt-line.selected { background: #edf2ff; box-shadow: inset 3px 0 0 var(--primary); }
.goods-receipt-line > span { min-width: 0; display: grid; gap: 1px; }
.goods-receipt-line > span b { color: var(--primary); font-size: 11px; }
.goods-receipt-line > span strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.goods-receipt-line > span small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.goods-receipt-line > i { padding: 3px 6px; border-radius: 999px; background: #eef0f7; font-size: 10px; font-style: normal; }
.goods-receipt-line > em { display: grid; min-width: 45px; text-align: right; font-style: normal; }
.goods-receipt-line > em small { color: var(--muted); font-size: 9px; }

.goods-receipt-entry { display: grid; gap: 8px; }
.goods-receipt-selection { min-height: 48px; display: flex; align-items: center; padding: 7px 9px; border: 1px solid #cfdaff; border-radius: 9px; background: #f3f6ff; }
.goods-receipt-selection > div { display: grid; gap: 1px; min-width: 0; }
.goods-receipt-selection small,
.goods-receipt-selection span { color: var(--muted); font-size: 10px; }
.goods-receipt-selection strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

.goods-receipt-fields {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(100px, .7fr) 82px minmax(110px, .8fr) 112px 112px;
  gap: 6px;
  align-items: end;
}

.goods-receipt-fields .receipt-unit-identities { grid-column: 1 / -1; }
.goods-receipt-fields .receipt-cost-control { grid-column: 1 / -1; }

.goods-receipt-entry .field { margin: 0; min-width: 0; }
.goods-receipt-entry .field > span:first-child { font-size: 10px; }
.goods-receipt-entry input,
.goods-receipt-entry select { width: 100%; min-width: 0; min-height: 34px; padding: 6px 8px; }
.goods-receipt-entry .inline-input-action { min-width: 0; }
.goods-receipt-entry .inline-input-action input { min-width: 0; }
.goods-receipt-entry textarea { min-height: 58px; resize: vertical; }
.goods-receipt-entry > .primary-button { justify-self: end; }

.goods-receipt-flags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 30px; }

.goods-receipt-history { display: grid; gap: 5px; }
.goods-receipt-history-row { padding: 7px 9px; border: 1px solid #e4e6ed; border-radius: 9px; }
.goods-receipt-history-row > span { display: grid; min-width: 0; gap: 1px; }
.goods-receipt-history-row > span:nth-child(2) { flex: 1; }
.goods-receipt-history-row > span:last-child { text-align: right; }
.goods-receipt-history-row b,
.goods-receipt-history-row strong { font-size: 11px; }
.goods-receipt-history-row small { color: var(--muted); font-size: 10px; }

.purchase-receipt-dialog {
  width: min(900px, calc(100vw - 28px));
  max-width: 900px;
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.purchase-receipt-dialog::backdrop { background: rgba(20, 27, 48, .42); }

#purchase-receipt-form {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 30px);
  padding: 12px;
  overflow: auto;
}

#purchase-receipt-form .dialog-header { position: static; padding: 0 0 8px; }
#purchase-receipt-form .dialog-header h2,
#purchase-receipt-form .dialog-header p { margin: 0; }

.purchase-receipt-context {
  display: grid;
  grid-template-columns: minmax(100px, .45fr) minmax(260px, 1.5fr) minmax(150px, .8fr) minmax(120px, .65fr);
  gap: 6px;
  padding: 7px;
  border: 1px solid #cfdaff;
  border-radius: 10px;
  background: #f3f6ff;
}

.purchase-receipt-context > span { display: grid; min-width: 0; gap: 1px; }
.purchase-receipt-context small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.purchase-receipt-context strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }

.purchase-receipt-grid {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) minmax(110px, .7fr) 84px minmax(120px, .8fr) 112px 112px;
  gap: 6px;
  align-items: end;
}

.purchase-receipt-grid .receipt-unit-identities { grid-column: 1 / -1; }
.purchase-receipt-grid .receipt-cost-control { grid-column: 1 / -1; }

.receipt-cost-control {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(150px, 190px) minmax(220px, 1fr);
  gap: 6px;
  align-items: end;
  padding: 6px;
  border: 1px solid #dde3f1;
  border-radius: 9px;
  background: #f8f9fd;
}
.receipt-cost-control .field { margin: 0; min-width: 0; }
.receipt-cost-control input[readonly] { color: #626a78; background: #f1f3f7; }
.receipt-cost-control input.is-editing { color: var(--text); background: #fff; border-color: #6f89e1; box-shadow: 0 0 0 2px rgba(69, 101, 212, .1); }
.receipt-cost-control .receipt-cost-edit { width: 34px; min-width: 34px; height: 34px; border-radius: 8px; }
.receipt-cost-control .receipt-cost-reason[hidden] { display: none; }

.receipt-tracking-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 9px;
  border-radius: 7px;
  background: #eef3ff;
  color: #34425f;
  font-size: 10px;
}
.receipt-tracking-note strong { color: #2448b2; font-size: 10px; }

.receipt-unit-identities {
  display: grid;
  gap: 3px;
  min-width: 0;
  max-height: 210px;
  padding: 5px;
  overflow: auto;
  border: 1px solid #dbe0ec;
  border-radius: 9px;
  background: #fafbfe;
}

.receipt-unit-identities:empty { display: none; }

.receipt-unit-empty {
  margin: 0;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 10px;
}

.receipt-unit-head,
.receipt-unit-row {
  display: grid;
  grid-template-columns: 26px minmax(150px, .8fr) minmax(190px, 1.15fr) minmax(150px, .9fr);
  gap: 5px;
  align-items: center;
  min-width: 570px;
}

.receipt-unit-head {
  position: sticky;
  z-index: 2;
  top: -5px;
  padding: 2px 4px 3px;
  background: #fafbfe;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.receipt-unit-row {
  min-height: 36px;
  padding: 3px 4px;
  border: 1px solid #e3e6ee;
  border-radius: 7px;
  background: #fff;
}

.receipt-unit-number {
  color: #4561bd;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.receipt-unit-row input {
  width: 100%;
  min-width: 0;
  min-height: 30px !important;
  height: 30px;
  padding: 4px 7px !important;
  font-size: 11px;
}

.receipt-unit-row .inline-input-action { gap: 3px; }
.receipt-unit-row .mini-action-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 7px;
}

.receipt-unit-serial:focus {
  border-color: #4565d4;
  box-shadow: 0 0 0 2px rgba(69, 101, 212, .12);
}

#purchase-receipt-form .field { min-width: 0; margin: 0; }
#purchase-receipt-form .field > span:first-child { font-size: 10px; }
#purchase-receipt-form input,
#purchase-receipt-form select { width: 100%; min-width: 0; min-height: 34px; padding: 6px 8px; }
#purchase-receipt-form textarea { width: 100%; min-height: 58px; resize: vertical; }
#purchase-receipt-form .inline-input-action { min-width: 0; }
#purchase-receipt-form .inline-input-action input { min-width: 0; }

.purchase-receipt-flags,
.purchase-receipt-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.receipt-toggle-button {
  position: relative;
  display: inline-flex;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.receipt-toggle-button input {
  position: absolute;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px;
  min-height: 1px !important;
  margin: 0;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.receipt-toggle-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid #d5d9e4;
  border-radius: 8px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}

.receipt-toggle-button span::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #aeb4c1;
}

.receipt-toggle-button:hover span { border-color: #aebbea; background: #f7f8ff; }
.receipt-toggle-button input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.receipt-toggle-button input:checked + span { border-color: #6681da; background: #eaf0ff; color: #2448b2; box-shadow: inset 0 0 0 1px rgba(69, 99, 194, .08); }
.receipt-toggle-button input:checked + span::before { background: #315bd1; box-shadow: 0 0 0 2px rgba(49, 91, 209, .15); }
.receipt-toggle-button.is-rental input:checked + span { border-color: #d6a84e; background: #fff2d7; color: #815300; }
.receipt-toggle-button.is-rental input:checked + span::before { background: #d79213; box-shadow: 0 0 0 2px rgba(215, 146, 19, .16); }
.receipt-toggle-button.is-override input:checked + span { border-color: #d88965; background: #fff0e9; color: #9b3e17; }
.receipt-toggle-button.is-override input:checked + span::before { background: #d05b26; box-shadow: 0 0 0 2px rgba(208, 91, 38, .15); }
.receipt-toggle-button input:disabled + span { cursor: default; opacity: .72; }
.purchase-receipt-actions { justify-content: flex-end; padding-top: 3px; }

@media (max-width: 1180px) {
  .goods-receipts-layout { grid-template-columns: 1fr; }
  .goods-receipt-fields {
    grid-template-columns: minmax(130px, 1fr) minmax(100px, .7fr) 82px minmax(110px, .8fr) 112px 112px;
  }
}

/* Interventi / Riparazioni */
.interventions-module {
  min-width: 0;
}

.interventions-heading {
  margin-bottom: 10px;
}

.repair-workspace {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.repair-list-panel,
.repair-form {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, .94);
  box-shadow: 0 10px 28px rgba(36, 41, 39, .045);
}

.repair-list-panel {
  position: sticky;
  top: 10px;
  overflow: hidden;
}

.repair-list-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.repair-list-tools input {
  min-width: 0;
  height: 35px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 11px;
}

.repair-list {
  display: grid;
  gap: 4px;
  max-height: calc(100vh - 245px);
  overflow: auto;
  padding: 6px;
}

.repair-list-row {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  text-align: left;
}

.repair-list-row:hover,
.repair-list-row.active {
  border-color: #cbd5f5;
  background: #f2f5ff;
}

.repair-list-row > b,
.repair-list-row > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repair-list-row > b { font-size: 11px; }
.repair-list-row > small { color: var(--ink-soft); font-size: 9px; }

.repair-list-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.repair-list-row-head strong {
  color: var(--blue-dark);
  font-size: 10px;
  letter-spacing: .025em;
}

.repair-list-row-head i {
  padding: 2px 5px;
  border-radius: 999px;
  background: #eceff4;
  color: #66706c;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.repair-list-row-head i[data-status="repairing"],
.repair-list-row-head i[data-status="testing"] { background: #fff0c7; color: #805500; }
.repair-list-row-head i[data-status="ready"] { background: #dff4e8; color: #176443; }
.repair-list-row-head i[data-status="closed"],
.repair-list-row-head i[data-status="cancelled"] { background: #edf0f2; color: #737b78; }

.repair-form {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.repair-form-head,
.repair-section-title,
.repair-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Interventi, contratti e timer */
.service-workspace,
.contract-workspace {
  display: grid;
  gap: 10px;
  min-height: 0;
  align-items: start;
}

.service-workspace { grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); }
.contract-workspace { grid-template-columns: minmax(220px, 27%) minmax(0, 1fr); }

.service-list-panel,
.service-editor,
.maintenance-quotes {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.service-list-panel { padding: 8px; }
.service-list-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin-bottom: 7px; }
.service-list-tools input { min-width: 0; height: 36px; }
.service-list { display: grid; gap: 4px; max-height: calc(100vh - 245px); overflow: auto; }
.service-workspace .service-list-panel { position: sticky; top: 10px; overflow: hidden; padding: 0; background: rgba(255, 253, 248, .94); box-shadow: 0 10px 28px rgba(36, 41, 39, .045); }
.service-workspace .service-list-tools { margin: 0; padding: 8px; border-bottom: 1px solid var(--line); }
.service-workspace .service-list-tools input { height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 11px; }
.service-workspace .service-list { padding: 6px; }
.service-workspace .service-list-tools .primary-button,
.repair-list-tools .primary-button { min-height: 35px; height: 35px; padding: 0 11px; border-radius: 9px; box-shadow: 0 4px 12px rgba(53, 88, 212, .16); font-size: 11px; }
.service-list-row { display: grid; gap: 2px; width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid transparent; border-radius: 9px; background: transparent; text-align: left; color: var(--ink); }
.service-list-row:hover,
.service-list-row.active { border-color: #cbd5f5; background: #f2f5ff; }
.service-list-row > b,
.service-list-row > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-list-row > b { font-size: 11px; }
.service-list-row > small { color: var(--ink-soft); font-size: 9px; }
.service-list-row-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.service-list-row-head > strong { overflow: hidden; color: var(--blue-dark); font-size: 10px; letter-spacing: .025em; text-overflow: ellipsis; white-space: nowrap; }
.service-list-row-badges { display: flex; align-items: center; justify-content: flex-end; gap: 3px; flex: 0 0 auto; }
.service-list-row .service-type-badge,
.service-status-badge { height: 16px; padding: 0 5px; border-radius: 999px; font-size: 8px; line-height: 1; }
.service-status-badge { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d8dde5; background: #eceff4; color: #66706c; font-style: normal; font-weight: 800; white-space: nowrap; }
.service-status-badge[data-status="scheduled"] { border-color: #bfcef7; background: #edf2ff; color: #3455a5; }
.service-status-badge[data-status="in_progress"] { border-color: #e8c36e; background: #fff0c7; color: #805500; }
.service-status-badge[data-status="awaiting_parts"],
.service-status-badge[data-status="awaiting_customer"],
.service-status-badge[data-status="awaiting_signature"],
.service-status-badge[data-status="awaiting_commission"],
.service-status-badge[data-status="paused"] { border-color: #e7b871; background: #fff4dd; color: #835514; }
.service-status-badge[data-status="completed"] { border-color: #9bcfb3; background: #dff4e8; color: #176443; }
.service-status-badge[data-status="closed"],
.service-status-badge[data-status="cancelled"] { border-color: #d8dde1; background: #edf0f2; color: #737b78; }

.service-editor { padding: 10px; overflow: auto; }
.service-editor-head { display: flex; align-items: end; justify-content: space-between; gap: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.service-editor-head h2 { margin: 1px 0 0; font-size: 1.05rem; }
.intervention-integrated-heading { position: relative; display: grid; gap: 1px; min-width: 250px; }
.service-editor .intervention-integrated-heading input { width: min(520px, 48vw); min-height: 35px; height: 35px; padding: 2px 7px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 1.05rem; font-weight: 800; }
.service-editor .intervention-integrated-heading input:hover,
.service-editor .intervention-integrated-heading input:focus { border-color: #cbd4ec; background: #fff; box-shadow: 0 0 0 3px rgba(75, 105, 175, .1); outline: 0; }
.service-editor .intervention-integrated-heading input.is-invalid,
.intervention-start-heading input.is-invalid { border-color: #c93e35; background: #fff; box-shadow: 0 0 0 2px rgba(201,62,53,.12); }
.intervention-integrated-heading .intervention-required-message { bottom: -13px; }
.service-editor-head-fields { display: flex; align-items: end; gap: 6px; }
.intervention-header-new { min-height: 35px; height: 35px; align-self: end; }
.service-editor .field > span,
.maintenance-quotes .field > span { font-size: .64rem; }
.service-editor input,
.service-editor select,
.service-editor textarea,
.maintenance-quotes input,
.maintenance-quotes select { min-height: 35px; height: 35px; padding: 5px 8px; }
.service-data-grid,
.contract-data-grid { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(155px, .85fr) minmax(75px, .42fr) minmax(80px, .45fr) minmax(75px, .4fr); gap: 6px; padding: 8px 0; align-items: end; }
.anchored-form-grid {
  --anchored-control-height: 35px;
  align-items: end;
  grid-auto-flow: row;
}
.anchored-form-grid > .field {
  display: grid;
  grid-template-rows: 13px var(--anchored-control-height);
  align-content: end;
  gap: 3px;
  min-width: 0;
  margin: 0;
}
.anchored-form-grid > .field > span {
  min-width: 0;
  overflow: hidden;
  line-height: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.anchored-form-grid > .field > input,
.anchored-form-grid > .field > select,
.anchored-form-grid > .field > button,
.anchored-form-grid .anchored-button-field > button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: var(--anchored-control-height);
  height: var(--anchored-control-height);
  margin: 0;
}
.anchored-button-field { min-width: 0; }
.service-customer-field { grid-column: span 1; }
.service-contract-field { grid-column: span 2; }
.service-description-field { grid-column: span 3; }
.service-internal-notes-field { grid-column: span 2; }
.intervention-context-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: -1px 0 8px; }
.intervention-contact-summary,
.intervention-planning-summary { min-height: 29px; padding: 5px 9px; border: 1px solid #dce2ee; border-radius: 9px; background: #f7f9fd; color: #4f5b69; font-size: .72rem; line-height: 1.2; }
.intervention-contact-summary { cursor: pointer; }
.intervention-contact-summary:hover { border-color: #9eafe1; background: #eef2ff; color: #294da8; }
.intervention-contact-summary strong { color: inherit; }
.intervention-planning-summary::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #4264cf; vertical-align: 1px; }
.anchored-form-grid > .field.intervention-text-field { grid-template-rows: 13px minmax(56px, auto); }
.intervention-text-field textarea,
.intervention-start-description textarea,
.intervention-start-notes textarea { box-sizing: border-box; width: 100%; min-width: 0; overflow-y: hidden; resize: none; border: 1px solid var(--line); border-radius: 9px; font: inherit; color: var(--text); }
.service-editor .intervention-text-field { align-self: stretch; }
.service-editor .intervention-text-field textarea { min-height: 56px; height: auto; padding: 7px 8px; }
.internal-notes-field textarea { border-color: #dfd2a6; background: #fff8df; box-shadow: inset 0 1px 2px rgba(116, 91, 25, .06); }
.service-section-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.service-section-title > div { display: grid; gap: 1px; }
.service-section-title span { color: var(--muted); font-size: .72rem; }
.intervention-task-head-actions { display: flex !important; grid-auto-flow: column; align-items: center; gap: 6px !important; }
.intervention-trash-button { position: relative; width: 34px; height: 34px; color: #667080; }
.intervention-trash-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.intervention-trash-button.has-items { border-color: #d99655; color: #a85b18; background: #fff7ea; }
.intervention-trash-button > span { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #d87520; color: white; font-size: .62rem; font-weight: 800; line-height: 1; }
.intervention-activities,
.contract-plan-section { border-top: 1px solid var(--line); padding-top: 8px; }
.intervention-task-add { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(120px, .5fr) 58px 54px 94px auto; gap: 5px; align-items: center; }
.intervention-task-add input,
.intervention-task-add select,
.contract-plan-add input,
.contract-plan-add select { min-width: 0; height: 34px; }
.intervention-task-list,
.contract-plan-list { display: grid; gap: 4px; margin-top: 6px; }
.intervention-trash-dialog { width: min(690px, calc(100vw - 28px)); max-width: 690px; border: 0; border-radius: 17px; padding: 0; box-shadow: 0 22px 65px rgba(27, 36, 62, .25); }
.intervention-trash-shell { display: grid; gap: 9px; padding: 14px; border: 1px solid #e1e4ed; border-radius: 17px; background: #fffdfa; }
.intervention-trash-help { margin: 0; color: var(--muted); font-size: .78rem; }
.intervention-trash-list { display: grid; gap: 6px; max-height: min(55vh, 480px); overflow-y: auto; }
.intervention-trash-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 48px; padding: 7px 8px; border: 1px solid #e1e4ed; border-radius: 10px; background: #fff; }
.intervention-trash-row > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.intervention-trash-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.intervention-trash-row small { color: var(--muted); font-size: .69rem; }
.intervention-trash-kind { display: inline-flex; justify-content: center; width: fit-content; padding: 3px 6px; border-radius: 999px; background: #eef1fb; color: #42589d !important; font-size: .62rem !important; font-weight: 800; text-transform: uppercase; }
.intervention-trash-kind.session { background: #fff2df; color: #975c13 !important; }
.intervention-trash-locked { color: var(--muted); font-size: .7rem; }
.intervention-complete-button { border-color: #23845e; background: linear-gradient(180deg, #35a978, #23845e); color: #fff; }
.intervention-complete-button:hover { background: linear-gradient(180deg, #3db681, #287d5c); }
.intervention-plan-lock { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid #d8cda9; border-radius: 8px; background: #fffaf0; color: #725716; }
.intervention-plan-lock > span { flex: 0 0 auto; font-size: .82rem; }
.intervention-plan-lock > div { display: grid; gap: 1px; min-width: 0; }
.intervention-plan-lock strong { font-size: .75rem; }
.intervention-plan-lock small { color: #806b39; font-size: .68rem; }
.intervention-task-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 31px; gap: 6px; align-items: center; min-height: 38px; padding: 4px 5px; border: 1px solid #dce2f3; border-radius: 9px; background: #fbfcff; }
.intervention-task-block { display: grid; gap: 0; border: 1px solid #dce2f3; border-radius: 9px; background: #fbfcff; overflow: visible; }
.intervention-task-block > .intervention-task-row { border: 0; border-radius: 8px; background: transparent; }
.intervention-task-block:not(.has-running-session) > .intervention-task-row {
  box-sizing: border-box;
  width: 100%;
  grid-template-columns: max-content minmax(125px, 1fr) 112px 35px;
  gap: 5px;
  align-items: center;
}
.intervention-task-block:not(.has-running-session) > .intervention-task-row > .timer-button {
  box-sizing: border-box;
  width: 112px;
  min-width: 112px;
  min-height: 35px;
  height: 35px;
  margin: 0;
  padding: 0 8px;
  align-self: center;
}
.intervention-task-block:not(.has-running-session) > .intervention-task-row > .icon-button {
  box-sizing: border-box;
  width: 35px;
  min-width: 35px;
  height: 35px;
  min-height: 35px;
  margin: 0;
  align-self: center;
}
.intervention-task-block:not(.has-running-session) > .intervention-task-row:has(.intervention-task-timer-actions) {
  grid-template-columns: max-content minmax(125px, 1fr) 176px 35px;
}
.intervention-task-block:not(.has-running-session) .intervention-task-timer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  width: 176px;
  min-width: 0;
  align-self: center;
}
.intervention-task-block:not(.has-running-session) .intervention-task-timer-actions .timer-button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 35px;
  height: 35px;
  margin: 0;
  padding: 0 6px;
  font-size: .72rem;
  line-height: 1;
  white-space: nowrap;
}
.intervention-task-block.has-running-session { border-color: #bfcdf0; background: #f9faff; }
.intervention-task-block.billing-included:not(.is-completed) {
  border-color: #b9d8c6;
  background: #f3faf6;
  box-shadow: inset 3px 0 0 #78b391;
}
.intervention-task-block.billing-extra:not(.is-completed) {
  border-color: #ead2a2;
  background: #fff9ec;
  box-shadow: inset 3px 0 0 #d8a84a;
}
.intervention-task-block.is-completed {
  border-color: #9bc9aa;
  background: #eef8f1;
}
.intervention-task-block.is-completed > .intervention-task-row { background: transparent; }
.intervention-task-block.is-completed .intervention-task-copy strong { color: #17643a; }
.intervention-task-block.is-completed .intervention-task-history {
  border-top-color: #b8d8c3;
  background: #f1f9f3;
}
.intervention-task-block.is-completed .intervention-time-row {
  color: #245f3d;
  background: #e2f3e7;
  box-shadow: inset 3px 0 0 #58a874;
}
.intervention-task-block.is-completed .intervention-time-row small,
.intervention-task-block.is-completed .intervention-time-row em {
  color: #47745a;
}
.intervention-task-block.has-running-session {
  --intervention-row-control-height: 35px;
}
.intervention-task-block.has-running-session > .intervention-task-row {
  box-sizing: border-box;
  width: 100%;
  grid-template-columns: max-content minmax(125px, 1fr) minmax(172px, 190px) 86px 174px 35px;
  grid-template-rows: var(--intervention-row-control-height);
  column-gap: 5px;
  row-gap: 0;
  align-items: stretch;
}
.intervention-task-block.has-running-session .intervention-task-copy,
.intervention-task-block.has-running-session > .intervention-task-row > .service-type-badge {
  grid-row: 1;
  align-self: center;
}
.intervention-running-skill,
.intervention-running-billing { display: block; grid-row: 1; min-width: 0; margin: 0; }
.intervention-running-skill select,
.intervention-running-billing button { box-sizing: border-box; width: 100%; min-width: 0; min-height: 35px; height: 35px; margin: 0; }
.intervention-task-block.has-running-session .intervention-task-timer-actions {
  display: grid;
  grid-template-columns: 47px 65px 54px;
  gap: 4px;
  width: 174px;
  min-width: 0;
  grid-row: 1;
  align-self: stretch;
}
.intervention-task-block.has-running-session .intervention-task-timer-actions .timer-button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: var(--intervention-row-control-height);
  height: var(--intervention-row-control-height);
  padding: 0 3px;
  margin: 0;
  font-size: .66rem;
  line-height: 1;
  white-space: nowrap;
}
.intervention-task-block.has-running-session > .intervention-task-row > .icon-button {
  box-sizing: border-box;
  width: var(--intervention-row-control-height);
  min-width: var(--intervention-row-control-height);
  height: var(--intervention-row-control-height);
  min-height: var(--intervention-row-control-height);
  margin: 0;
  grid-row: 1;
  align-self: stretch;
}
.intervention-running-editor { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 6px; align-items: end; padding: 2px 5px 6px; }
.intervention-running-editor > .field { grid-template-rows: 13px minmax(48px, auto); align-self: stretch; }
.intervention-running-editor textarea { box-sizing: border-box; width: 100%; min-width: 0; min-height: 48px; height: auto; padding: 6px 8px; overflow-y: hidden; resize: none; border: 1px solid var(--line); border-radius: 9px; font: inherit; color: var(--text); }
.intervention-running-editor textarea.is-invalid { border-color: #c93e35; box-shadow: 0 0 0 2px rgba(201,62,53,.12); }
.intervention-running-description { position: relative; }
.intervention-running-description .intervention-required-message { bottom: -15px; }
.intervention-running-editor:has(.intervention-running-description textarea.is-invalid) { margin-bottom: 14px; }
.intervention-task-badges.service-type-badge { display: flex; gap: 4px; align-items: center; padding: 0; border: 0; background: transparent; }
.repair-return-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: end; margin-top: 10px; }
.repair-return-settings select, .repair-return-settings input, .repair-return-settings button { box-sizing: border-box; min-height: 35px; height: 35px; border-radius: 8px; }
.repair-return-settings > strong, #repair-return-address-box { grid-column: 1 / -1; }
#repair-return-address-box:not([hidden]) { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#repair-return-address-text { flex: 1; min-width: 150px; }
.repair-return-steps > div { display: grid; gap: 4px; padding: 9px 0; border-bottom: 1px solid var(--line); }
#repair-return-dialog { max-height: 90vh; overflow: auto; }
@media (max-width: 600px) { .repair-return-settings { grid-template-columns: 1fr; } }
.intervention-task-badges > .document-code-badge,
.intervention-task-badges > .service-type-badge {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  height: 24px; min-height: 24px; padding: 0 7px; line-height: 1; margin: 0;
}
.intervention-task-row.is-blocked { background: #f5f5f7; border-color: #e1e2e7; }
.intervention-task-row.is-blocked .intervention-task-copy strong { color: #71747d; }
.intervention-task-copy { display: grid; min-width: 0; }
.intervention-task-copy strong,
.intervention-task-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intervention-task-copy strong { font-size: .82rem; }
.intervention-task-copy small { color: var(--muted); font-size: .69rem; }
.intervention-task-context { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 10px; min-height: 14px; color: #5f6875; font-size: .66rem; line-height: 1.15; }
.intervention-task-contact,
.intervention-task-planning { white-space: nowrap; }
.intervention-task-contact-link { color: #3156b3; font-weight: 800; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(49,86,179,.32); text-underline-offset: 2px; }
.intervention-task-contact-link:hover,
.intervention-task-contact-link:focus { color: #173b98; text-decoration-color: currentColor; outline: 0; }
.intervention-task-internal-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #78642f; font-size: .67rem; font-style: italic; }
.intervention-task-planning::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: #4264cf; vertical-align: 1px; }
.intervention-time-history { display: grid; gap: 3px; margin-top: 7px; }
.intervention-time-history > strong { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.intervention-time-history > span { display: grid; grid-template-columns: 105px minmax(150px, 1fr) 205px 58px minmax(115px, .55fr) 62px; gap: 7px; align-items: center; min-height: 32px; padding: 3px 6px 3px 8px; border-radius: 8px; background: #f5f7fb; font-size: .69rem; }
.intervention-time-row.billing-included { background: #eef8f2; box-shadow: inset 3px 0 0 #79b391; }
.intervention-time-row.billing-extra { background: #fff6e4; box-shadow: inset 3px 0 0 #d8a84a; }
.intervention-hourly-rate { color: #84530d; font-weight: 900; }
.intervention-included-rate { color: #28734b; font-weight: 850; }
.intervention-time-history i,
.intervention-time-history em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; }
.intervention-time-history small { color: var(--muted); }
.intervention-time-history small { display: flex; gap: 6px; white-space: nowrap; }
.intervention-time-history .intervention-time-row > strong { text-align: right; font-size: .72rem; }
.intervention-task-history { margin: 0; padding: 5px 7px 7px; border-top: 1px solid #e4e8f1; background: #fbfcff; }
.intervention-time-actions { display: flex; justify-content: flex-end; gap: 3px; }
.intervention-time-actions .icon-button { width: 28px; min-width: 28px; height: 28px; min-height: 28px; }
.intervention-force-billing { min-height: 35px; height: 35px; padding: 0 8px; border: 1px solid #d5dce8; border-radius: 9px; background: #f7f8fb; color: #5d656f; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.intervention-force-billing.active,
.intervention-force-billing[aria-pressed="true"] { border-color: #df9b30; background: #fff0ce; color: #87520a; }

.intervention-start-dialog { width: min(1040px, calc(100vw - 28px)); max-width: 1040px; border: 0; border-radius: 17px; padding: 0; overflow: visible; box-shadow: 0 22px 65px rgba(27, 36, 62, .25); }
.intervention-task-create-dialog { width: min(1040px, calc(100vw - 28px)); max-width: 1040px; border: 0; border-radius: 17px; padding: 0; overflow: visible; box-shadow: 0 22px 65px rgba(27, 36, 62, .25); }
.intervention-start-shell,
.intervention-time-entry-shell,
.intervention-task-create-shell { display: grid; gap: 10px; padding: 14px; border: 1px solid #e1e4ed; border-radius: 17px; background: #fffdfa; }
.intervention-task-create-grid { display: grid; }
.intervention-task-create-grid input[readonly] { border-color: #dfe3eb; background: #f3f5f8; color: #5f6670; }
.intervention-start-grid { display: grid; grid-template-columns: minmax(206px, .98fr) minmax(210px, 1fr) 108px minmax(160px, .78fr) 126px; gap: 7px; align-items: end; }
.intervention-start-customer { position: relative; grid-column: auto; }
.intervention-start-customer > .address-book-native-select { position: absolute; }
.intervention-start-customer .address-book-combobox,
.intervention-start-customer .address-book-combobox-input { box-sizing: border-box; width: 100%; min-height: var(--anchored-control-height); height: var(--anchored-control-height); margin: 0; }
.intervention-start-customer .address-book-combobox-option { padding-block: 7px; }
.intervention-start-customer .address-book-combobox-option strong { font-size: .73rem; font-weight: 800; }
.intervention-start-heading { position: relative; display: grid; gap: 1px; min-width: 300px; }
.intervention-start-heading input { width: min(520px, 70vw); min-height: 35px; height: 35px; padding: 2px 7px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 1.18rem; font-weight: 800; }
.intervention-start-heading input:hover,
.intervention-start-heading input:focus { border-color: #cbd4ec; background: #fff; box-shadow: 0 0 0 3px rgba(75, 105, 175, .1); outline: 0; }
.intervention-start-heading .intervention-required-message { bottom: -13px; }
.anchored-form-grid > .field.intervention-start-description,
.anchored-form-grid > .field.intervention-start-notes { grid-template-rows: 13px minmax(68px, auto); align-self: stretch; }
.intervention-start-description { grid-column: 1 / span 3; }
.intervention-start-notes { grid-column: 4 / -1; }
.intervention-start-description textarea,
.intervention-start-notes textarea { min-height: 68px; height: auto; padding: 7px 9px; }
.intervention-start-description { position: relative; }
.intervention-start-grid:has(.intervention-start-description.has-error) { margin-bottom: 14px; }
.intervention-start-description textarea.is-invalid { border-color: #c93e35; box-shadow: 0 0 0 2px rgba(201,62,53,.12); }
.intervention-required-message { position: absolute; left: 2px; bottom: -15px; display: block; color: #b42e27; font-size: .66rem; font-weight: 800; line-height: 13px; }
.intervention-required-message[hidden] { display: none; }
.intervention-start-grid select:disabled { border-color: #d8dadd; background: #eceeef; color: #8a8e94; cursor: not-allowed; opacity: 1; }
.intervention-live-timer { display: grid; grid-template-columns: 35px 35px 130px 35px; align-items: center; justify-self: start; gap: 7px; width: max-content; padding: 6px 8px 8px; border: 1px solid #b9d9c6; border-radius: 12px; background: linear-gradient(180deg, #f5fff8 0%, #e7f5ec 100%); box-shadow: inset 0 1px 0 #fff, 0 2px 5px rgba(38, 87, 57, .12); }
.intervention-live-timer > div { display: grid; gap: 1px; }
.intervention-live-timer span { color: #65706b; font-size: .64rem; font-weight: 800; text-transform: uppercase; }
.intervention-live-timer strong { color: #176443; font-variant-numeric: tabular-nums; font-size: 1rem; }
.intervention-timer-control { box-sizing: border-box; width: 35px; min-width: 35px; height: 35px; min-height: 35px; padding: 0; border: 1px solid rgba(83, 96, 104, .32); border-radius: 50%; display: grid; place-items: center; color: rgba(53, 65, 70, .58); background: rgba(255,255,255,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 2px 4px rgba(35,48,42,.08); opacity: .58; transition: opacity .14s ease, transform .12s ease, box-shadow .14s ease, background .14s ease, color .14s ease; }
.intervention-timer-control:disabled { cursor: default; }
.intervention-timer-play.is-active { border-color: #1e7749; background: radial-gradient(circle at 35% 25%, #76da9c 0%, #32a463 48%, #207b4b 100%); color: #fff; box-shadow: inset 0 1px 1px rgba(255,255,255,.72), 0 0 0 2px rgba(56,174,101,.13), 0 0 12px rgba(37,164,88,.46), 0 3px 5px rgba(29,105,63,.25); opacity: 1; }
.intervention-timer-pause.is-active { border-color: #a77918; background: radial-gradient(circle at 35% 25%, #ffe393 0%, #e8ae31 50%, #b77b12 100%); color: #5f3a00; box-shadow: inset 0 1px 1px rgba(255,255,255,.75), 0 0 0 2px rgba(231,174,53,.14), 0 0 12px rgba(216,151,28,.42), 0 3px 5px rgba(128,83,7,.2); opacity: 1; }
.intervention-timer-stop.is-active { border-color: #a9382a; background: radial-gradient(circle at 35% 25%, #ff9c8b 0%, #e75743 50%, #ad3021 100%); color: #fff; box-shadow: inset 0 1px 1px rgba(255,255,255,.7), 0 0 0 2px rgba(214,72,54,.13), 0 0 12px rgba(205,57,40,.4), 0 3px 5px rgba(139,52,39,.22); opacity: 1; }
.intervention-timer-control:not(:disabled):active { transform: translateY(2px); box-shadow: inset 0 1px 2px rgba(0,0,0,.15), 0 1px 0 rgba(0,0,0,.22); }
.timer-control-icon { width: 17px; height: 17px; fill: currentColor; }
.intervention-start-help { margin: 0; color: var(--muted); font-size: .71rem; }
.intervention-start-options { display: grid; grid-template-columns: 112px minmax(210px, 1fr) 35px 112px 142px 94px; gap: 7px; align-items: center; }
.intervention-start-options > input,
.intervention-contact-picker > input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 35px; height: 35px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); font: inherit; }
.intervention-start-options input:disabled { background: #eceeef; color: #8a8e94; cursor: not-allowed; }
.intervention-start-mode-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 35px; height: 35px; padding: 0 9px; border: 1px solid #ccd4e3; border-radius: 9px; background: #f5f7fb; color: #566172; font-size: .72rem; font-weight: 800; }
.intervention-start-mode-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#intervention-contact-toggle svg,
#intervention-task-contact-toggle svg { fill: currentColor; stroke: none; }
.intervention-start-mode-button[aria-pressed="true"] { border-color: #7892e7; background: #e9efff; color: #284bbd; box-shadow: 0 0 0 2px rgba(65,94,202,.1); }
.intervention-contact-picker { position: relative; min-width: 0; }
.intervention-contact-results { position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; left: 0; max-height: 190px; overflow: auto; padding: 4px; border: 1px solid #ccd4e3; border-radius: 10px; background: #fff; box-shadow: 0 10px 25px rgba(31,43,73,.16); }
.intervention-contact-dialog { width: min(430px, calc(100vw - 28px)); max-width: 430px; border: 0; border-radius: 15px; padding: 0; box-shadow: 0 20px 58px rgba(27,36,62,.24); }
.intervention-contact-shell { display: grid; gap: 10px; padding: 14px; border: 1px solid #e1e4ed; border-radius: 15px; background: #fffdfa; }
.intervention-contact-detail { display: grid; gap: 5px; }
.intervention-contact-detail a,
.intervention-contact-detail span { display: grid; grid-template-columns: 74px minmax(0,1fr); gap: 8px; align-items: baseline; min-height: 30px; padding: 6px 8px; border-radius: 8px; background: #f5f7fb; color: var(--text); font-size: .76rem; text-decoration: none; }
.intervention-contact-detail b { color: var(--muted); font-size: .63rem; text-transform: uppercase; letter-spacing: .04em; }
.intervention-contact-detail a:hover { background: #eaf0ff; color: #294da8; }
.intervention-contact-results button { display: grid; width: 100%; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.intervention-contact-results button:hover { background: #eef2ff; }
.intervention-contact-results strong { font-size: .73rem; }
.intervention-contact-results small { overflow: hidden; color: var(--muted); font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.intervention-add-contact { width: 35px; min-width: 35px; height: 35px; min-height: 35px; margin: 0; }
.intervention-new-contact { display: grid; grid-template-columns: minmax(120px,.8fr) minmax(120px,.8fr) minmax(180px,1.2fr) minmax(140px,.9fr) 82px; gap: 7px; padding: 7px; border: 1px solid #dce2ed; border-radius: 10px; background: #f7f9fc; }
.intervention-new-contact input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 35px; height: 35px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.intervention-start-actions { grid-template-columns: 1fr auto auto auto; }

.intervention-time-entry-dialog { width: min(1040px, calc(100vw - 28px)); max-width: 1040px; border: 0; border-radius: 17px; padding: 0; box-shadow: 0 22px 65px rgba(27, 36, 62, .25); }
.intervention-time-entry-grid { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) 120px minmax(180px, .9fr) 126px; gap: 7px; align-items: end; }
.intervention-time-entry-grid .time-entry-description { grid-column: 1 / span 3; }
.intervention-time-entry-grid .time-entry-internal-notes { grid-column: 4 / -1; }
.intervention-time-entry-grid > .intervention-text-field { grid-template-rows: 13px minmax(68px, auto); align-self: stretch; }
.intervention-time-entry-grid textarea { box-sizing: border-box; width: 100%; min-width: 0; min-height: 68px; height: auto; padding: 7px 9px; overflow-y: hidden; resize: none; border: 1px solid var(--line); border-radius: 9px; font: inherit; color: var(--text); }

@media (max-width: 760px) {
  .intervention-start-grid,
  .intervention-time-entry-grid,
  .intervention-task-create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intervention-start-customer,
  .intervention-start-description,
  .intervention-start-notes,
  .intervention-time-entry-grid .time-entry-description,
  .intervention-time-entry-grid .time-entry-internal-notes,
  .intervention-task-create-customer,
  .intervention-task-create-contract { grid-column: 1 / -1; }
  .intervention-time-history > span { grid-template-columns: minmax(90px, .5fr) minmax(140px, 1fr) auto; }
  .intervention-running-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intervention-task-block.has-running-session > .intervention-task-row { grid-template-columns: auto minmax(0, 1fr) auto 31px; align-items: center; }
  .intervention-task-block.has-running-session .intervention-task-copy,
  .intervention-task-block.has-running-session > .intervention-task-row > .service-type-badge,
  .intervention-task-block.has-running-session .intervention-running-skill,
  .intervention-task-block.has-running-session .intervention-running-billing,
  .intervention-task-block.has-running-session .intervention-task-timer-actions,
  .intervention-task-block.has-running-session > .intervention-task-row > .icon-button { grid-row: auto; }
  .intervention-task-block.has-running-session .intervention-running-skill,
  .intervention-task-block.has-running-session .intervention-running-billing { grid-column: span 2; }
  .intervention-running-description,
  .intervention-running-notes { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .intervention-start-options { grid-template-columns: 105px minmax(180px, 1fr) 35px 105px 1fr 90px; }
  .intervention-new-contact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intervention-new-contact button { grid-column: 2; justify-self: end; }
}
.timer-button { height: 29px; padding: 0 9px; border: 1px solid #8ca1ed; border-radius: 8px; background: #eef2ff; color: #2444b7; font-weight: 700; font-size: .7rem; }
.timer-button.stop { border-color: #eea67e; background: #fff1e9; color: #a83e12; }
.timer-button.complete { border-color: #86c6a0; background: #edf9f1; color: #16713a; }
.timer-button.restart { border-color: #79b98f; background: #e8f6ed; color: #126536; }
.timer-button.cancel { border-color: #e5a6a6; background: #fff7f7; color: #a52d2d; }
.intervention-task-timer-actions { display: flex; align-items: center; gap: 4px; }

.task-intervention-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 9px;
  background: #f4f6fb;
  border: 1px solid #d8dfef;
  border-radius: 10px;
}

.task-intervention-timer.is-running {
  background: #edf8f1;
  border-color: #b7dbc4;
}

.task-intervention-timer-state {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-intervention-timer-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  color: #3756ba;
  background: #e5eaff;
  border-radius: 999px;
  font-size: 10px;
}

.task-intervention-timer.is-running .task-intervention-timer-icon {
  color: #1f7a4d;
  background: #d8f0e1;
}

.task-intervention-timer-state > span:last-child {
  display: grid;
  gap: 1px;
}

.task-intervention-timer-state small,
.task-intervention-timer-state em {
  color: var(--ink-soft);
  font-size: 9px;
  font-style: normal;
}

.task-intervention-timer-state strong { font-size: 12px; }

.task-intervention-timer-state strong b {
  color: #1f7a4d;
  font-variant-numeric: tabular-nums;
}

.task-intervention-timer-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

@media (max-width: 660px) {
  .task-intervention-timer {
    align-items: stretch;
    flex-direction: column;
  }

  .task-intervention-timer-actions .timer-button { flex: 1; }
}
.service-editor-actions { display: flex; justify-content: flex-end; gap: 6px; padding-top: 8px; }
.intervention-report-workflow {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid #cdd9f4;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8faff, #f1f5ff);
}
.intervention-report-workflow[hidden] { display: none; }
.intervention-report-workflow-copy { display: flex; flex-direction: column; min-width: 0; }
.intervention-report-workflow-copy strong { font-size: 13px; }
.intervention-report-workflow-copy span { color: var(--muted); font-size: 11px; }
.intervention-report-state {
  border: 1px solid #e4bd61;
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff5d9;
  color: #795308;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}
.intervention-report-state.is-acquired {
  border-color: #83c5a0;
  background: #e8f7ee;
  color: #17653a;
}
.intervention-report-state.is-warning {
  border-color: #e19b39;
  background: #fff0d3;
  color: #89520a;
}
.intervention-reopen-button { border-color: #d3a54b; background: #fff6df; color: #7d5510; }
.intervention-report-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
@media (max-width: 900px) {
  .intervention-report-workflow { grid-template-columns: 1fr auto; }
  .intervention-report-actions { grid-column: 1 / -1; }
}
.service-type-badge,
.contract-status { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; height: 21px; padding: 0 7px; border: 1px solid #cbd3df; border-radius: 999px; background: #f3f5f7; color: #53606d; font-size: .63rem; font-style: normal; font-weight: 800; line-height: 1; text-transform: uppercase; }
.service-type-badge.ordinary { border-color: #62b98a; background: #eaf8f0; color: #1b6b42; }
.service-type-badge.extraordinary { border-color: #e7a64b; background: #fff5df; color: #925809; }
.service-type-badge.repair { border-color: #b58be4; background: #f4edff; color: #6e2eb2; }
.service-type-badge.supply { border-color: #7194e8; background: #eef3ff; color: #3155b3; }
.contract-status.active { border-color: #62b98a; background: #eaf8f0; color: #1b6b42; }
.contract-status.pending { border-color: #cbd1d6; background: #eceff1; color: #5f676d; }
.contract-status.expiring { border-color: #e0b649; background: #fff2bd; color: #795600; }
.contract-status.suspended { border-color: #e7a64b; background: #fff5df; color: #925809; }
.contract-status.expired,
.contract-status.terminated { border-color: #d68484; background: #fff0f0; color: #9b3030; }

.contract-readonly-head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; }
.contract-document-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
.contract-document-actions button:disabled { opacity: .45; cursor: not-allowed; }
.visually-hidden { 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; }
.contract-list-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
.contract-workspace .service-list-tools.contract-list-tools input { height: 31px; min-height: 31px; padding: 0 10px; border: 1px solid #d8d5cc; border-radius: 9px; background: #fffdf9; color: var(--ink); box-shadow: inset 0 1px 1px rgba(41, 47, 61, .025); font-size: .66rem; outline: none; }
.contract-workspace .service-list-tools.contract-list-tools input:hover { border-color: #c3c9d8; }
.contract-workspace .service-list-tools.contract-list-tools input:focus { border-color: #8ea3df; background: #fff; box-shadow: 0 0 0 3px rgba(67, 96, 190, .1); }
.contract-list-tools .contract-register-existing { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 0; height: 31px; min-height: 31px; padding: 0 8px; border-color: #cfd6e7; border-radius: 9px; background: #f8f9fc; color: #31436f; box-shadow: none; font-size: .61rem; font-weight: 750; line-height: 1; white-space: nowrap; }
.contract-list-tools .contract-register-existing:hover { border-color: #aebbe0; background: #eef2ff; color: #2948aa; }
.contract-list-tools .contract-register-existing > span { display: grid; place-items: center; flex: 0 0 14px; width: 14px; height: 14px; margin-right: 3px; border-radius: 50%; background: #dfe7ff; color: #3156ba; line-height: 0; }
.contract-list-tools .contract-register-existing > span svg { display: block; width: 8px; height: 8px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.contract-code-label { display: inline-flex; align-items: center; min-height: 19px; margin: 0 0 3px; padding: 0 7px; border: 1px solid #ccd6f1; border-radius: 999px; background: #f2f5ff; color: #3e5da9; font-size: .58rem; letter-spacing: .08em; line-height: 1; box-shadow: none; }
.contract-document-state { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 0 10px; border: 1px solid #dfb35c; border-radius: 999px; background: #fff4d7; color: #815610; font-size: .66rem; font-weight: 850; }
.contract-document-state.regularized { border-color: #77bd92; background: #e9f8ef; color: #17633a; }
.pre-existing-contract-dialog { width: min(1120px, calc(100vw - 24px)); max-width: 1120px; max-height: calc(100dvh - 24px); overflow: auto; border: 1px solid #d7d3ca; border-radius: 16px; background: #fbfaf7; box-shadow: 0 20px 60px rgba(39, 43, 51, .22); }
.pre-existing-contract-dialog::backdrop { background: rgba(24, 29, 40, .42); backdrop-filter: blur(2px); }
.pre-existing-contract-shell { display: grid; min-height: 0; }
.pre-existing-contract-shell > .dialog-header { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.pre-existing-contract-body { display: grid; gap: 7px; padding: 10px 14px; }
.pre-existing-contract-body .maintenance-editor-section { grid-template-columns: minmax(0, 1fr); }
.pre-existing-contract-dialog .maintenance-contract-basics-grid { grid-template-columns: minmax(260px, 1.35fr) minmax(200px, .9fr); }
.pre-existing-contract-admin { display: grid; grid-template-columns: 135px 180px 150px repeat(2, minmax(120px, 1fr)) 145px; grid-template-areas: "kind number attachment customer customer customer" "start duration billing renew reason reason"; gap: 7px; align-items: end; min-width: 0; padding: 8px; border: 1px solid #dce7f5; border-radius: 10px; background: #f9fcff; }
.pre-existing-contract-admin.is-subscription { grid-template-columns: 135px 165px minmax(245px, 1.3fr) minmax(300px, 1.6fr); grid-template-areas: "kind number customer reason"; }
.pre-existing-contract-kind { grid-area: kind; }
.pre-existing-contract-number { grid-area: number; }
.pre-existing-contract-attachment { grid-area: attachment; }
.pre-existing-contract-customer { grid-area: customer; }
.pre-existing-contract-billing { grid-area: billing; }
.pre-existing-contract-start { grid-area: start; }
.pre-existing-contract-duration { grid-area: duration; }
.pre-existing-contract-renew { grid-area: renew; }
.pre-existing-contract-reason { grid-area: reason; }
.pre-existing-contract-admin > * { min-width: 0; }
.pre-existing-contract-admin > .field { display: grid; grid-template-rows: 13px auto; gap: 4px; align-self: stretch; margin: 0; }
.pre-existing-contract-admin input,
.pre-existing-contract-admin select,
.pre-existing-contract-admin button,
.pre-existing-contract-admin textarea { box-sizing: border-box; width: 100%; min-width: 0; height: 35px; min-height: 35px; max-height: 35px; }
.pre-existing-contract-reason textarea { display: block; max-width: 100%; margin: 0; overflow-y: auto; resize: none; }
.pre-existing-contract-dialog .dialog-footer { position: sticky; bottom: 0; padding: 9px 14px; border-top: 1px solid var(--line); background: #fff; }
@media (max-width: 860px) {
  .pre-existing-contract-admin { grid-template-columns: 1fr 1fr; grid-template-areas: "kind number" "attachment attachment" "customer customer" "start duration" "billing renew" "reason reason"; }
  .pre-existing-contract-admin.is-subscription { grid-template-columns: 1fr 1fr; grid-template-areas: "kind number" "customer customer" "reason reason"; }
}
.contract-workspace .service-editor input[readonly],
.contract-workspace .service-editor select:disabled {
  border-color: #e2e5e9;
  background: #f5f6f7;
  color: #59626b;
  opacity: 1;
  cursor: default;
}
.contract-workspace .contract-operational-field input,
.contract-workspace #contract-billing-cycle {
  border-color: #9bb0ee;
  background: #fff;
  color: var(--ink);
}

.contract-workspace { grid-template-columns: minmax(205px, 24%) minmax(0, 1fr); gap: 8px; }
.contract-workspace .service-list-panel { padding: 6px; }
.contract-workspace .service-list-tools { margin-bottom: 5px; }
.contract-workspace .service-list-tools input { height: 31px; min-height: 31px; padding: 4px 8px; font-size: .69rem; }
.contract-workspace .service-editor { padding: 8px; }
.contract-workspace .service-editor-head { padding-bottom: 5px; }
.contract-workspace .service-editor-head h2 { font-size: .93rem; }
.contract-workspace .contract-data-grid { gap: 4px 5px; padding: 6px 0; }
.contract-workspace .service-editor input,
.contract-workspace .service-editor select { height: 30px; min-height: 30px; padding: 3px 7px; font-size: .72rem; }
.contract-workspace .service-editor .field > span { font-size: .58rem; }
.contract-workspace .contract-document-actions { gap: 5px; padding-top: 6px; }
.contract-workspace .contract-document-actions button { min-height: 30px; height: 30px; padding: 0 9px; font-size: .68rem; }
.contract-list-row { gap: 4px; padding: 7px 8px 6px 10px; border-color: transparent; }
.rental-list-card,
.contract-list-row.crm-informative-split-row { box-sizing: border-box; height: 75px; min-height: 75px; max-height: 75px; }
.contract-list-row.crm-informative-split-row { grid-template-rows: 18px 16px 22px; gap: 2px; padding: 7px 8px 6px 10px; }
.contract-list-row .crm-informative-identities .document-code-inline { height: 18px; min-height: 18px; padding: 2px 5px; font-size: .59rem; }
.contract-list-row.crm-informative-split-row > .crm-informative-title { line-height: 16px; }
.contract-list-row .crm-informative-footer { align-items: flex-end; }
.contract-list-row .contract-status,
.rental-list-footer .contract-status { box-sizing: border-box; height: 21px; min-height: 21px; padding: 2px 6px; font-size: .56rem; }
.contract-list-row-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.contract-list-row-head > span { display: inline-flex; align-items: center; gap: 3px; }
.contract-list-row-head strong { color: var(--blue-dark); font-size: .72rem; }
.contract-list-customer { color: #202826; font-size: .79rem !important; font-weight: 800; }
.contract-list-row.state-pending { background: #f0f1f2; border-color: #dfe2e4; }
.contract-list-row.state-active { background: #eaf7ef; border-color: #c7e7d4; }
.contract-list-row.state-expiring { background: #fff3c8; border-color: #ecd67e; }
.contract-list-row.state-expired { background: #f8dddd; border-color: #e8b5b5; }
.contract-list-row:hover,
.contract-list-row.active { box-shadow: inset 0 0 0 1px #6f88d8; }

.contract-condition-summary { display: grid; margin-top: 7px; border-top: 1px solid var(--line); }
.contract-summary-row { display: grid; grid-template-columns: minmax(190px, 31%) minmax(0, 1fr); gap: 12px; align-items: start; min-height: 29px; padding: 6px 3px; border-bottom: 1px solid #e6e3dc; }
.contract-summary-row > strong { color: #38413e; font-size: .67rem; line-height: 1.35; }
.contract-summary-row > span { color: #1f2724; font-size: .74rem; line-height: 1.4; }
.contract-rate-list { display: grid; gap: 2px; max-width: 360px; }
.contract-rate-list i { display: grid; grid-template-columns: minmax(100px, 1fr) auto; gap: 18px; align-items: baseline; min-height: 20px; font-style: normal; }
.contract-rate-list b { font-size: .73rem; font-weight: 650; }
.contract-rate-list em { color: #1e513b; font-size: .73rem; font-style: normal; font-weight: 800; text-align: right; white-space: nowrap; }
.contract-summary-empty { color: var(--muted) !important; font-style: italic; }
.contract-operational-fields { display: grid; grid-template-columns: minmax(180px, 1fr) 115px 160px; gap: 7px; align-items: end; margin-top: 8px; padding: 7px 8px; border: 1px solid #b9c7ef; border-radius: 9px; background: #f5f7ff; }
.contract-operational-fields > div { display: grid; gap: 1px; align-self: center; }
.contract-operational-fields > div strong { font-size: .7rem; }
.contract-operational-fields > div span { color: var(--muted); font-size: .62rem; }

.contract-operational-summary { display: grid; }
.contract-operational-row { display: grid; grid-template-columns: minmax(190px, 31%) minmax(0, 1fr) 27px; gap: 12px; align-items: start; min-height: 29px; padding: 6px 3px; border-bottom: 1px solid #e6e3dc; }
.contract-operational-row > strong { color: #38413e; font-size: .67rem; }
.contract-operational-row > span { color: #1f2724; font-size: .74rem; line-height: 1.4; }
.contract-operational-editor { min-width: 0; }
.contract-operational-editor[hidden] { display: none; }
.contract-operational-editor input,
.contract-operational-editor select { width: min(220px, 100%); border: 1px solid #aebce8 !important; border-radius: 8px !important; background: #fbfcff !important; box-shadow: 0 0 0 2px rgba(70, 98, 205, .06); }
.contract-edit-button { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #5870bc; font-size: 1rem; line-height: 1; cursor: pointer; }
.contract-edit-button:hover,
.contract-operational-row.is-editing .contract-edit-button { border-color: #b9c7ef; background: #eef2ff; color: #2948aa; }

@media (max-width: 820px) {
  .contract-summary-row { grid-template-columns: 1fr; gap: 2px; }
  .contract-operational-fields { grid-template-columns: 1fr 100px minmax(135px, 1fr); }
  .contract-operational-row { grid-template-columns: minmax(130px, 40%) minmax(0, 1fr) 27px; gap: 7px; }
}

.contract-plan-add { display: grid; grid-template-columns: minmax(165px, 1fr) minmax(115px, .5fr) 54px auto 48px 82px 116px auto; gap: 5px; align-items: center; }
.contract-plan-add > span { font-size: .72rem; color: var(--muted); text-align: center; }
.contract-plan-row { display: grid; grid-template-columns: minmax(150px, 1fr) auto auto; gap: 8px; align-items: center; width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcff; color: var(--ink); text-align: left; }
.contract-plan-row span,
.contract-plan-row small { color: var(--muted); font-size: .69rem; }

.maintenance-quotes { padding: 10px; }
.maintenance-quote-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.maintenance-quote-head > div { display: grid; gap: 2px; }
.maintenance-quote-head span { color: var(--muted); font-size: .76rem; }
.maintenance-quote-head .maintenance-quote-head-actions { display: flex; align-items: end; gap: 8px; }
.maintenance-quote-head .crm-status-filter { display: grid; }
.maintenance-quote-head .crm-status-filter > span { font-size: 10px; }
.maintenance-quote-link { display: grid; gap: 7px; padding: 8px 0; }
.maintenance-contract-grid { display: grid; grid-template-columns: minmax(220px, 1.4fr) 105px 145px 115px 84px 76px 130px 92px 92px 138px 126px minmax(104px, .65fr); gap: 6px; align-items: end; }
.maintenance-special-annexes-section { grid-column: 1 / -1; }
.maintenance-special-annexes-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.maintenance-special-annexes-head span { display:grid; gap:1px; }
.maintenance-special-annexes-head small { color:var(--muted); font-size:11px; }
.maintenance-special-annex-form { display:grid; grid-template-columns:minmax(150px,1.2fr) 105px 78px 118px minmax(170px,1.25fr) minmax(190px,1.45fr) minmax(155px,1fr) auto; gap:6px; align-items:end; }
.maintenance-special-annex-form .field { margin:0; min-width:0; }
.maintenance-special-annex-form input,.maintenance-special-annex-form button { height:35px; min-height:35px; }
.maintenance-special-annex-form input[type="file"] { padding:6px; font-size:11px; }
.maintenance-special-annex-list { display:grid; gap:4px; margin-top:7px; }
.maintenance-special-annex-row { display:grid; grid-template-columns:minmax(150px,1.2fr) 95px 72px 95px minmax(180px,1.4fr) auto auto; gap:7px; align-items:center; min-height:35px; padding:5px 7px; border:1px solid #c9d7eb; border-radius:8px; background:#f5f9ff; font-size:11px; }
.maintenance-special-annex-row strong,.maintenance-special-annex-row span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media(max-width:1250px) { .maintenance-special-annex-form { grid-template-columns:repeat(4,minmax(120px,1fr)); } .maintenance-special-annex-row { grid-template-columns:minmax(150px,1fr) 90px 70px 95px auto auto; } .maintenance-special-annex-row .maintenance-annex-row-scope { display:none; } }
.maintenance-contract-grid > * { min-width: 0; }
.maintenance-place { min-width: 104px; }
.maintenance-choice-button { min-height: 35px; height: 35px; padding: 0 9px; border: 1px solid #d5d9e3; border-radius: 9px; background: #fff; color: var(--ink-soft); font-size: .7rem; font-weight: 780; }
.maintenance-choice-button.selected { border-color: #6f8be7; background: #e8eeff; color: #294bb7; box-shadow: inset 0 0 0 1px rgba(53, 88, 212, .12); }
.maintenance-extra-terms { border: 1px solid #dfe4f0; border-radius: 10px; background: #fbfcff; }
.maintenance-extra-terms > summary { min-height: 31px; padding: 7px 9px; cursor: pointer; color: var(--blue-dark); font-size: .73rem; font-weight: 790; }
.maintenance-extra-terms[open] > summary { border-bottom: 1px solid #e4e8f2; }
.maintenance-extra-grid { display: grid; grid-template-columns: 125px 82px 86px 82px 82px 88px 88px; gap: 6px; align-items: end; padding: 7px 8px 4px; }
.maintenance-rate-levels { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 8px 8px; }
.maintenance-rate-row { display: grid; grid-template-columns: 16px minmax(82px, 1fr) 68px 24px; align-items: center; gap: 4px; min-height: 31px; padding: 3px 5px 3px 7px; border: 1px solid #dce2ee; border-radius: 8px; background: #fff; }
.maintenance-rate-row.selected { border-color: #91a8ee; background: #f3f6ff; }
.maintenance-rate-row > input[type="checkbox"] { width: 14px; height: 14px; margin: 0; }
.maintenance-rate-row > span { overflow: hidden; max-width: 130px; color: var(--ink); font-size: .68rem; font-weight: 730; text-overflow: ellipsis; white-space: nowrap; }
.maintenance-quote-dialog .maintenance-rate-row > span { max-width: none; }
.maintenance-rate-row input { min-height: 25px !important; height: 25px !important; padding: 2px 5px !important; text-align: right; }
.maintenance-rate-row input[data-maintenance-rate-value] {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  outline: 0;
}
.maintenance-rate-row input[data-maintenance-rate-value]:focus {
  border-color: var(--blue);
  box-shadow: none;
}
.maintenance-rate-row small { color: var(--muted); font-size: .64rem; }
.maintenance-notes textarea { min-height: 35px; height: 35px; max-height: 35px; resize: none; }
.maintenance-quote-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.maintenance-quote-actions > span { color: var(--muted); font-size: .68rem; }
.maintenance-quote-list { display: grid; gap: 5px; border-top: 1px solid var(--line); padding-top: 8px; }
.maintenance-quote-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 8px; border: 1px solid #dce2f3; border-radius: 9px; }
.maintenance-quote-row-actions { display: flex; align-items: center; gap: 5px; }
.maintenance-quote-row > span:not(.service-type-badge) { display: grid; min-width: 0; }
.maintenance-quote-row strong,
.maintenance-quote-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.maintenance-quote-dialog {
  width: min(1120px, calc(100vw - 18px));
  max-width: 1120px;
  height: fit-content;
  min-height: 0;
  max-height: calc(100dvh - 18px);
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.maintenance-quote-editor {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  background: #fbfaf7;
}

.maintenance-quote-dialog-head { flex: 0 0 auto; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.maintenance-quote-dialog-head h2 { margin: 1px 0 2px; font-size: 1.18rem; }
.maintenance-quote-dialog-head p:last-child { margin: 0; color: var(--muted); font-size: .74rem; }
.maintenance-context-section,
.maintenance-editor-grid,
.maintenance-editor-details { margin-inline: 14px; }
.maintenance-context-section { flex: 0 0 auto; margin-top: 10px; }
.maintenance-editor-grid { display: grid; grid-template-columns: minmax(190px, 1.15fr) minmax(160px, .85fr) minmax(150px, .75fr) minmax(240px, 1.25fr); gap: 7px; padding: 7px 0; overflow: visible; }
.maintenance-editor-section { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 7px; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.maintenance-rates-section,
.maintenance-cost-section { grid-column: 1 / -1; }
.maintenance-section-number { display: grid; place-items: center; align-self: start; width: 22px; height: 22px; border-radius: 7px; background: #e9eeff; color: #3558c8; font-size: .68rem; font-weight: 850; }
.maintenance-section-content { display: grid; gap: 5px; min-width: 0; }
.maintenance-section-content > strong,
.maintenance-section-content > .field-label { color: var(--ink); font-family: var(--ui-field-font); font-size: .72rem; font-weight: 820; }
.maintenance-section-content > small,
.maintenance-quote-actions > span { color: var(--muted); font-family: var(--ui-field-font); font-size: .66rem; }
.maintenance-inline-control-section > .maintenance-section-content {
  grid-template-rows: 15px 35px;
  align-content: start;
  row-gap: 5px;
}
.maintenance-inline-control-section > .maintenance-section-content > strong,
.maintenance-inline-control-section > .maintenance-section-content > .field-label {
  height: 15px;
  margin: 0;
  line-height: 15px;
}
.maintenance-inline-control-section > .maintenance-section-content > select,
.maintenance-inline-control-section .maintenance-duration-row {
  align-self: start;
  height: 35px;
  margin: 0;
}
.maintenance-context-grid { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(180px, .8fr) minmax(260px, 1.45fr); gap: 6px; align-items: end; }
.maintenance-duration-row { display: grid; grid-template-columns: 105px minmax(150px, 1fr); align-items: stretch; gap: 6px; }
.maintenance-duration-row > select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  font-family: var(--ui-field-font);
  font-size: 13px;
}
.maintenance-duration-row > select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 88, 212, 0.1);
}
.maintenance-duration-row > .maintenance-choice-button { align-self: stretch; }
.maintenance-cost-grid { display: grid; grid-template-columns: 235px minmax(175px, 1fr) 76px 140px 145px 80px; gap: 6px; align-items: end; }
.maintenance-quote-cost-grid {
  grid-template-columns:
    minmax(280px, 2fr)
    minmax(88px, .45fr)
    minmax(145px, .8fr)
    minmax(155px, .85fr)
    minmax(94px, .45fr);
}
.maintenance-payment-grid {
  --prisma-grid-gap: 6px;
  grid-template-columns: minmax(148px, auto) minmax(145px, 1fr) minmax(120px, .8fr);
}
.maintenance-payment-grid .maintenance-choice-button { white-space: nowrap; }
.maintenance-editor-section input,
.maintenance-editor-section select,
.maintenance-editor-details input { min-height: 35px; height: 35px; padding: 5px 8px; }
.maintenance-editor-details { display: grid; grid-template-columns: 145px 145px 150px minmax(260px, 1fr); gap: 6px; align-items: end; flex: 0 0 auto; padding: 7px 0 9px; border-top: 1px solid var(--line); }
.maintenance-editor-details textarea { min-height: 35px; height: 35px; max-height: 35px; padding: 5px 8px; resize: none; }
.maintenance-title-field input[readonly] { color: var(--ink-soft); background: #f4f2ec; cursor: default; }
.maintenance-context-grid select:disabled { color: var(--ink-soft); background: #f4f2ec; opacity: 1; cursor: default; }
.maintenance-money-input { min-width: 0; height: 35px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.maintenance-money-input input { min-width: 0; height: 33px !important; min-height: 33px !important; padding-right: 4px !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; text-align: right; }
.maintenance-money-input b { padding: 0 8px 0 4px; color: var(--ink-soft); font-size: .68rem; white-space: nowrap; }
.maintenance-economic-output output { display: flex; align-items: center; justify-content: flex-end; min-height: 35px; padding: 5px 8px; border: 1px solid #d7dfd8; border-radius: 9px; background: #edf7f0; color: #217046; font-size: .72rem; font-weight: 820; white-space: nowrap; }
.quote-signed-slot { display: grid; grid-template-columns: minmax(190px, 1fr) auto minmax(320px, auto); gap: 7px; align-items: center; min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.quote-signed-slot { grid-column: 1 / -1; }
.quote-signed-slot.complete { border-color: #b8d9c5; background: #f1f8f3; }
.quote-signed-slot.warning { border-color: #e4bd75; background: #fff9ed; }
.quote-signed-slot > span { display: grid; min-width: 0; }
.quote-signed-slot small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.quote-signed-slot-actions { display: flex !important; align-items: center; justify-content: flex-end; gap: 5px; }
.quote-signed-reload-input { width: 188px; min-width: 0; font-size: 11px; }
.quote-document-check { display: inline-flex !important; grid-auto-flow: column; align-items: center; min-height: 28px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.quote-document-check.success { color: #17643a; border-color: #9fcfb2; background: #e8f6ed; }
.quote-document-check.warning { color: #8a5400; border-color: #e4bd75; background: #fff2d5; }
.quote-document-check.neutral { color: var(--muted); background: #f4f5f7; }
@media (max-width: 980px) {
  .quote-signed-slot { grid-template-columns: minmax(180px, 1fr) auto; }
  .quote-signed-slot-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
}
.maintenance-quote-actions { flex: 0 0 auto; margin-top: auto; padding: 9px 14px; border-top: 1px solid var(--line); background: #fff; }
.maintenance-quote-actions > span { margin-right: auto; }

.maintenance-quote-inline-panel {
  display: grid;
  gap: 7px;
  margin: 1px 0 4px;
  padding: 8px;
  border: 1px solid #dce2f3;
  border-radius: 12px;
  background: #f8f9fd;
}

.maintenance-quote-inline-panel[hidden] { display: none !important; }
.maintenance-quote-inline-panel .maintenance-editor-grid,
.maintenance-quote-inline-panel .maintenance-editor-details { margin-inline: 0; }
.maintenance-quote-inline-panel .maintenance-editor-grid {
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
}
.maintenance-quote-inline-panel .maintenance-editor-section {
  grid-template-columns: minmax(0, 1fr);
}
.maintenance-policy-banner {
  margin: 0;
  padding: 6px 9px;
  border: 1px solid #d8e1fb;
  border-radius: 9px;
  background: #eef3ff;
  color: #3558c8;
  font-family: var(--ui-field-font);
  font-size: .68rem;
  font-weight: 760;
}
.maintenance-custom-contract-notice,
.maintenance-project-banner {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 35px;
  padding: 5px 9px;
  border: 1px solid #e5b86c;
  border-radius: 10px;
  background: #fff7e8;
  color: #77501a;
  font-size: .7rem;
}
.maintenance-custom-contract-notice[hidden],
.maintenance-project-banner[hidden] { display: none !important; }
.maintenance-custom-contract-notice strong,
.maintenance-project-banner strong { white-space: nowrap; }
.maintenance-custom-contract-notice span,
.maintenance-project-banner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-kind-badge { display: inline-flex; margin-left: 5px; padding: 2px 6px; font-size: .58rem; vertical-align: middle; }

.workflow-recurrence-strip {
  display: grid;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: end;
  gap: 7px;
  min-width: 0;
  padding: 6px;
  border: 1px solid #dce2f3;
  border-radius: 10px;
  background: #f8f9fd;
}
.workflow-recurrence-strip[hidden] { display: none !important; }
.workflow-recurrence-toggle { display: block; position: relative; margin: 0; align-self: end; line-height: 0; }
.workflow-recurrence-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.workflow-recurrence-toggle span {
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  height: 35px;
  padding: 0 11px;
  border: 1px solid #d9d4ca;
  border-radius: 9px;
  background: #fffdfa;
  color: var(--ink);
  font: 750 .73rem var(--ui-field-font);
  cursor: pointer;
  white-space: nowrap;
}
.workflow-recurrence-toggle input:checked + span {
  border-color: #385ddb;
  background: #edf2ff;
  color: #294fc8;
}
.workflow-recurrence-fields {
  display: grid;
  grid-template-columns: minmax(0, .8fr) 70px minmax(0, .9fr) minmax(0, 1fr);
  gap: 6px;
  align-items: end;
  min-width: 0;
}
.workflow-recurrence-fields[hidden] { display: none !important; }
.workflow-recurrence-fields .field { min-width: 0; margin: 0; }
.workflow-recurrence-fields input,
.workflow-recurrence-fields select { box-sizing: border-box; min-width: 0; max-width: 100%; width: 100%; height: 35px; min-height: 35px; margin: 0; }
.workflow-recurrence-toggle input:focus-visible + span { outline: 2px solid #385ddb; outline-offset: 2px; }
@media (max-width: 680px) {
  .workflow-recurrence-strip { grid-template-columns: minmax(0, 1fr); }
  .workflow-recurrence-toggle { justify-self: start; }
}
.quote-workflow-builder.is-programmed-maintenance-plan .quote-workflow-activity-editors,
.quote-workflow-builder.is-programmed-maintenance-plan .workflow-unit-activity-actions { display: none; }
.quote-workflow-builder.is-programmed-maintenance-plan .workflow-unit-activity {
  grid-template-columns: auto minmax(0, 1fr);
}
.maintenance-contract-basics-section { grid-column: 1 / -1; }
.maintenance-contract-basics-grid {
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) minmax(165px, .9fr) minmax(155px, .85fr) minmax(100px, .55fr) minmax(145px, .8fr);
  gap: 6px;
  align-items: end;
  min-width: 0;
}
.maintenance-contract-basics-grid > * { min-width: 0; }
.maintenance-contract-basics-grid input,
.maintenance-contract-basics-grid select,
.maintenance-contract-basics-grid button {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
.maintenance-renew-field .maintenance-choice-button {
  min-width: 0;
  min-height: 35px;
  height: 35px;
  padding-inline: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-product-preparation { display: contents; }
.quote-product-preparation.is-subscription {
  display: grid;
  gap: 0;
  margin-bottom: 14px;
  border: 1px solid #cadcf0;
  border-radius: 11px;
  background: #edf6ff;
}
.quote-subscription-panel {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d9e0f2;
  border-radius: 11px;
  background: #f8f9fd;
}
.quote-subscription-panel[hidden] { display: none !important; }
.quote-product-preparation.is-subscription .quote-subscription-panel { border: 0; border-radius: 0; background: transparent; }
.quote-product-preparation.is-subscription .quote-builder { margin: 0; padding: 8px; border: 0; border-top: 1px solid #d3e1ef; border-radius: 0 0 10px 10px; background: #f8fbfe; }
.quote-subscription-products-heading { display: none; }
.quote-product-preparation.is-subscription .quote-subscription-products-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.quote-subscription-products-heading strong { font-size: .78rem; }
.quote-subscription-products-heading small { color: var(--muted); font-size: .62rem; }
.quote-product-preparation:not(.is-subscription) .quote-subscription-totals { display: none; }
.quote-subscription-grid,
.pre-existing-billing-grid {
  display: grid;
  grid-template-columns: 120px minmax(145px, .8fr) 145px 115px 80px minmax(145px, .85fr);
  gap: 6px;
  align-items: end;
}
.quote-subscription-grid { grid-template-columns: repeat(4, minmax(145px, 1fr)); }
.quote-subscription-variation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 6px;
  align-items: end;
}
.quote-subscription-grid > *, .quote-subscription-variation-grid > *, .pre-existing-billing-grid > * { min-width: 0; }
.quote-subscription-target { display: grid; gap: 3px; max-width: 430px; }
#crm-quote-subscription-variation { gap: 6px 8px; align-items: start; }
#crm-quote-subscription-variation > .field { margin: 0; gap: 3px; }
#crm-quote-subscription-variation > .field > input, #crm-quote-subscription-variation > .field > select { height: 35px; min-height: 35px; margin: 0; }
#crm-quote-subscription-replaced-field { grid-column: 1 / -1; order: -1; }
#crm-quote-subscription-replaced-item[hidden] { display: none !important; }
#crm-quote-subscription-replacement-rows { display: grid; gap: 3px; overflow-x: auto; }
.quote-subscription-replacement-row, .quote-subscription-replacement-columns { display: grid; grid-template-columns: minmax(230px, 1fr) 38px 95px 95px 95px 68px 35px 78px 110px 95px; gap: 6px; align-items: center; min-width: 1100px; width: 100%; padding: 0 8px; text-align: left; box-sizing: border-box; }
.quote-subscription-replacement-columns { font-size: .61rem; color: #596579; text-transform: uppercase; min-height: 20px; }
.quote-subscription-replacement-row { height: 35px; min-height: 35px; font-size: .72rem; background: #fff; color: #233344; border: 1px solid #d7dfee; border-radius: 7px; cursor: pointer; }
.quote-subscription-replacement-row > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-subscription-replacement-row.selected { background: #edf2ff; border-color: #4055d8; box-shadow: inset 3px 0 #4055d8; }
.quote-subscription-target select { height: 35px; min-height: 35px; }
.quote-subscription-target small { color: var(--muted); font-size: .67rem; line-height: 1.2; }
.quote-subscription-grid input, .quote-subscription-grid select, .quote-subscription-grid button,
.quote-subscription-variation-grid input, .quote-subscription-variation-grid select,
.pre-existing-billing-grid input, .pre-existing-billing-grid select { box-sizing: border-box; width: 100%; height: 35px; min-height: 35px; }
.quote-subscription-note { margin: 0; color: var(--muted); font-size: .67rem; }
.quote-subscription-grid .maintenance-choice-button { width: 100%; }
.subscriptions-workspace { display: grid; gap: 10px; }
.compact-module-heading { margin: 0; }
.compact-module-heading h2 { margin: 0; font-size: 20px; }
.compact-module-heading p:last-child { margin: 4px 0 0; color: var(--ink-soft); font-size: .82rem; }
.subscriptions-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.subscription-card { display: grid; gap: 5px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.subscription-card-head, .subscription-card-data { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.subscription-card h3, .subscription-card p { margin: 0; }
.subscription-card h3 { font-size: .9rem; }
.subscription-card p, .subscription-card small { color: var(--ink-soft); font-size: .72rem; }
.subscription-card-data strong { color: var(--primary); font-size: .92rem; }
.subscription-card .subscription-pending { color: #aa6900; }
.subscription-management-workspace .rental-master-panel { background: #f3f7fb; }
.subscription-management-workspace .rental-list-card.active { background: #f2f7ff; }
.subscription-master-actions { display: flex !important; grid-auto-flow: column; gap: 4px !important; }
.subscription-master-actions .rental-closed-toggle:first-child { color: var(--blue-dark); border-color: #a8b8e8; background: #f1f5ff; }
.subscription-list-fee { min-width: 0; display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; }
.subscription-list-fee > strong { overflow: hidden; color: var(--primary); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.subscription-list-fee > b { display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 3px; color: #8b5b00; background: #fff0c7; border-radius: 999px; font-size: .55rem; }

.rental-management-workspace {
  display: grid;
  grid-template-columns: minmax(260px, .32fr) minmax(0, 1fr);
  min-height: min(720px, calc(100dvh - 245px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffdf9;
  box-shadow: 0 12px 30px rgba(36, 41, 39, .07);
}
.rental-master-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 9px 7px;
  border-right: 1px solid var(--line);
  background: #f5f4ee;
}
.rental-master-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 1px 2px 8px; border-bottom: 1px solid var(--line); }
.rental-master-head > span { min-width: 0; display: grid; gap: 1px; }
.rental-master-head strong { font-size: .8rem; }
.rental-master-head small { overflow: hidden; color: var(--muted); font-size: .6rem; text-overflow: ellipsis; white-space: nowrap; }
.rental-closed-toggle { display: inline-flex; align-items: center; gap: 4px; min-height: 27px; padding: 0 7px; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 7px; font-size: .59rem; font-weight: 790; white-space: nowrap; }
.rental-closed-toggle:hover, .rental-closed-toggle[aria-pressed="true"] { color: var(--blue-dark); border-color: #8fa3df; background: #f2f5ff; }
.rental-closed-toggle:disabled { opacity: .48; cursor: default; }
.rental-closed-toggle b { display: grid; place-items: center; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 999px; background: #e8edfb; font-size: .56rem; }
.rental-master-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 7px 2px 2px 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.rental-list-card {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 7px 8px 6px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9d7d0;
  border-radius: 10px;
  text-align: left;
  box-shadow: 0 1px 2px rgba(36, 41, 39, .04);
}
.rental-list-card::before {
  content: '';
  position: absolute;
  inset: 7px auto 7px 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: transparent;
}
.rental-list-card:hover { border-color: #aebce7; background: #fbfcff; }
.rental-list-card.active { border-color: #6f8be7; background: #f4f7ff; box-shadow: 0 4px 12px rgba(53, 88, 212, .10); }
.rental-list-card.active::before { background: var(--blue); }
.rental-list-identity, .rental-list-footer { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.rental-list-identity .document-code-inline { box-sizing: border-box; flex: 0 0 auto; height: 18px; margin: 0; padding: 2px 5px; font-size: .59rem; }
.rental-list-identity .client-name-highlight.compact { box-sizing: border-box; flex: 1 1 auto; height: 18px; margin: 0; padding: 2px 5px; overflow: hidden; }
.rental-list-identity .client-name-highlight.compact > strong { overflow: hidden; font-size: .59rem; text-overflow: ellipsis; white-space: nowrap; }
.rental-list-progress { display: grid; grid-template-columns: .8fr .8fr 1fr; gap: 5px; }
.rental-list-progress small {
  min-width: 0;
  overflow: hidden;
  padding-right: 5px;
  color: var(--muted);
  border-right: 1px solid #e2e4e9;
  font-size: .59rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rental-list-progress small:last-child { padding-right: 0; border-right: 0; text-align: right; }
.rental-list-progress b { color: var(--ink); }
.rental-list-footer .contract-status { padding: 2px 6px; font-size: .56rem; }
.rental-list-footer > strong { color: var(--primary); font-size: .68rem; }

.rental-detail-panel { min-width: 0; padding: 17px; overflow: auto; }
.rental-detail-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding: 2px 2px 13px; border-bottom: 1px solid var(--line); }
.rental-detail-head > div { min-width: 0; display: grid; gap: 2px; }
.rental-detail-head span { color: var(--blue-dark); font-size: .72rem; font-weight: 850; letter-spacing: .025em; }
.rental-detail-head h3, .rental-detail-head p { margin: 0; }
.rental-detail-head h3 { font-size: 1.08rem; }
.rental-detail-head p { overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.rental-detail-summary { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 6px; padding: 11px 0; }
.rental-detail-summary > span { min-width: 0; display: grid; gap: 2px; padding: 7px 8px; border: 1px solid #dae4f2; border-radius: 8px; background: #f6faff; }
.rental-detail-summary small { color: var(--muted); font-size: .6rem; font-weight: 760; text-transform: uppercase; }
.rental-detail-summary strong { overflow: hidden; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.rental-detail-section { margin-top: 8px; overflow: hidden; border: 1px solid #d9e1ed; border-radius: 10px; background: #fff; }
.rental-detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: #f0f5fb; border-bottom: 1px solid #d9e1ed; }
.rental-detail-section-head > div { display: grid; gap: 1px; }
.rental-detail-section-head strong { font-size: .78rem; }
.rental-detail-section-head small { color: var(--muted); font-size: .64rem; }
.rental-detail-section-head > b { min-width: 25px; padding: 3px 6px; color: var(--blue-dark); background: #fff; border: 1px solid #ced9eb; border-radius: 999px; font-size: .64rem; text-align: center; }
.rental-item-table, .rental-installment-table { min-width: 0; overflow-x: auto; }
.rental-item-columns, .rental-item-row { min-width: 760px; display: grid; grid-template-columns: 90px 105px 105px 105px minmax(170px, 1fr) 48px 112px; gap: 7px; align-items: center; }
.rental-item-columns, .rental-installment-columns { padding: 6px 9px; color: var(--ink-soft); background: #fafbfd; font-size: .59rem; font-weight: 820; text-transform: uppercase; }
.rental-item-row { padding: 7px 9px; border-top: 1px solid #edf0f4; font-size: .69rem; }
.rental-item-row:first-of-type { border-top: 0; }
.rental-item-row > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rental-item-row > *:last-child { color: var(--primary); text-align: right; }
.subscription-item-columns, .subscription-item-row,
.subscription-variation-columns, .subscription-variation-row,
.subscription-adjustment-columns, .subscription-adjustment-row {
  min-width: 820px;
  display: grid;
  gap: 7px;
  align-items: center;
}
.subscription-item-columns, .subscription-item-row { min-width: 1080px; grid-template-columns: 110px minmax(150px, 1fr) 82px 82px 65px 68px 95px 35px 130px 66px; }
.subscription-item-columns > span:nth-child(8), .subscription-item-columns > span:nth-child(9) { text-align: right; }
.subscription-item-row > strong:nth-child(9) small { margin-left: 2px; font-size: .6rem; font-weight: 500; color: var(--ink-soft); }
.subscription-variation-columns, .subscription-variation-row,
.subscription-adjustment-columns, .subscription-adjustment-row { grid-template-columns: 92px 105px minmax(145px, 1fr) 105px 95px 86px; }
.subscription-item-columns, .subscription-variation-columns, .subscription-adjustment-columns {
  padding: 6px 9px;
  color: var(--ink-soft);
  background: #fafbfd;
  font-size: .59rem;
  font-weight: 820;
  text-transform: uppercase;
}
.subscription-item-row, .subscription-variation-row, .subscription-adjustment-row {
  min-height: 34px;
  padding: 5px 9px;
  border-top: 1px solid #edf0f4;
  font-size: .67rem;
}
.subscription-item-row > *, .subscription-variation-row > *, .subscription-adjustment-row > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subscription-item-row > span:nth-child(8), .subscription-item-row > strong:nth-child(9), .subscription-variation-row > strong:nth-child(4),
.subscription-adjustment-row > span:nth-child(3), .subscription-adjustment-row > strong:nth-child(4) { text-align: right; }
.subscription-row-status { justify-self: start; padding: 3px 6px; border-radius: 999px; font-size: .57rem; font-style: normal; font-weight: 810; }
.subscription-row-status.is-active { color: #17683f; background: #d9f2e3; }
.subscription-row-status.is-pending { color: #8b5b00; background: #fff0c7; }
.subscription-row-status.is-inactive { color: #6a4b49; background: #f4e6e3; }
.subscription-billing-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 6px;
  padding: 0 0 3px;
}
.subscription-billing-summary > div { min-width: 0; display: grid; gap: 2px; padding: 8px 9px; border: 1px solid #cbdced; border-radius: 8px; background: #edf6fc; }
.subscription-billing-summary > div:nth-child(2) { background: #e4f1fa; }
.subscription-billing-summary small { color: var(--muted); font-size: .58rem; font-weight: 790; text-transform: uppercase; }
.subscription-billing-summary strong { color: var(--blue-dark); font-size: .8rem; }
.recurring-management-dialog { width: min(950px, 94vw); max-height: 90vh; overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #f8fbfe; color: var(--ink); }
.recurring-management-dialog::backdrop { background: rgba(20,30,45,.4); }
.recurring-management-form { display: grid; gap: 10px; }
.recurring-management-form header,.recurring-management-form footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recurring-management-form header h3 { margin: 0; }
.recurring-management-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 8px; }
.recurring-management-dialog [hidden] { display: none !important; }
.contracts-overview { display: grid; gap: 16px; }
.contracts-overview[hidden] { display: none; }
.contracts-overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.contracts-overview-heading h2 { margin: 0; }
.contracts-overview-heading select { min-width: 110px; }
.contracts-overview-tabs,.contracts-overview-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.contracts-overview-tabs button { display: grid; gap: 10px; padding: 16px; text-align: left; border: 1px solid #dce2ef; border-radius: 14px; background: #fffefa; color: var(--ink); }
.contracts-overview-tabs button[aria-pressed="true"] { border-color: #4059db; background: #eef2ff; box-shadow: inset 0 3px #4059db; }
.contracts-overview-tabs strong { font-size: 1rem; }
.contracts-overview-tabs span { display: grid; gap: 4px; font-size: .72rem; }
.contracts-overview-tabs b { font-size: 1.2rem; color: #243aa4; font-variant-numeric: tabular-nums; }
.contracts-overview-tabs small,.contracts-overview-kpis span { color: #667085; font-size: .7rem; }
.contracts-overview-kpis article { display: grid; gap: 8px; padding: 16px; background: #fff; border: 1px solid #e1e5ed; border-radius: 12px; }
.contracts-overview-kpis strong { font-size: 1.5rem; color: #152848; }
.contracts-overview-kpis small { color: #566477; }
.contracts-overview-card { padding: 20px; background: #fffefa; border: 1px solid #dde3ee; border-radius: 15px; min-width: 0; }
.contracts-overview-card h3 { margin: 0 0 12px; }
.contracts-overview-legend { display: flex; gap: 18px; font-size: .75rem; color: #4059db; }
.contracts-overview-legend span+span { color: #7b91c6; }
.contracts-overview-chart { display: grid; grid-template-columns: repeat(12,minmax(24px,1fr)); gap: 10px; height: 180px; padding: 10px 0 20px; }
.contracts-overview-month { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 0; }
.contracts-overview-bars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: 100%; height: 100%; border-bottom: 1px solid #cbd4e5; }
.contracts-overview-bars i { display: block; width: 28%; background: #4059db; border-radius: 4px 4px 0 0; }
.contracts-overview-bars i+i { background: #b9c9ed; }
.contracts-overview-table { overflow-x: auto; }
.contracts-overview-table table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.contracts-overview-table caption { text-align: left; color: #667085; font-size: .7rem; padding: 8px 0; }
.contracts-overview-table th,.contracts-overview-table td { padding: 9px 12px; border-bottom: 1px solid #e7eaf0; text-align: left; font-variant-numeric: tabular-nums; }
.contracts-overview-table th { background: #f2f5fa; color: #41516a; }
.contracts-overview-table .is-overdue { color: #a13a24; }
.contracts-overview-note { margin: 0; font-size: .75rem; line-height: 1.6; color: #667085; }
@media(max-width:1000px) { .contracts-overview-tabs,.contracts-overview-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { .contracts-overview-tabs,.contracts-overview-kpis { grid-template-columns: 1fr; } .contracts-overview-card { padding: 12px; } .contracts-overview-chart { gap: 3px; } }
.subscription-entry-editor.editing-existing > .subscription-entry-title,
.subscription-entry-editor.editing-existing > .subscription-preparation-terms,
.subscription-entry-editor.editing-existing > .subscription-product-picker { display: none; }
.subscription-product-editor-row.subscription-aged { background: #fff4df; border-color: #dba954; }
.subscription-product-editor-row.subscription-billed { background: #eef0f4; border-color: #b5bdca; }
.subscription-product-editor-row.subscription-billed :disabled { opacity: .75; }
.recurring-management-error { color: #a12626; }
.recurring-management-form footer[hidden] { display: none; }
.subscription-section-actions { display: inline-flex; align-items: center; gap: 6px; }
.subscription-section-actions > b { min-width: 25px; padding: 3px 6px; color: var(--blue-dark); background: #fff; border: 1px solid #ced9eb; border-radius: 999px; font-size: .64rem; text-align: center; }
.subscription-entry-list { display: grid; gap: 6px; padding: 7px; background: #f8fbfe; }
.subscription-entry-card { overflow: hidden; border: 1px solid #d7e3ef; border-radius: 8px; background: #fff; }
.subscription-entry-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border-bottom: 1px solid #e5edf5; }
.subscription-entry-card > header > div { min-width: 0; display: grid; gap: 1px; }
.subscription-entry-card > header strong { font-size: .72rem; }
.subscription-entry-card > header small { overflow: hidden; color: var(--muted); font-size: .6rem; text-overflow: ellipsis; white-space: nowrap; }
.subscription-entry-economics { display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)); }
.subscription-entry-economics > span { min-width: 0; display: grid; gap: 1px; padding: 6px 9px; border-right: 1px solid #e7edf4; }
.subscription-entry-economics > span:last-child { border-right: 0; }
.subscription-entry-economics small { color: var(--muted); font-size: .56rem; text-transform: uppercase; }
.subscription-entry-economics strong { overflow: hidden; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.subscription-editor { display: grid; gap: 9px; overflow: hidden; border: 1px solid #cddbea; border-radius: 10px; background: #f7fbfe; }
.subscription-container-grid, .subscription-entry-grid { display: grid; gap: 7px; padding: 2px 10px; }
.subscription-container-grid { grid-template-columns: minmax(220px, .75fr) minmax(280px, 1.25fr); }
.subscription-entry-title { margin: 0 10px; }
.subscription-preparation-terms { display: grid; gap: 5px; padding: 7px 0; border-block: 1px solid #dce8f3; background: #f0f7fc; }
.subscription-preparation-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 10px; }
.subscription-preparation-heading strong { font-size: .72rem; }
.subscription-preparation-heading small { color: var(--muted); font-size: .61rem; }
.subscription-entry-grid { grid-template-columns: repeat(4, minmax(145px, 1fr)); }
.subscription-entry-grid .field, .subscription-container-grid .field { gap: 2px; }
.subscription-entry-grid input, .subscription-entry-grid select, .subscription-container-grid input, .subscription-container-grid select { box-sizing: border-box; width: 100%; height: 35px; min-height: 35px; }
.subscription-entry-grid .maintenance-choice-button { box-sizing: border-box; width: 100%; }
.subscription-duration-control { display: grid; grid-template-columns: minmax(0, 1fr) minmax(82px, .72fr); gap: 4px; }
.subscription-duration-control > span { display: grid; grid-template-columns: minmax(0, 1fr) 27px; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.subscription-duration-control > span input { border: 0; border-radius: 0; }
.subscription-duration-control > span small { color: var(--muted); font-size: .58rem; }
.subscription-product-picker { position: relative; display: grid; gap: 4px; padding: 7px 10px; border-block: 1px solid #dce8f3; background: #eef6fc; }
.subscription-product-picker input { height: 35px; }
.subscription-product-picker-row { display: grid; grid-template-columns: minmax(260px, 1fr) 70px 86px 76px; align-items: end; gap: 7px; }
.subscription-product-picker-row > * { min-width: 0; }
.subscription-product-picker-row.pre-existing-catalog-picker-row { grid-template-columns: minmax(0, 1fr) 70px 86px; }
.subscription-selected-catalog-item .catalog-selection-empty { grid-column: 1 / -1; }
.subscription-selected-catalog-item[hidden], .subscription-catalog-results[hidden] { display: none !important; }
.subscription-product-picker-row .field { align-self: end; margin: 0; }
.subscription-product-picker-row input,
.subscription-product-picker-row > button { box-sizing: border-box; width: 100%; height: 35px; min-height: 35px; max-height: 35px; }
.quote-subscription-line-terms { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; align-items: end; margin: -2px 10px 7px 18px; padding: 6px 9px; border: 1px solid #d9e6f2; border-radius: 0 0 10px 10px; background: #f3f8fc; }
.quote-subscription-line-terms label { display: grid; gap: 2px; min-width: 0; }
.quote-subscription-line-terms > label { flex: 1 0 90px; }
.quote-subscription-line-terms > label[hidden] { display: none; }
.quote-subscription-line-terms .subscription-line-association { flex: 2 1 200px; min-width: 150px; }
.quote-subscription-line-terms .subscription-line-expiry { flex: 1.4 0 185px; }
.quote-subscription-line-terms > label:has([data-field="subscription_billing_mode"]) { flex-basis: 150px; }
.quote-subscription-line-terms > label:has([data-field="subscription_start_date"]) { flex: 0 0 125px; }
.quote-subscription-line-terms > label:has([data-field="subscription_duration_months"]) { flex: 0 0 48px; }
.quote-subscription-line-terms > label:has([data-field="subscription_renewal_type"]) { flex-basis: 130px; }
.quote-subscription-line-terms > label:has([data-field="subscription_manual_adjustment_amount"]) { flex: 0 0 100px; }
.quote-subscription-line-terms > label:has([data-field="subscription_duration_choice"]) { flex: 0 0 95px; }
.quote-subscription-line-terms label > span:first-child { white-space: nowrap; }
.quote-subscription-line-terms .subscription-line-money { height: 35px; box-sizing: border-box; gap: 3px; padding-right: 9px; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.quote-subscription-line-terms .subscription-line-money input { height: 33px; min-height: 33px; border: 0; background: transparent; box-shadow: none; text-align: right; }
.quote-subscription-line-terms .subscription-line-money small { flex: 0 0 auto; font-family: var(--ui-field-font); color: var(--ink); font-size: 12px; }
.quote-subscription-line-terms .subscription-line-money:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53,88,212,.09); }
#crm-quote-subscription-variation[hidden] { display: none !important; }
.quote-subscription-line-terms label > span { color: var(--ink-muted); font-size: 9px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.quote-subscription-line-terms input, .quote-subscription-line-terms select { box-sizing: border-box; width: 100%; min-width: 0; height: 35px; min-height: 35px; margin: 0; padding: 0 9px; font-size: 12px; }
.quote-subscription-totals { margin-top: 7px; }
.subscription-selected-catalog-item { box-sizing: border-box; min-height: 35px; display: grid; grid-template-columns: 125px minmax(180px, 1fr) 150px 90px; align-items: center; gap: 7px; padding: 5px 9px; border: 1px dashed #bdcde0; border-radius: 8px; color: var(--muted); background: #f8fbfe; font-size: .64rem; }
.subscription-selected-catalog-item.selected { border-style: solid; border-color: #7695dc; background: #edf3ff; color: var(--ink); }
.subscription-selected-catalog-item > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subscription-selected-catalog-item strong { color: var(--blue-dark); }
.subscription-selected-catalog-item b { text-align: right; }
.subscription-catalog-results { display: grid; max-height: 220px; overflow-y: auto; border: 1px solid #d2deeb; border-radius: 8px; background: #fff; }
.subscription-catalog-result { box-sizing: border-box; min-width: 0; min-height: 35px; display: grid; grid-template-columns: 125px minmax(180px, 1fr) 150px 90px; align-items: center; gap: 7px; padding: 5px 9px; color: var(--ink); background: #fff; border: 0; border-bottom: 1px solid #edf1f5; text-align: left; }
.subscription-catalog-result:last-child { border-bottom: 0; }
.subscription-catalog-result:hover, .subscription-catalog-result.selected { background: #e8f0ff; }
.subscription-catalog-result > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subscription-catalog-result strong { color: var(--blue-dark); font-size: .67rem; }
.subscription-catalog-result span, .subscription-catalog-result small { font-size: .65rem; }
.subscription-catalog-result small { color: var(--muted); }
.subscription-catalog-result b { font-size: .68rem; text-align: right; }
.subscription-products-editor { margin: 0 10px; overflow-x: auto; border: 1px solid #d6e3ef; border-radius: 9px; background: #fff; }
.subscription-product-editor-columns,
.subscription-product-editor-row { min-width: 1090px; display: grid; grid-template-columns: 36px minmax(190px, 1.5fr) 52px 88px 108px 92px 62px 108px 105px 125px 35px; align-items: center; gap: 5px; }
.subscription-product-editor-columns { padding: 6px 9px; color: var(--ink-soft); background: #fafbfd; font-size: .59rem; font-weight: 820; text-transform: uppercase; }
.subscription-product-editor-row { min-height: 42px; padding: 3px 9px; border-top: 1px solid #e5ebf2; background: #f8fbfe; }
.subscription-product-editor-row:nth-child(odd) { background: #f3f8fc; }
.subscription-product-editor-row > * { min-width: 0; }
.subscription-product-editor-number { color: var(--blue-dark); font-size: .66rem; font-weight: 850; text-align: center; }
.material-subscription-kind { display: grid; grid-template-columns: auto minmax(170px,.8fr) minmax(250px,1.4fr) auto; align-items: end; gap: 8px; margin-bottom: 8px; }
.material-subscription-kind > .field { min-width: 0; }
.quote-supply-mode-bar.material-subscription-mode-bar { padding: 0; border: 0; background: transparent; }
.quote-supply-mode-buttons.material-subscription-switch { grid-template-columns: repeat(2,minmax(90px,1fr)); }
.material-subscription-switch button:disabled { cursor: default; opacity: .65; }
.material-subscription-kind .material-subscription-add { height: 35px; min-height: 35px; white-space: nowrap; }
.material-subscription-catalog-note { grid-column: 3 / -1; color: var(--muted); font-size: .65rem; }
@media (max-width: 1000px) {
  .material-subscription-kind { grid-template-columns: auto minmax(180px,1fr); }
  .material-subscription-reference { grid-column: 1 / 2; }
  .material-subscription-catalog-note { grid-column: 1 / -1; }
}
.material-subscription-kind select, .material-subscription-association select, .material-subscription-association input { height: 35px; min-height: 35px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 4px 7px; font-size: .68rem; width: 100%; }
.material-subscription-workflow-panel { grid-column: 1 / -1; min-width: 0; padding: 8px; border: 1px solid #d6e3ef; border-radius: 9px; background: #f2f7fd; }
.material-subscription-products { min-width: 0; overflow-x: auto; border: 1px solid #d6e3ef; border-radius: 9px; background: #fff; }
.material-subscription-products .subscription-product-editor-row, .material-subscription-products .subscription-product-editor-columns { min-width: 1040px; grid-template-columns: 26px minmax(150px,1fr) 48px 88px 108px 80px 48px 108px 95px 112px 30px; }
.material-subscription-association { display: grid; grid-template-columns: minmax(300px,1fr) 110px 150px 95px 120px; gap: 6px; align-items: end; min-width: 1040px; padding: 4px 9px 7px; background: #f2f7fd; }
.material-subscription-association .field { margin: 0; gap: 3px; min-width: 0; }
.material-subscription-association .field > span:first-child { font-size: .59rem; }
.material-subscription-association .inline-unit { display: flex; align-items: center; background: white; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.material-subscription-association .inline-unit input { border: 0; min-width: 0; }
.material-subscription-association .inline-unit small { padding-right: 7px; }
.material-subscription-fee { font-size: .68rem; font-weight: 700; color: var(--blue-dark); padding-bottom: 10px; }
.material-subscription-note { display: block; padding: 6px 9px; color: var(--muted); font-size: .65rem; }
.subscription-editor-product > small { color: var(--muted); font-size: .55rem; }
.subscription-product-editor-row input, .subscription-product-editor-row select { box-sizing: border-box; min-width: 0; width: 100%; height: 35px; min-height: 35px; max-height: 35px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: .64rem; box-shadow: none; }
.subscription-product-editor-row input:disabled { border-color: #e1e5eb; background: #f0f2f5; color: #7b8491; opacity: 1; }
.subscription-product-editor-row .inline-unit { box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr) 19px; align-items: center; overflow: hidden; height: 35px; min-height: 35px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.subscription-product-editor-row .inline-unit input { height: 33px; min-height: 33px; max-height: 33px; border: 0; border-radius: 0; background: transparent; }
.subscription-product-editor-row .inline-unit small { color: var(--muted); font-size: .6rem; }
.subscription-product-editor-row .icon-button { width: 35px; min-width: 35px; height: 35px; min-height: 35px; }
.subscription-editor-product { min-width: 0; display: grid; gap: 2px; align-self: center; }
.subscription-editor-product strong, .subscription-editor-product small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subscription-editor-product strong { color: var(--blue-dark); font-size: .67rem; }
.subscription-preparation-totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; padding: 0 10px; }
.subscription-preparation-totals > div { min-width: 125px; display: grid; gap: 1px; padding: 6px 8px; border: 1px solid #cbdced; border-radius: 8px; background: #eaf4fb; }
.subscription-preparation-totals small { color: var(--muted); font-size: .55rem; font-weight: 780; text-transform: uppercase; }
.subscription-preparation-totals strong { color: var(--blue-dark); font-size: .72rem; }
.subscription-editor-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 0 10px 10px; }
.subscription-empty-state { box-sizing: border-box; min-height: 330px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 32px; text-align: center; }
.subscription-empty-state > span { display: grid; place-items: center; width: 54px; height: 54px; color: var(--blue-dark); background: #e8f1ff; border: 1px solid #c9d9f4; border-radius: 16px; font-size: .8rem; font-weight: 900; letter-spacing: .08em; }
.subscription-empty-state h3, .subscription-empty-state p { margin: 0; }
.subscription-empty-state h3 { font-size: 1rem; }
.subscription-empty-state p { max-width: 620px; color: var(--ink-soft); font-size: .73rem; line-height: 1.45; }
.subscription-empty-state .primary-button { margin-top: 6px; }
.rental-installments-section { margin-bottom: 8px; }
.rental-installment-columns, .rental-installment-row { min-width: 900px; display: grid; grid-template-columns: 42px minmax(145px, 1.25fr) 105px 90px 90px 90px 100px 82px; gap: 7px; align-items: center; }
.rental-installment-row { min-height: 34px; padding: 5px 9px; border-top: 1px solid #edf0f4; font-size: .67rem; }
.rental-installment-row > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rental-installment-row strong, .rental-installment-row:nth-child(n) > span:nth-child(6) { text-align: right; }
.rental-installment-row i { justify-self: start; padding: 3px 6px; border-radius: 999px; font-size: .59rem; font-style: normal; font-weight: 810; }
.rental-installment-row.is-settled { background: #f2fbf5; }
.rental-installment-row.is-settled i { color: #17683f; background: #d9f2e3; }
.rental-installment-row.is-outstanding { background: #fffbf1; }
.rental-installment-row.is-outstanding i { color: #8b5b00; background: #fff0c7; }
.rental-installment-row.is-planned i { color: #526173; background: #e9edf2; }
.rental-installment-row.is-advance { border-bottom: 1px solid #d9e1ed; }
.rental-installment-number { color: var(--blue-dark); font-weight: 850; text-align: center; }
.rental-detail-notes { display: grid; gap: 2px; padding: 7px 2px 0; }
.rental-detail-notes small { color: var(--muted); font-size: .6rem; font-weight: 800; text-transform: uppercase; }
.rental-detail-notes p { margin: 0; color: var(--ink-soft); font-size: .68rem; }

@media (max-width: 1050px) {
  .rental-management-workspace { grid-template-columns: 250px minmax(0, 1fr); }
  .rental-detail-summary { grid-template-columns: repeat(3, minmax(105px, 1fr)); }
}

@media (max-width: 760px) {
  .rental-management-workspace { grid-template-columns: minmax(0, 1fr); }
  .rental-master-panel { max-height: 330px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rental-detail-summary { grid-template-columns: repeat(2, minmax(105px, 1fr)); }
}
.pre-existing-billing-history {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d5e3f5;
  border-radius: 10px;
  background: #f4f9ff;
}
.pre-existing-subscription-builder {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid #cadcf0;
  border-radius: 10px;
  background: #edf6ff;
}
.pre-existing-subscription-builder[hidden] { display: none !important; }
.pre-existing-subscription-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pre-existing-subscription-heading > div { min-width: 0; display: grid; gap: 1px; }
.pre-existing-subscription-heading strong { font-size: .78rem; }
.pre-existing-subscription-heading small { color: var(--muted); font-size: .62rem; }
.pre-existing-subscription-heading output { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-height: 31px; color: var(--muted); font-size: .62rem; }
.pre-existing-subscription-heading output > span { box-sizing: border-box; display: grid; align-content: center; gap: 1px; min-width: 82px; height: 35px; min-height: 35px; max-height: 35px; padding: 2px 7px; border: 1px solid #d4e2f1; border-radius: 7px; background: #fff; }
.pre-existing-subscription-heading output small { white-space: nowrap; line-height: 1.1; font-size: .5rem; font-weight: 800; text-transform: uppercase; }
.pre-existing-subscription-heading output strong { color: var(--blue-dark); font-size: .66rem; }
.pre-existing-subscription-list { display: grid; gap: 4px; }
.pre-existing-subscription-card { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto 31px; align-items: center; gap: 7px; padding: 6px 7px 6px 9px; border: 1px solid #d2dfed; border-left: 3px solid transparent; border-radius: 8px; background: #f9fcff; cursor: pointer; }
.pre-existing-subscription-card:hover, .pre-existing-subscription-card.selected { border-color: #8ca6dd; border-left-color: var(--blue); background: #f3f7ff; }
.pre-existing-subscription-card > div, .pre-existing-subscription-card > span { min-width: 0; display: grid; gap: 1px; }
.pre-existing-subscription-card > div strong, .pre-existing-subscription-card > div small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre-existing-subscription-card > div strong { font-size: .69rem; }
.pre-existing-subscription-card > div small, .pre-existing-subscription-card > span small { color: var(--muted); font-size: .56rem; }
.pre-existing-subscription-card > span { min-width: 105px; text-align: right; }
.pre-existing-subscription-card > span strong { color: var(--blue-dark); font-size: .68rem; }
.pre-existing-subscription-entry-editor { display: grid; gap: 7px; overflow: hidden; border: 1px solid #d3e1ef; border-radius: 9px; background: #f8fbfe; }
.pre-existing-subscription-entry-grid { padding-top: 3px; }
.pre-existing-subscription-defaults { padding: 3px 7px; }
.pre-existing-subscription-defaults > small { color: var(--muted); font-size: .6rem; }
#pre-existing-subscription-builder { gap: 5px; padding: 6px; }
#pre-existing-subscription-builder .pre-existing-subscription-entry-editor { gap: 3px; }
#pre-existing-subscription-builder .field { margin-block: 0; gap: 3px; }
#pre-existing-subscription-builder .subscription-products-editor { margin-inline: 5px; }
#pre-existing-subscription-builder .subscription-product-editor-row { min-height: 39px; padding: 2px 5px; gap: 4px; }
#pre-existing-subscription-builder .subscription-product-editor-columns { padding: 3px 5px; gap: 4px; }
.pre-existing-subscription-code-group { overflow-x: auto; border: 1px solid #d6e3ef; border-radius: 8px; background: #fff; }
.subscription-saved-code-row { cursor: pointer; }
.subscription-saved-code-row.selected { box-shadow: inset 3px 0 0 var(--blue); }
.subscription-saved-code-row .subscription-editor-product { display: grid; gap: 1px; }
.subscription-saved-code-row .subscription-editor-product > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subscription-saved-value { box-sizing: border-box; display: flex; align-items: center; min-height: 35px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: .64rem; white-space: nowrap; }
.pre-existing-subscription-entry-grid .maintenance-choice-button { box-sizing: border-box; width: 100%; }
.pre-existing-subscription-product-picker { padding-block: 6px; }
.pre-existing-subscription-product-picker .subscription-catalog-results { max-height: 155px; }
.pre-existing-subscription-products-editor { margin-bottom: 0; }
.pre-existing-subscription-products-editor .subscription-product-editor-columns,
.pre-existing-subscription-products-editor .subscription-product-editor-row { min-width: 980px; }
.pre-existing-billing-history > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.pre-existing-billing-history small { color: var(--muted); }
.pre-existing-billing-grid { grid-template-columns: 105px 190px minmax(260px, 1fr) 135px; }
.pre-existing-advance-field button { box-sizing: border-box; width: 100%; height: 35px; min-height: 35px; padding-inline: 8px; }
.pre-existing-contract-dialog .inline-unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0; overflow: hidden; height: 35px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.pre-existing-contract-dialog .inline-unit input { box-sizing: border-box; width: 100%; min-width: 0; height: 33px; min-height: 33px; padding-right: 4px; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; text-align: right; }
.pre-existing-contract-dialog .inline-unit small { padding: 0 8px 0 3px; color: #667085; font-size: .62rem; font-weight: 750; white-space: nowrap; }
.pre-existing-contract-dialog .maintenance-rate-row { grid-template-columns: 16px minmax(82px, 1fr) 92px; }
.pre-existing-contract-dialog .pre-existing-rate-money { height: 27px; border-radius: 7px; }
.pre-existing-contract-dialog .pre-existing-rate-money input { height: 25px !important; min-height: 25px !important; }
.pre-existing-invoice-summary output { display: grid; grid-template-columns: minmax(58px, .55fr) minmax(52px, .5fr) minmax(63px, .55fr) minmax(135px, 1.5fr) minmax(115px, .9fr); align-items: center; gap: 7px; min-height: 35px; padding: 3px 8px; border: 1px solid #d9dfeb; border-radius: 8px; background: #fff; color: var(--ink-soft); }
.pre-existing-invoice-summary output > span { display: grid; gap: 1px; min-width: 0; }
.pre-existing-invoice-summary output small { overflow: hidden; color: #687286; font-size: .5rem; font-weight: 800; letter-spacing: .015em; line-height: 1; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.pre-existing-invoice-summary output strong { overflow: hidden; color: #273755; font-size: .65rem; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.pre-existing-invoice-summary .pre-existing-next-invoice strong { color: #3156a3; }
.pre-existing-invoice-summary .pre-existing-to-settle strong { color: #ad4c2c; }
.pre-existing-invoice-summary .pre-existing-residual strong { color: #9b6512; }
.pre-existing-invoice-list { display: grid; gap: 3px; min-width: 0; }
.pre-existing-invoice-columns,
.pre-existing-invoice-card { display: grid; grid-template-columns: minmax(142px, .9fr) minmax(135px, .75fr) minmax(120px, .65fr) minmax(125px, .65fr) minmax(130px, .7fr) minmax(135px, .75fr); gap: 4px; align-items: center; }
.pre-existing-invoice-columns { padding: 0 5px; color: #59647a; font-size: .57rem; font-weight: 850; letter-spacing: .035em; line-height: 1; text-transform: uppercase; }
.pre-existing-invoice-card { min-height: 34px; padding: 3px 4px; border: 1px solid #d7deef; border-radius: 7px; background: #fff; }
.pre-existing-invoice-card.pre-existing-invoice-placeholder { border-style: dashed; background: rgba(255, 255, 255, .58); box-shadow: none; }
.pre-existing-invoice-card.pre-existing-invoice-placeholder input:disabled { opacity: 1; color: #7c8799; -webkit-text-fill-color: #7c8799; }
.pre-existing-invoice-card.pre-existing-invoice-placeholder .pre-existing-invoice-money { background: rgba(255, 255, 255, .72); }
.pre-existing-invoice-card.is-settled { border-color: #82c39b; background: #edf8f1; box-shadow: inset 3px 0 0 #39a464; }
.pre-existing-invoice-card.is-settled input:not([readonly]) { border-color: #b9dcc5; background: #fbfffc; }
.pre-existing-invoice-card.is-settled input[readonly] { border-color: #c8e2d1; background: #e5f3ea; color: #286844; }
.pre-existing-invoice-card.is-outstanding:not(.is-advance) { border-color: #dec488; background: #fffaf0; box-shadow: inset 3px 0 0 #d6a444; }
.pre-existing-invoice-card.is-outstanding .pre-existing-invoice-competence::after { content: "Da saldare"; margin-left: auto; padding: 2px 5px; border-radius: 999px; background: #fff0cd; color: #9a6015; font-size: .49rem; font-weight: 850; letter-spacing: .025em; text-transform: uppercase; }
.pre-existing-invoice-card.is-advance { border-color: #d8b56d; background: #fff9ec; box-shadow: inset 3px 0 0 #d39a32; }
.pre-existing-invoice-card.is-advance.is-settled { border-color: #82c39b; background: #edf8f1; box-shadow: inset 3px 0 0 #39a464; }
.pre-existing-invoice-card > * { min-width: 0; }
.pre-existing-invoice-competence { display: flex; align-items: center; min-height: 28px; padding-inline: 3px; color: #2e467f; font-size: .64rem; font-weight: 750; white-space: nowrap; }
.pre-existing-invoice-card input { box-sizing: border-box; width: 100%; height: 28px; min-height: 28px; padding: 2px 7px; border-radius: 6px; font-size: .67rem; }
.pre-existing-contract-dialog .pre-existing-invoice-money { height: 28px; border-radius: 6px; }
.pre-existing-contract-dialog .pre-existing-invoice-money input { height: 26px; min-height: 26px; background: transparent !important; }
.pre-existing-contract-dialog .pre-existing-invoice-money small { align-self: stretch; display: flex; align-items: center; background: transparent; }
.pre-existing-contract-dialog .pre-existing-invoice-money:has(input[readonly]) { border-color: #e1e4e9; background: #f4f5f7; }
.pre-existing-invoice-card.is-settled .pre-existing-invoice-money { border-color: #b9dcc5; background: #fbfffc; }
.pre-existing-invoice-card.is-settled .pre-existing-invoice-money:has(input[readonly]) { border-color: #c8e2d1; background: #e5f3ea; }
.pre-existing-invoice-card input[readonly] { border-color: #e1e4e9; background: #f4f5f7; color: #4e5662; }
.pre-existing-recurring-item { display: grid; gap: 8px; padding: 9px; border: 1px solid #cadcf3; border-radius: 11px; background: #edf6ff; }
.pre-existing-recurring-item > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.pre-existing-recurring-item small { color: var(--muted); }
.pre-existing-recurring-item-grid { display: grid; gap: 5px; align-items: end; padding: 6px; border: 1px solid #c5d9f2; border-radius: 9px; background: #e7f2ff; box-shadow: 0 1px 2px rgba(39, 78, 135, .05); }
.pre-existing-recurring-item-grid.rental { grid-template-columns: 92px 105px 100px 100px minmax(150px, 1fr) 58px 112px 82px; }
.pre-existing-recurring-item-grid.subscription { grid-template-columns: 130px minmax(260px, 1fr) 75px 125px 82px; }
.pre-existing-recurring-item-grid .field { margin: 0; }
.pre-existing-recurring-item-grid input, .pre-existing-recurring-item-grid select { box-sizing: border-box; width: 100%; height: 35px; min-height: 35px; }
.pre-existing-recurring-item-grid [hidden] { display: none !important; }
.pre-existing-product-save { align-self: end; box-sizing: border-box; height: 35px; min-height: 35px; margin: 0; padding-inline: 9px; }
.pre-existing-recurring-extra-lines { display: grid; gap: 3px; }
.pre-existing-product-columns, .pre-existing-product-row { display: grid; gap: 4px; align-items: center; min-width: 0; }
.pre-existing-product-columns.rental, .pre-existing-product-row.rental { grid-template-columns: 92px 105px 100px 100px minmax(150px, 1fr) 58px 112px 35px; }
.pre-existing-product-columns.subscription, .pre-existing-product-row.subscription { grid-template-columns: 130px minmax(260px, 1fr) 75px 125px 35px; }
.pre-existing-product-columns { padding: 0 6px; color: #52647e; font-size: .56rem; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.pre-existing-product-row { min-height: 34px; padding: 3px 5px; border: 1px solid #c4d8f1; border-radius: 7px; background: #f5faff; color: #263d5d; cursor: pointer; }
.pre-existing-product-row:hover { border-color: #91b2dd; background: #edf6ff; }
.pre-existing-product-row.selected { border-color: #5d8bc8; background: #dfedff; box-shadow: inset 3px 0 0 #4679bd; }
.pre-existing-product-row > span { overflow: hidden; font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.pre-existing-product-row .pre-existing-product-fee-value { text-align: right; font-weight: 800; }
.pre-existing-product-row .icon-button { width: 28px; min-width: 28px; height: 28px; min-height: 28px; justify-self: end; }
.pre-existing-contract-dialog .maintenance-editor-section { border-color: #c7d9ef; background: #e8f2fc; }
@media (max-width: 1100px) {
  .quote-subscription-grid, .quote-subscription-variation-grid, .pre-existing-billing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pre-existing-recurring-item { overflow-x: auto; }
  .pre-existing-recurring-item-grid.rental, .pre-existing-product-columns.rental, .pre-existing-product-row.rental { min-width: 850px; }
  .pre-existing-recurring-item-grid.subscription, .pre-existing-product-columns.subscription, .pre-existing-product-row.subscription { min-width: 720px; }
}
@media (max-width: 860px) {
  .pre-existing-invoice-summary output { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pre-existing-invoice-columns { display: none; }
  .pre-existing-invoice-card { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 6px; }
  .pre-existing-invoice-card > [data-label] { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 4px; }
  .pre-existing-invoice-card > [data-label]::before { content: attr(data-label); color: #59647a; font-size: .56rem; font-weight: 850; text-transform: uppercase; }
  .pre-existing-invoice-competence { padding-inline: 0; white-space: normal; }
}
@media (max-width: 620px) {
  .pre-existing-invoice-card { grid-template-columns: minmax(0, 1fr); }
}
.maintenance-quote-inline-panel .maintenance-editor-details {
  grid-template-columns: minmax(180px, 1fr);
  padding: 7px 0 0;
}
.maintenance-effective-date-field small {
  color: #8a5a12;
  font-size: .64rem;
  line-height: 1.2;
}
.maintenance-role-note {
  margin: 0;
  color: var(--muted);
  font-size: .67rem;
}
.business-form.maintenance-mode .quote-approval-toolbar { margin-bottom: 0; }

.maintenance-date-dialog {
  width: min(500px, calc(100vw - 24px));
  max-width: 500px;
  padding: 0;
  border: 1px solid var(--overlay-dialog-border);
  border-radius: var(--overlay-dialog-radius);
  background: var(--surface);
  box-shadow: var(--overlay-dialog-shadow);
}
.maintenance-date-dialog form { display: grid; gap: 11px; }
.maintenance-date-dialog .dialog-header { padding: 14px 16px 11px; }
.maintenance-date-dialog form > .field,
.maintenance-date-dialog form > .dialog-note { margin-inline: 16px; }
.maintenance-date-dialog .dialog-actions { padding: 10px 16px; }

.maintenance-fee-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.maintenance-fee-toggles { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 9px; }

@media (max-width: 1100px) {
  .maintenance-contract-basics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workflow-recurrence-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .maintenance-editor-grid { grid-template-columns: 1fr; }
  .maintenance-rates-section,
  .maintenance-cost-section { grid-column: auto; }
  .maintenance-context-grid,
  .maintenance-cost-grid,
  .maintenance-editor-details { grid-template-columns: 1fr 1fr; }
  .maintenance-title-field,
  .maintenance-notes { grid-column: 1 / -1; }
  .maintenance-quote-cost-grid .maintenance-fee-rate-field { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .maintenance-contract-basics-grid { grid-template-columns: minmax(0, 1fr); }
  .maintenance-quote-cost-grid { grid-template-columns: minmax(0, 1fr); }
  .maintenance-quote-cost-grid .maintenance-fee-rate-field { grid-column: auto; }
}

@media (max-width: 1180px) {
  .service-workspace { grid-template-columns: 230px minmax(0, 1fr); }
  .contract-workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .service-data-grid,
  .contract-data-grid { grid-template-columns: repeat(4, minmax(80px, 1fr)); }
  .intervention-task-add { grid-template-columns: minmax(150px, 1fr) 120px 54px 50px 90px auto; }
  .maintenance-contract-grid { grid-template-columns: repeat(6, minmax(90px, 1fr)); }
}

@media (max-width: 900px) {
  .maintenance-contract-grid { grid-template-columns: repeat(3, minmax(90px, 1fr)); }
  .maintenance-extra-grid { grid-template-columns: repeat(3, minmax(84px, 1fr)); }
}

.repair-form-head h2 { margin: 1px 0 0; font-size: 18px; }
.repair-status-field { width: 155px; flex: 0 0 155px; }

.repair-form-section {
  min-width: 0;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--blue) 12%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--blue-pale) 16%, #fff);
}

.repair-section-title {
  margin-bottom: 6px;
}

.repair-section-title > div {
  display: grid;
  min-width: 0;
}

.repair-section-title strong { font-size: 11px; }
.repair-section-title span { color: var(--ink-soft); font-size: 9px; }

.repair-requester-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) minmax(160px, 1fr) auto;
  gap: 7px;
  align-items: end;
}

.repair-add-address {
  align-self: end;
  height: 35px;
  min-height: 35px;
  box-sizing: border-box;
  white-space: nowrap;
}

.repair-requester-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-height: 20px;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 9px;
}

.repair-requester-preview strong { color: var(--ink); }

.repair-device-operational-grid {
  display: grid;
  grid-template-columns:
    minmax(190px, 1.2fr)
    minmax(210px, 1fr)
    minmax(185px, .85fr)
    minmax(125px, .55fr);
  gap: 7px;
  align-items: end;
  min-width: 0;
}

.repair-device-picker,
.repair-destination-row { display: contents; }

.repair-device-picker .field { position: relative; }

.repair-device-results {
  position: absolute;
  z-index: 15;
  top: calc(100% + 3px);
  right: 0;
  left: 0;
  max-height: 245px;
  overflow: auto;
  padding: 4px;
  border: 1px solid #ccd4e9;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(27, 36, 58, .16);
}

.repair-device-results > button {
  display: grid;
  width: 100%;
  gap: 1px;
  padding: 6px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}

.repair-device-results > button:hover { background: #eef3ff; }
.repair-device-results strong { font-size: 10px; }
.repair-device-results span { font-size: 10px; }
.repair-device-results small { color: var(--ink-soft); font-size: 8px; }

.repair-selected-device {
  height: 35px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px dashed #cfd3d1;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repair-selected-device.selected {
  border-style: solid;
  border-color: #aebdec;
  background: #f2f5ff;
  color: var(--ink);
  font-weight: 700;
}

.repair-new-device {
  display: grid;
  grid-template-columns:
    minmax(75px, .55fr)
    minmax(85px, .65fr)
    minmax(105px, .85fr)
    minmax(170px, 1.5fr)
    minmax(125px, .9fr)
    minmax(145px, 1fr);
  gap: 6px;
  align-items: start;
  margin-top: 7px;
  min-width: 0;
}
.repair-new-device > * { min-width: 0; }

.repair-device-serial-stack {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.repair-inline-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 17px;
  margin: 0;
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
}
.repair-inline-toggle input[type="checkbox"] {
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
}

.repair-asset-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 3px;
}

.repair-asset-input .icon-button {
  width: 30px;
  min-width: 30px;
  height: 35px;
}

.repair-device-intake-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(190px, 1fr);
  gap: 7px;
  align-items: start;
  margin-top: 7px;
  min-width: 0;
}

.repair-description-section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 7px;
}

.repair-problem-field,
.repair-changes-field { grid-column: span 6; }
.repair-diagnosis-field,
.repair-notes-field { grid-column: 1 / -1; }

.repair-auto-textarea {
  min-height: 35px;
  overflow: hidden;
  resize: vertical;
}

.repair-accessories-editor {
  min-height: 35px;
  overflow: visible;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: text;
}

.repair-accessory-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .7fr) minmax(0, .9fr) 30px;
  gap: 4px;
  align-items: center;
}

.repair-accessories-rows { display: grid; }

.repair-accessory-row {
  min-height: 35px;
  padding: 0;
  border-bottom: 0;
}

.repair-accessory-row:last-child { border-bottom: 0; }
.repair-accessory-row input {
  width: 100%;
  height: 35px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--blue) 12%, var(--line));
  border-radius: 8px;
  background: #fff;
  font-size: 10px;
}
.repair-accessory-row input:focus {
  border-color: color-mix(in srgb, var(--blue) 48%, var(--line));
  background: #fff;
}
.repair-accessory-row .icon-button {
  width: 30px;
  min-width: 30px;
  height: 35px;
  min-height: 35px;
  padding: 0;
}

.repair-accessory-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .7fr) minmax(0, .9fr);
  gap: 8px;
  align-items: center;
  min-height: 27px;
  padding: 2px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 9%, var(--line));
  color: var(--ink-soft);
  cursor: pointer;
}
.repair-accessory-summary-row:last-child { border-bottom: 0; }
.repair-accessory-summary-row:hover { background: color-mix(in srgb, var(--blue-pale) 24%, transparent); }
.repair-accessory-summary-row strong,
.repair-accessory-summary-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}
.repair-accessory-summary-row strong { color: var(--ink); }
.repair-accessories-editor.is-summary {
  padding: 2px 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue-pale) 10%, transparent);
}
.repair-accessories-field { cursor: text; }

.repair-form .field {
  min-width: 0;
  margin: 0;
}
.repair-form .field > span {
  font-size: 8px;
  letter-spacing: .05em;
}
.repair-form input:not([type="checkbox"]):not([type="hidden"]),
.repair-form select {
  height: 35px;
  min-height: 35px;
  min-width: 0;
  padding: 0 8px;
  box-sizing: border-box;
}
.repair-form textarea {
  min-width: 0;
  padding: 7px 8px;
  box-sizing: border-box;
  resize: vertical;
}

.repair-form .repair-section-title .primary-button,
.repair-form .repair-section-title .secondary-button,
.repair-form-actions .primary-button,
.repair-form-actions .secondary-button,
.repair-plan-actions .primary-button,
.repair-plan-actions .secondary-button,
.repair-plan-work-add .workflow-insert-icon {
  height: 35px;
  min-height: 35px;
  box-sizing: border-box;
}

.repair-form-actions {
  justify-content: flex-end;
  padding-top: 1px;
}

[data-action="toggle-repair-new-device"].active {
  border-color: var(--blue);
  background: var(--blue-pale);
  color: var(--blue-dark);
}

.repair-technical-plan {
  display: grid;
  gap: 7px;
  border-color: #cfd8f5;
  background: #fbfcff;
}

.repair-plan-head,
.repair-plan-work-head,
.repair-plan-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.repair-plan-head > div:first-child,
.repair-plan-work-head { min-width: 0; }
.repair-plan-head > div:first-child { display: grid; gap: 1px; }
.repair-plan-head strong,
.repair-plan-work-head strong { font-size: 11px; }
.repair-plan-head span,
.repair-plan-work-head span { color: var(--ink-soft); font-size: 9px; }
.repair-plan-owners { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.repair-plan-owners i { padding: 3px 7px; border-radius: 999px; background: #edf1fd; color: #3452b4; font-size: 8px; font-style: normal; font-weight: 800; }

.repair-plan-catalog .field { position: relative; }
.repair-plan-catalog-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 3px);
  right: 0;
  left: 0;
  display: grid;
  max-height: 230px;
  overflow: auto;
  padding: 4px;
  border: 1px solid #cbd4ee;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(31, 48, 91, .16);
}
.repair-plan-catalog-results button { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 7px; align-items: center; width: 100%; padding: 6px 7px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.repair-plan-catalog-results button:hover { background: #eef3ff; }
.repair-plan-catalog-results strong { font-size: 9px; color: var(--blue-dark); }
.repair-plan-catalog-results span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.repair-plan-catalog-results small { color: var(--ink-soft); font-size: 8px; white-space: nowrap; }

.repair-plan-material-list,
.repair-plan-work-list { display: grid; gap: 4px; }
.repair-plan-material-row { display: grid; grid-template-columns: 105px minmax(160px, 1fr) 64px 128px 35px; gap: 6px; align-items: center; min-height: 43px; padding: 3px 4px 3px 8px; border: 1px solid #dde3f3; border-radius: 8px; background: #fff; }
.repair-plan-material-row > strong,
.repair-plan-material-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repair-plan-material-row > strong { color: #3957b8; font-size: 9px; }
.repair-plan-material-row > span { font-size: 10px; }
.repair-plan-material-row input,
.repair-plan-material-row select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 35px;
  min-height: 35px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--ui-field-font);
  font-size: 9px;
  box-shadow: none;
}
.repair-plan-material-row input { text-align: center; }
.repair-plan-material-row input:focus,
.repair-plan-material-row select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53, 88, 212, .09); }
.repair-plan-material-row input:disabled,
.repair-plan-material-row select:disabled { cursor: default; background: #f3f5f8; color: var(--ink-soft); opacity: 1; }
.repair-plan-material-row .icon-button { width: 35px; min-width: 35px; height: 35px; min-height: 35px; }

.repair-plan-work-add.quote-workflow-entry-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 7px;
  border-color: color-mix(in srgb, var(--blue) 16%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--blue-pale) 22%, #fff);
}
.repair-plan-work-add .quote-workflow-description-field { flex: 3 1 220px; min-width: 180px; }
.repair-plan-work-add #repair-plan-work-group-field { flex: 1 1 125px; min-width: 115px; max-width: 155px; }
.repair-plan-work-add #repair-plan-work-skill-field {
  flex: 1 1 180px;
  width: 180px;
  min-width: 165px;
  max-width: 180px;
}
.repair-plan-work-add .workflow-people-field { flex: 0 0 72px; }
.repair-plan-work-add .workflow-location-field { flex: 0 0 90px; }
.repair-plan-work-add.workflow-step-editor .duration-field { flex: 0 0 170px; }
.repair-plan-work-add .quote-workflow-insert-actions { flex: 0 0 auto; margin-left: auto; }
.repair-plan-work-add > .field > input,
.repair-plan-work-add > .field > select { height: 35px; min-height: 35px; }
.repair-plan-work-add .quote-workflow-rate-input {
  position: relative;
  height: 35px;
  min-height: 35px;
  padding-block: 0;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  box-shadow: none;
}
.repair-plan-work-add .quote-workflow-rate-input::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: inherit;
  box-sizing: border-box;
}
.repair-plan-work-add .quote-workflow-rate-input:focus-within::after {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 88, 212, .09);
}
.repair-plan-work-add .quote-workflow-rate-input input { height: 33px; min-height: 33px !important; }
.repair-plan-work-row { display: grid; grid-template-columns: 24px minmax(170px, 1fr) minmax(145px, .65fr) minmax(145px, .7fr) 90px 27px 27px 27px; gap: 5px; align-items: center; min-height: 38px; padding: 4px 5px; border: 1px solid color-mix(in srgb, var(--blue) 15%, var(--line)); border-radius: 9px; background: #fff; }
.repair-plan-work-row > b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: #edf1fd; color: #3e5bc1; font-size: 8px; }
.repair-plan-work-row > strong,
.repair-plan-work-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repair-plan-work-row > strong { font-size: 10px; }
.repair-plan-work-row > span { color: var(--ink-soft); font-size: 8px; }
.repair-plan-work-row button { width: 27px; min-width: 27px; height: 27px; padding: 0; }

.repair-plan-handoff { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(145px, .55fr) minmax(180px, .9fr); gap: 6px; align-items: end; padding-top: 3px; border-top: 1px solid #e0e5f3; }
.repair-plan-actions { justify-content: flex-end; }
#repair-commercial-decision { padding: 8px; border: 1px solid #dce5f6; border-radius: 10px; background: #f4f8ff; }
#repair-direct-fields { padding-top: 6px; }
#repair-direct-fields .repair-plan-actions { margin-top: 6px; align-items: center; flex-wrap: wrap; }
#repair-direct-fields .repair-inline-toggle { margin-right: auto; font-size: 10px; }
#repair-direct-evidence { margin: 4px 0; font-size: 10px; color: var(--ink-soft); }
.repair-technical-plan.is-locked .repair-plan-catalog,
.repair-technical-plan.is-locked .repair-plan-work-add { display: none; }

@media (max-width: 1180px) {
  .repair-plan-handoff { grid-template-columns: 1fr 150px; }
  .repair-plan-message { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .repair-workspace { grid-template-columns: 230px minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .repair-workspace,
  .service-workspace { grid-template-columns: 1fr; }
  .repair-list-panel,
  .service-workspace .service-list-panel { position: static; }
  .repair-list,
  .service-workspace .service-list { max-height: 240px; }
  .repair-requester-row,
  .repair-device-operational-grid { grid-template-columns: 1fr; }
  .repair-device-picker,
  .repair-destination-row { display: contents; }
  .repair-description-section,
  .repair-device-intake-grid { grid-template-columns: 1fr; }
  .repair-new-device { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .repair-problem-field,
  .repair-changes-field,
  .repair-intake-field,
  .repair-accessories-field,
  .repair-diagnosis-field,
  .repair-notes-field { grid-column: auto; }
  .repair-plan-handoff { grid-template-columns: 1fr 1fr; }
  .repair-plan-message,
  .repair-plan-notes { grid-column: 1 / -1; }
  .repair-plan-work-add #repair-plan-work-skill-field { width: auto; max-width: none; }
  .repair-plan-work-row { grid-template-columns: 24px minmax(0, 1fr) auto auto auto; }
  .repair-plan-work-row .repair-plan-work-group,
  .repair-plan-work-row .repair-plan-work-skill { display: none; }
}

@media (max-width: 720px) {
  .goods-receipt-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .receipt-unit-identities { grid-column: 1 / -1; }
  .goods-receipt-line { grid-template-columns: minmax(0, 1fr) auto; }
  .goods-receipt-line > i { grid-column: 1; }
  .goods-receipt-history-row { align-items: flex-start; flex-direction: column; }
  .goods-receipt-history-row > span:last-child { text-align: left; }
  .purchase-receipt-context,
  .purchase-receipt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-receipt-context .wide { grid-column: 1 / -1; }
}

/* Uscita merce e preparazione tecnica */
.goods-issues-page {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.goods-issues-page[hidden] { display: none; }

.goods-issues-head,
.goods-issue-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.goods-issues-head {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.goods-issues-head h2,
.goods-issues-head p { margin: 0; }
.goods-issues-head h2 { font-size: 18px; }
.goods-issues-head > div > span { color: var(--muted); font-size: 12px; }

.goods-issues-summary { display: flex; flex-wrap: wrap; gap: 7px; }
.goods-issues-summary > span {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid #d8def3;
  border-radius: 999px;
  background: #f5f7ff;
}
.goods-issues-summary strong { color: var(--primary); }
.goods-issues-summary small { color: var(--muted); }

.goods-issues-layout {
  display: grid;
  grid-template-columns: minmax(215px, .42fr) minmax(0, 1.58fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.goods-issue-commissions,
.goods-issue-entry,
.goods-issue-history {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.goods-issue-commission-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  padding: 7px 8px;
  border: 1px solid #e1e4ed;
  border-radius: 9px;
  background: #fff;
  color: inherit;
  text-align: left;
}
.goods-issue-commission-card:hover { border-color: #b9c7ef; background: #f7f9ff; }
.goods-issue-commission-card.selected { border-color: #7390e4; background: #eef3ff; box-shadow: inset 3px 0 0 #4265cf; }
.goods-issue-commission-card.selected { border-color: #3558d4; box-shadow: inset 4px 0 0 #3558d4, 0 0 0 1px #3558d4; }
.goods-issue-commission-card > span,
.goods-issue-commission-card > em { display: grid; min-width: 0; gap: 1px; font-style: normal; }
.goods-issue-commission-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.goods-issue-commission-card b { color: var(--primary); font-size: 10px; }
.goods-issue-commission-card small { color: var(--muted); font-size: 9px; }
.goods-issue-commission-card > em { text-align: right; }

.goods-issue-entry { display: grid; gap: 8px; }
.goods-issue-selection {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid #cfdaff;
  border-radius: 9px;
  background: #f3f6ff;
}
.goods-issue-selection > div { display: grid; min-width: 0; gap: 1px; }
.goods-issue-selection strong { font-size: 12px; }
.goods-issue-selection small,
.goods-issue-selection span { color: var(--muted); font-size: 10px; }

.goods-issue-fields {
  display: grid;
  grid-template-columns: minmax(145px, .8fr) minmax(135px, .75fr) minmax(150px, .85fr) 116px minmax(190px, 1.1fr);
  gap: 6px;
  align-items: end;
}
.goods-issue-entry .field { min-width: 0; margin: 0; }
.goods-issue-entry .field > span:first-child { font-size: 9px; }
.goods-issue-entry input,
.goods-issue-entry select { width: 100%; min-width: 0; min-height: 34px; padding: 5px 7px; }
.goods-issue-technical-row {
  display: grid;
  grid-template-columns: max-content minmax(180px, .7fr) minmax(220px, 1.3fr);
  gap: 6px;
  align-items: end;
}
.goods-issue-technical-row > .field:last-child { grid-column: -2 / -1; }
.goods-issue-technical-row .receipt-toggle-button { align-self: end; min-height: 34px; }
.receipt-toggle-button.is-technical { border: 0; background: transparent; padding: 0; }
.receipt-toggle-button.is-technical span { min-height: 34px; }
.receipt-toggle-button.is-technical.active span { border-color: #d49a35; background: #fff1cf; color: #7d4b00; }
.receipt-toggle-button.is-technical.active span::before { background: #df9411; box-shadow: 0 0 0 2px rgba(223,148,17,.16); }

.goods-issue-materials {
  min-width: 0;
  padding: 7px;
  border: 1px solid #e0e3ec;
  border-radius: 10px;
  background: #fafbfe;
}
.goods-issue-material-group { display: grid; gap: 3px; margin-top: 5px; }
.goods-issue-material-group.grouped {
  padding: 5px;
  border-left: 2px solid #7894e5;
  border-radius: 8px;
  background: #f4f6ff;
}
.goods-issue-material-group > header { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 1px 3px 4px; }
.goods-issue-material-group > header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.goods-issue-material-group > header small { margin-left: auto; color: var(--muted); font-size: 9px; }
.warehouse-group-badge { padding: 2px 5px; border-radius: 999px; background: #e8edff; color: #3f5cb6; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.warehouse-group-badge.aggregate { background: #e5f5ed; color: #277052; }

.goods-issue-material {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e2e5ed;
  border-radius: 8px;
  background: #fff;
}
.goods-issue-material.unavailable { opacity: .58; }
.goods-issue-material-main {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 58px 64px 66px;
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 5px 7px;
}
.goods-issue-material-main > span { display: grid; min-width: 0; gap: 1px; }
.goods-issue-material-main > span b { color: var(--primary); font-size: 10px; }
.goods-issue-material-main > span strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.goods-issue-material-main > span small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.goods-issue-material-main > em { display: grid; gap: 1px; text-align: right; font-style: normal; }
.goods-issue-material-main > em small { color: var(--muted); font-size: 8px; }
.goods-issue-material-main > em b { font-size: 10px; }
.goods-issue-material-main .field input { min-height: 29px; height: 29px; padding: 3px 5px; text-align: right; }
.goods-issue-units { display: grid; gap: 3px; padding: 4px 7px 6px 31px; border-top: 1px solid #edf0f5; }
.goods-issue-units > small { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.goods-issue-units > div { display: flex; flex-wrap: wrap; gap: 4px; }
.goods-issue-units label { display: inline-flex; align-items: center; gap: 4px; min-height: 25px; padding: 3px 6px; border: 1px solid #dce1ec; border-radius: 7px; background: #fff; font-size: 9px; }
.goods-issue-units label:has(input:checked) { border-color: #6f8bdc; background: #edf2ff; color: #294aa6; }
.goods-issue-units label small { color: var(--muted); font-size: 8px; }
.goods-issue-entry > .primary-button { justify-self: end; }

.goods-issue-history { display: grid; gap: 5px; }
.goods-issue-history-row { padding: 6px 8px; border: 1px solid #e3e6ed; border-radius: 9px; }
.goods-issue-history-row > span { display: grid; min-width: 0; gap: 1px; }
.goods-issue-history-row > span:nth-child(2) { flex: 1; }
.goods-issue-history-row b,
.goods-issue-history-row strong { font-size: 10px; }
.goods-issue-history-row small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.goods-issue-history-row i { justify-self: start; padding: 3px 7px; border-radius: 999px; background: #edf0f5; color: #596274; font-size: 9px; font-style: normal; font-weight: 850; }
.goods-issue-history-row.status-awaiting_technical_check i { background: #fff0cd; color: #865400; }
.goods-issue-history-row.status-draft i { background: #eef2ff; color: #3555a8; }
.goods-issue-history-row.status-ready i { background: #e4f4eb; color: #1f704d; }
.goods-issue-history-row.task-context-highlight {
  border-color: #3558d4;
  box-shadow: inset 4px 0 0 #3558d4, 0 0 0 1px #3558d4;
}
#goods-issue-show-completed.active { background: #eef3ff; border-color: #3558d4; color: #2949b5; }
.goods-issue-history-row.status-issued i { background: #e8edff; color: #3454ae; }
.goods-issue-history-actions { display: flex !important; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 5px !important; }
.goods-issue-history-actions > select {
  appearance:none; box-sizing:border-box; flex:0 1 210px;
  width:210px; max-width:100%; min-width:150px; height:42px; min-height:42px;
  padding:0 34px 0 12px; margin:0; border:1px solid var(--line); border-radius:9px;
  color:var(--ink); background-color:#fff;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23596274' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center;
  font-family:var(--ui-field-font); font-size:13px; line-height:normal;
  text-overflow:ellipsis; cursor:pointer;
}
.goods-issue-history-actions > select:focus-visible { outline:2px solid #3655d9; outline-offset:2px; }
.goods-issue-history-actions > select:disabled { background-color:#f3f5f9; color:var(--muted); cursor:default; opacity:1; }
.goods-issue-history-actions > button[data-action="confirm-goods-issue-technical"] { min-height:42px; box-sizing:border-box; }
.goods-issue-signed-ddt-file { width: 148px; min-width: 0; font-size: 9px; }
.goods-issue-shipping-complete { display: grid; min-width: 100px; gap: 1px; padding: 3px 6px; border-radius: 7px; background: #edf7f1; color: #246548; }
.goods-issue-shipping-complete.in-transit { background: #fff2cf; color: #805400; }
.goods-issue-shipping-dialog { width: min(590px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 14px; }
.goods-issue-shipping-dialog form { display: grid; gap: 10px; padding: 14px; }
.goods-issue-shipping-dialog header,
.goods-issue-shipping-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.goods-issue-shipping-dialog h3,
.goods-issue-shipping-dialog p { margin: 0; }
.goods-issue-shipping-dialog footer { justify-content: flex-end; }
.goods-issue-shipping-fields { display: grid; grid-template-columns: minmax(140px, .85fr) 132px minmax(180px, 1.15fr); gap: 7px; align-items: end; }
.goods-issue-shipping-fields .field { min-width: 0; margin: 0; }
.goods-issue-shipping-fields input { width: 100%; min-width: 0; min-height: 36px; }
.goods-issue-delivery-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.goods-issue-delivery-summary span { display: grid; min-width: 0; gap: 2px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #f8faff; }
.goods-issue-delivery-summary small { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.goods-issue-delivery-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.goods-issue-delivery-date { width: 150px; margin: 0; }

@media (max-width: 1180px) {
  .goods-issues-layout { grid-template-columns: 1fr; }
  .goods-issue-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .goods-issue-destination-text { grid-column: span 2; }
}

@media (max-width: 720px) {
  .goods-issues-head,
  .goods-issue-history-row { align-items: stretch; flex-direction: column; }
  .goods-issue-fields,
  .goods-issue-technical-row { grid-template-columns: 1fr; }
  .goods-issue-destination-text,
  .goods-issue-technical-row > .field:last-child { grid-column: auto; }
  .goods-issue-material-main { grid-template-columns: 18px minmax(0, 1fr) 60px; }
  .goods-issue-material-main > em { display: none; }
  .goods-issue-shipping-fields { grid-template-columns: 1fr; }
  .goods-issue-delivery-summary { grid-template-columns: 1fr; }
}

.announcement-dialog {
  width: min(660px, calc(100% - 28px));
}

.announcement-layout {
  padding: 26px;
}

.announcement-list {
  display: grid;
  gap: 0;
  max-height: min(55vh, 520px);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  counter-reset: announcement;
  border-top: 1px solid var(--line);
}

.announcement-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  counter-increment: announcement;
}

.announcement-list li::before {
  content: counter(announcement);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #254f40;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.announcement-list li span {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.announcement-dismiss {
  width: 100%;
  min-height: 42px;
  margin-top: 18px;
}

.commission-chat-dialog {
  width: min(980px, calc(100% - 28px));
}

.commission-chat-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.32fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(320px, 1fr) auto;
  gap: 14px 18px;
  padding: 24px;
}

.commission-chat-layout > .dialog-header {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.commission-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.commission-chat-participants {
  grid-row: 2 / 4;
  min-width: 0;
  padding-right: 16px;
  overflow: auto;
  border-right: 1px solid var(--line);
}

.commission-chat-participants > strong {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
}

#commission-chat-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

#project-chat-groups {
  display: grid;
  gap: 7px;
}

#project-chat-users {
  display: none;
}

.project-chat-role-row {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.project-chat-role-row > strong {
  min-width: 0;
  overflow: hidden;
  color: #28313b;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-chat-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.project-chat-role-row.role-commercial .project-chat-role-badge {
  color: #214aa6;
  background: #eaf0ff;
  border-color: #c8d6fa;
}

.project-chat-role-row.role-solution_architect .project-chat-role-badge {
  color: #68409a;
  background: #f0e9fa;
  border-color: #dbc9ee;
}

.project-chat-role-row.role-project_manager .project-chat-role-badge {
  color: #99611e;
  background: #fff1dc;
  border-color: #efd1a5;
}

.commission-chat-group {
  padding: 5px 7px;
  color: #355344;
  background: #e8f2ec;
  border: 1px solid #c8ded2;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 750;
}

#commission-chat-users {
  display: grid;
  gap: 6px;
}

.commission-chat-user {
  min-width: 0;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.commission-chat-user strong,
.commission-chat-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-chat-user strong {
  font-size: 10px;
}

.commission-chat-user small,
.commission-chat-participants-empty {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.commission-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 320px;
  max-height: min(52vh, 520px);
  padding: 12px;
  overflow: auto;
  background: #f4f5f2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.commission-chat-message {
  width: min(78%, 560px);
  align-self: flex-start;
  padding: 10px 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#project-chat-messages {
  background-color: #eef1ec;
  background-image:
    radial-gradient(circle at 12px 12px, rgba(64, 88, 74, 0.035) 1px, transparent 1.5px);
  background-size: 24px 24px;
}

#project-chat-messages .commission-chat-message {
  position: relative;
  border-radius: 12px 12px 12px 3px;
  box-shadow: 0 1px 2px rgba(35, 45, 39, 0.07);
}

#project-chat-messages .commission-chat-message.is-mine {
  background: #e1f3da;
  border-color: #c3ddba;
  border-radius: 12px 12px 3px 12px;
}

.commission-chat-message.is-mine {
  align-self: flex-end;
  background: #eaf0ff;
  border-color: #c9d4f5;
}

.commission-chat-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.commission-chat-message-head strong {
  font-size: 10px;
}

.commission-chat-message-head time,
.commission-chat-message > small {
  color: var(--muted);
  font-size: 9px;
}

.project-chat-message-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.project-chat-delete-message {
  display: inline-grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  color: #a53a31;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.project-chat-delete-message:hover {
  background: rgba(165, 58, 49, 0.1);
}

.project-chat-delete-message svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.project-chat-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.project-chat-button.has-unread {
  color: #8b4d0b;
  background: #fff0d8;
  border-color: #e9b66e;
  box-shadow: 0 0 0 1px rgba(222, 145, 42, 0.08);
}

.chat-unread-envelope {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  color: #d77712;
  vertical-align: middle;
}

.chat-unread-envelope svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chat-unread-count {
  display: inline-grid;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  place-items: center;
  color: #fff;
  background: #df7b16;
  border-radius: 9px;
  font-size: 8px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
}

.commission-chat-message p {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.commission-chat-empty {
  margin: auto;
  color: var(--muted);
  font-size: 11px;
}

.commission-chat-layout > form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 0;
}

.commission-chat-layout > form .field {
  margin: 0;
}

.commission-chat-layout > form textarea {
  min-height: 72px;
  resize: vertical;
}

.commission-unlock-button {
  color: #285f47;
  border-color: #afd0bd;
}

.task-dialog form {
  padding: 28px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 25px;
}

.dialog-header .eyebrow {
  margin-bottom: 6px;
}

.dialog-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.field {
  margin-bottom: 16px;
}

.field > span b {
  color: var(--coral);
}

.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 4px 0 18px;
}

.score-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.score-field > span:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.score-field output {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--metric-color);
  border-radius: 50%;
  font-size: 11px;
}

.score-field.importance { --metric-color: var(--blue); }
.score-field.urgency { --metric-color: var(--coral); }

.score-field input {
  width: 100%;
  accent-color: var(--metric-color);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 9px;
}

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

.priority-preview {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 2px;
  padding: 13px 15px;
  background: var(--blue-pale);
  border: 1px solid #cfd7ff;
  border-radius: 12px;
}

.preview-orb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.priority-preview strong {
  display: block;
  font-size: 12px;
}

.priority-preview p {
  margin: 4px 0 0;
  color: #56618a;
  font-size: 10px;
}

.task-assignment-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.task-assignment-panel {
  padding: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.task-assignment-panel.is-locked {
  background: #f7f7f5;
}

.task-action-request-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px;
  background: #fff8ed;
  border: 1px solid #efd2a9;
  border-radius: 12px;
}

.task-action-request-row button {
  flex: 0 0 auto;
}

.task-action-request-row small {
  color: #8a5d2c;
  font-size: 11px;
  font-weight: 650;
}

.task-action-history {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.task-action-history-title,
.task-action-history-head,
.task-action-history-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-action-history-title {
  justify-content: space-between;
  color: var(--ink);
  font-size: 12px;
}

.task-action-history-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.task-action-history-list {
  display: grid;
  gap: 8px;
}

.task-action-history-card {
  padding: 10px 11px;
  background: #fbfbf8;
  border: 1px solid var(--line);
  border-left: 3px solid #d95a4f;
  border-radius: 8px;
}

.task-action-history-card.is-completed {
  border-left-color: #3f8b68;
}

.task-action-history-card.is-canceled {
  border-left-color: #8a8a80;
}

.task-action-history-head {
  justify-content: space-between;
  margin-bottom: 7px;
}

.task-action-history-card p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.task-action-history-meta {
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.task-action-response {
  margin-top: 8px !important;
  padding: 8px 9px;
  background: #eef7f1;
  border-radius: 8px;
}

.task-action-history-empty {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.task-action-comments-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  background: #f7f9fc;
  border: 1px solid #d9e0ec;
  border-radius: 8px;
}

.task-action-comments-title,
.task-action-comment-head,
.task-action-comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-action-comments-title {
  justify-content: space-between;
  color: var(--ink);
  font-size: 12px;
}

.task-action-comments-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.task-action-comments-list {
  display: grid;
  gap: 8px;
}

.task-action-comment-card {
  padding: 10px 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid #3f8b68;
  border-radius: 8px;
}

.task-action-comment-card.is-canceled {
  border-left-color: #8a8a80;
}

.task-action-comment-head {
  justify-content: space-between;
  margin-bottom: 7px;
}

.task-action-comment-card p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-action-comment-meta {
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.task-action-comments-empty {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.task-assignment-work {
  margin: 0;
}

.task-assignment-work textarea {
  min-height: 95px;
  resize: vertical;
}

.task-assignment-work textarea:disabled {
  color: #666e69;
  background: #f1f1ed;
  cursor: not-allowed;
  opacity: 1;
}

.task-assignment-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 12px;
}

.task-assignment-actions.claim-only {
  justify-content: flex-start;
  margin-top: 0;
}

.task-assignment-actions .assignment-button.mine {
  color: #9c3f32;
  border-color: #e6bcb5;
}

.task-assignment-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: #f7f5ef;
  border-radius: 10px;
  font-size: 11px;
}

.task-assignment-notice strong {
  color: var(--ink);
}

.task-schedule-section {
  margin-top: 16px;
}

.task-schedule-detail {
  padding: 13px;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.task-schedule-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 10px;
}

.task-schedule-detail-head strong {
  color: var(--ink);
  font-size: 12px;
}

.task-schedule-detail-head span {
  font-weight: 800;
}

.task-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-detail-heading {
  margin-bottom: 14px;
}

.task-detail-heading .eyebrow {
  margin: 0 0 4px;
}

.task-detail-heading h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 400;
}

.task-detail-progress {
  padding: 6px 10px;
  color: #56618a;
  background: var(--blue-pale);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.assignment-history {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.assignment-history summary {
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.assignment-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.assignment-history-list li {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 10px;
}

.assignment-history-comment {
  grid-column: 1 / -1;
  margin: 0;
  padding: 7px 9px;
  color: var(--ink);
  background: #f7f5ef;
  border-radius: 8px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.dialog-footer {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 9px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.group-dialog {
  width: min(920px, calc(100% - 28px));
}

.group-create-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
}

.group-create-row .field {
  margin-bottom: 0;
}

.group-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 22px;
}

.group-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 11px;
}

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

.group-permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.group-permissions-heading {
  margin-top: 12px;
  color: var(--ink);
  font-size: 9px;
  font-weight: 820;
  text-transform: uppercase;
}

.group-module-permissions span {
  min-width: 104px;
  justify-content: center;
}

.group-permissions label {
  position: relative;
  cursor: pointer;
}

.group-permissions input {
  position: absolute;
  opacity: 0;
}

.group-permissions span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  color: var(--ink-soft);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 750;
}

.group-permissions input:checked + span {
  color: var(--blue);
  background: var(--blue-pale);
  border-color: #bfcaf0;
}

.group-permissions input:disabled + span {
  cursor: default;
  opacity: 0.72;
}

.group-name-input {
  width: 100%;
  min-height: 32px;
  padding: 0 8px;
  color: var(--ink);
  background: white;
  border: 1px solid transparent;
  border-radius: 7px;
  outline: 0;
  font-size: 12px;
  font-weight: 750;
}

.group-name-input:hover {
  border-color: var(--line);
}

.group-name-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 88, 212, 0.09);
}

.group-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.group-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
  border-radius: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.group-row small {
  display: block;
}

.group-row small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
}

.admin-badge {
  padding: 5px 8px;
  color: #257150;
  background: #dff2e9;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 780;
  text-transform: uppercase;
}

.dialog-note {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.user-dialog {
  width: min(980px, calc(100% - 28px));
}

.commission-dialog {
  width: min(1180px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  overflow-x: hidden;
}

.address-book-dialog {
  width: min(1180px, calc(100% - 28px));
}

.address-book-dialog.quick-create {
  width: min(780px, calc(100% - 28px));
}

.administration-actions .secondary-button.active,
.administration-list-subnav .secondary-button.active,
.settings-actions .secondary-button.active {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.administration-list-subnav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -6px 0 14px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f8fb;
}

.administration-list-subnav[hidden] { display: none; }

.administration-list-subnav .secondary-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 10px;
}

.administration-list-subnav .secondary-button svg { width: 16px; height: 16px; }

.catalog-verification-shell { display: grid; gap: 14px; box-shadow: none; }
.catalog-verification-heading {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.catalog-verification-heading h2 { margin: 2px 0 5px; font-size: 21px; }
.catalog-verification-heading p:not(.eyebrow) { margin: 0; color: var(--ink-soft); font-size: 11px; }
.catalog-verification-toolbar {
  display: grid; grid-template-columns: minmax(260px, 1fr) 150px auto auto;
  align-items: end; gap: 7px; width: min(720px, 62vw);
}
.catalog-verification-toolbar .field { min-width: 0; margin: 0; }
.catalog-verification-toolbar .field > span { margin-bottom: 3px; color: #60675f; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.catalog-verification-toolbar input,
.catalog-verification-toolbar select,
.catalog-verification-toolbar button { min-height: 35px; height: 35px; }
.catalog-verification-toolbar input,
.catalog-verification-toolbar select { width: 100%; min-width: 0; padding: 0 9px; border-color: #d8d3c8; border-radius: 8px; font-size: 11px; }
.catalog-verification-context-card {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: center;
  gap: 12px; padding: 11px 13px; color: #344869; background: #edf3ff;
  border: 1px solid #cedafa; border-radius: 10px;
}
.catalog-verification-context-card.neutral { grid-template-columns: minmax(0, 1fr) auto; background: #f6f5f1; border-color: var(--line); }
.catalog-verification-context-card.is-complete { color: #286648; background: #e7f4ec; border-color: #c5e2d1; }
.catalog-verification-context-card span { display: grid; min-width: 0; gap: 2px; }
.catalog-verification-context-card small { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.catalog-verification-context-card strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-verification-context-card > b { padding: 5px 9px; background: rgba(255,255,255,.72); border-radius: 999px; font-size: 9px; white-space: nowrap; }
.catalog-verification-list { display: grid; gap: 14px; }
.catalog-verification-card {
  display: grid; gap: 12px; padding: 14px; background: #fffdfa;
  border: 1px solid var(--line); border-radius: 11px;
}
.catalog-verification-card.is-inactive { background: #f2f1ed; opacity: .82; }
.catalog-verification-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.catalog-verification-card-heading > span { display: grid; min-width: 0; gap: 2px; }
.catalog-verification-card-heading small { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.catalog-verification-card-heading strong { color: var(--blue); font-size: 14px; }
.catalog-verification-card-heading em { color: var(--ink); font-size: 11px; font-style: normal; font-weight: 720; }
.catalog-verification-status { padding: 5px 9px; color: #9a3f34; background: #fbe7e3; border-radius: 999px; font-size: 9px; white-space: nowrap; }
.catalog-verification-status.is-ready { color: #8a5b13; background: #fff0ce; }
.catalog-verification-status.is-verified { color: #286648; background: #e2f2e8; }
.catalog-verification-status.is-inactive { color: #6d716d; background: #e4e5e1; }
.catalog-verification-issues { display: flex; flex-wrap: wrap; gap: 5px; }
.catalog-verification-issues span { padding: 4px 7px; color: #815816; background: #fff0ce; border-radius: 999px; font-size: 9px; font-weight: 750; }
.catalog-verification-issues .is-blocking { color: #963b31; background: #fbe7e3; }
.catalog-verification-section { display: grid; gap: 9px; padding: 11px; background: #f8f8f5; border: 1px solid #e4e1d9; border-radius: 9px; }
.catalog-verification-section-title { display: flex; align-items: baseline; gap: 8px; }
.catalog-verification-section-title strong { font-size: 12px; }
.catalog-verification-section-title small { color: var(--muted); font-size: 9px; }
.catalog-verification-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.catalog-verification-grid.supplier-main { grid-template-columns: 1.3fr 1.3fr repeat(3, minmax(105px, .75fr)); }
.catalog-verification-grid.product-codes { grid-template-columns: .9fr repeat(4, minmax(0, 1fr)); }
.catalog-verification-grid.product-description .wide { grid-column: span 2; }
.catalog-verification-grid.product-procurement { grid-template-columns: repeat(6, minmax(105px, 1fr)); }
.catalog-verification-address-grid { display: grid; grid-template-columns: minmax(220px, 2fr) 70px 90px minmax(140px, 1.2fr) 70px minmax(110px, .8fr); gap: 7px; }
.catalog-verification-card .field { min-width: 0; margin: 0; }
.catalog-verification-card .field > span { margin-bottom: 3px; color: #60675f; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.catalog-verification-card input,
.catalog-verification-card select { width: 100%; min-width: 0; min-height: 35px; height: 35px; padding: 0 9px; border-color: #d8d3c8; border-radius: 8px; font-size: 11px; }
.catalog-verification-card input[readonly] { color: #687068; background: #eeeee9; }
.catalog-verification-card textarea { min-height: 58px; padding: 8px 9px; border-color: #d8d3c8; border-radius: 8px; resize: vertical; font-size: 11px; }
.catalog-verification-check { align-self: end; min-height: 35px; margin: 0; padding: 0 9px; background: #fff; border: 1px solid #d8d3c8; border-radius: 8px; }
.catalog-verification-check input { width: 15px; min-height: 15px; height: 15px; }
.catalog-verification-actions { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, auto); align-items: center; gap: 8px; padding-top: 2px; }
.catalog-verification-actions small { color: var(--muted); font-size: 9px; }
.catalog-verification-actions button { min-height: 35px; height: 35px; }
@media (max-width: 1280px) {
  .catalog-verification-grid.supplier-main,
  .catalog-verification-grid.product-codes,
  .catalog-verification-grid.product-procurement { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalog-verification-address-grid { grid-template-columns: minmax(180px, 2fr) 70px 90px minmax(130px, 1.2fr) 70px; }
  .catalog-verification-address-grid > :last-child { grid-column: span 2; }
}
@media (max-width: 840px) {
  .catalog-verification-heading, .catalog-verification-card-heading { align-items: stretch; flex-direction: column; }
  .catalog-verification-toolbar { grid-template-columns: 1fr 1fr; width: 100%; }
  .catalog-verification-context-card { grid-template-columns: 1fr; }
  .catalog-verification-grid,
  .catalog-verification-grid.supplier-main,
  .catalog-verification-grid.product-codes,
  .catalog-verification-grid.product-procurement,
  .catalog-verification-address-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-verification-grid.product-description .wide,
  .catalog-verification-address-grid .address-street { grid-column: 1 / -1; }
  .catalog-verification-actions { grid-template-columns: 1fr 1fr; }
  .catalog-verification-actions small { grid-column: 1 / -1; }
}

.administration-section[hidden],
.settings-section[hidden] {
  display: none;
}

.import-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.import-form-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.import-copy {
  max-width: 760px;
  margin: -6px 0 18px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

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

.import-file-field {
  grid-column: 1 / -1;
}

.import-file-field small,
.import-price-list-fields .field small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.35;
}

.import-price-list-fields {
  margin-top: 14px;
  padding: 14px;
  background: #f6f7fb;
  border: 1px solid #dfe3ef;
  border-radius: 10px;
}

.import-api-credentials {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #dfe3ef;
}

.import-api-credentials > small {
  display: block;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.45;
}

.import-browser-upload {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  background: #fff;
  border: 1px dashed #b9c5dc;
  border-radius: 9px;
}

.import-browser-upload input[type="file"] {
  width: 100%;
  min-height: 30px;
  padding: 3px;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 10px;
}

.import-browser-upload small {
  color: var(--muted);
  font-size: 9px;
}

/* Controllo file uniforme: preventivi, contratti, firme, DDT e importazioni. */
input[type="file"] {
  min-width: 0;
  min-height: 36px;
  padding: 3px 8px 3px 3px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--ui-field-font);
  font-size: 10px;
  line-height: 28px;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input[type="file"]::file-selector-button {
  min-height: 28px;
  margin: 0 9px 0 0;
  padding: 5px 11px;
  color: var(--blue-dark);
  background: var(--blue-pale);
  border: 0;
  border-radius: 7px;
  font-family: var(--ui-field-font);
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

input[type="file"]:hover {
  background: #fff;
  border-color: #b9c5e2;
}

input[type="file"]:hover::file-selector-button {
  color: #fff;
  background: var(--blue);
}

input[type="file"]:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 88, 212, 0.14);
}

input[type="file"]:disabled,
input[type="file"]:disabled::file-selector-button {
  cursor: not-allowed;
  opacity: 0.58;
}

.import-save-credentials {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  cursor: pointer;
}

.import-save-credentials input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.import-connector-schedule {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: #eef3ff;
  border: 1px solid #d4def5;
  border-radius: 10px;
}

.import-connector-schedule[hidden] {
  display: none;
}

.import-connector-schedule-heading,
.import-schedule-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.import-connector-schedule-heading > div {
  display: grid;
  gap: 3px;
}

.import-connector-schedule-heading strong {
  font-size: 11px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.import-connector-schedule-heading small,
.import-connector-history {
  color: var(--ink-soft);
  font-size: 9px;
}

.import-connector-schedule-heading .import-save-credentials {
  margin: 0;
}

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

.import-schedule-actions {
  justify-content: flex-start;
}

.import-connector-history {
  display: grid;
  gap: 5px;
}

.import-connector-history-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  background: rgba(255, 255, 255, .7);
  border-radius: 6px;
}

.import-run-status {
  width: 7px;
  height: 7px;
  background: #8b94a7;
  border-radius: 50%;
}

.import-run-status.success {
  background: var(--green);
}

.import-run-status.error {
  background: var(--coral);
}

.import-csv-mapping {
  margin-top: 14px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #dfe4ed;
  border-radius: 10px;
}

.import-csv-mapping[hidden] {
  display: none;
}

.import-csv-mapping-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.import-csv-mapping-heading > div {
  display: grid;
  gap: 3px;
}

.import-csv-mapping-heading strong {
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.import-csv-mapping-heading small,
.import-csv-mapping-status {
  color: var(--ink-soft);
  font-size: 9px;
}

.import-csv-template-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto 30px;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
  padding: 9px;
  background: #eef3ff;
  border: 1px solid #d4def5;
  border-radius: 8px;
}

.import-csv-template-tools .field {
  margin: 0;
}

.import-csv-template-tools .secondary-button {
  height: 36px;
  white-space: nowrap;
}

.import-csv-template-tools .icon-button {
  align-self: end;
  width: 30px;
  height: 36px;
}

.import-csv-mapping-list {
  display: grid;
  gap: 6px;
  max-height: 390px;
  overflow-y: auto;
  padding-right: 3px;
}

.import-csv-mapping-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(190px, 0.8fr);
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  background: white;
  border: 1px solid #e5e8ef;
  border-radius: 8px;
}

.import-csv-source {
  display: grid;
  min-width: 0;
  gap: 2px;
}

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

.import-csv-source strong {
  font-size: 10px;
}

.import-csv-source small {
  color: var(--ink-soft);
  font-size: 9px;
}

.import-csv-arrow {
  color: var(--blue);
  text-align: center;
}

.import-csv-mapping-row select {
  min-width: 0;
  height: 34px;
  padding: 0 30px 0 10px;
  font-size: 10px;
}

.supplier-data-panel {
  margin: 4px 0 2px;
  padding: 11px 13px;
  background: #f8f9fc;
  border: 1px solid #e2e5ee;
  border-radius: 10px;
}

.supplier-data-panel summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.supplier-data-panel > p {
  margin: 8px 0 12px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.supplier-data-panel[open] summary {
  margin-bottom: 2px;
}

.import-format-note {
  margin-top: 14px;
  padding: 11px 13px;
  color: var(--ink-soft);
  background: #f7f5ef;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.5;
}

.import-result {
  display: grid;
  gap: 10px;
}

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

.import-result-stat {
  display: grid;
  gap: 2px;
  padding: 10px;
  background: #f6f7fb;
  border-radius: 8px;
}

.import-result-stat strong {
  font-size: 18px;
}

.import-result-stat small {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.import-result-errors {
  max-height: 250px;
  overflow: auto;
  margin: 0;
  padding: 10px 10px 10px 26px;
  color: #8b352b;
  background: #fff1ef;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.45;
}

.import-result-note {
  margin: 0;
  padding: 10px 12px;
  color: #66501c;
  background: #fff6d8;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .import-layout {
    grid-template-columns: 1fr;
  }

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

.settings-section {
  padding: 28px;
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.group-management form {
  margin: 0;
}

.address-book-admin-page .address-book-management {
  padding: 0;
}

.address-book-admin-page .dialog-header {
  margin-bottom: 18px;
}

.address-book-admin-page .dialog-header .icon-button {
  display: none;
}

.commission-admin-page .commission-management {
  padding: 0;
}

.commission-admin-page .dialog-header {
  margin-bottom: 18px;
}

.commission-admin-page .dialog-header .icon-button {
  display: none;
}

.address-book-management {
  padding: 28px;
}

.address-book-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(560px, 1.28fr);
  gap: 22px;
}

.address-book-dialog.quick-create .address-book-grid {
  grid-template-columns: minmax(0, 1fr);
}

.address-book-dialog.quick-create .address-book-grid > section {
  display: none;
}

.address-book-grid > section,
.address-book-grid > form {
  min-width: 0;
  padding: 18px;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.address-book-grid form h3 {
  margin: -7px 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 400;
}

.address-book-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 690px;
  overflow: auto;
}

.address-book-search-field {
  margin: 12px 0 12px;
}

.address-book-search-field input {
  background: #fff;
}

.address-book-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 13px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.address-book-filters .field {
  margin: 0;
}

.address-book-filters .secondary-button {
  grid-column: 1 / -1;
  justify-self: end;
}

.address-book-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
}

.address-book-row:hover,
.address-book-row.active {
  background: #f4f7ff;
  border-color: #b8c5ee;
}


/* Anagrafiche: sfondi opachi, prioritari rispetto alle righe generiche. */
.service-list-row.directory-contact-card,
.address-book-row {
  background: #ffffff;
}
.service-list-row.directory-contact-card:hover,
.address-book-row:hover {
  background: #fafbff;
}
.service-list-row.directory-contact-card.active,
.address-book-row.active {
  background: #f5f7ff;
  border-color: #5273dc;
}

.address-book-row-copy {
  min-width: 0;
}

.address-book-row-copy strong,
.address-book-row-copy small {
  display: block;
}

.address-book-row-copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-book-row-copy small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.customer-shield {
  width: 42px;
  height: 48px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  color: #fff;
  background: #a96f43;
  clip-path: polygon(50% 0, 92% 15%, 84% 73%, 50% 100%, 16% 73%, 8% 15%);
}

.customer-shield.silver {
  color: #29302f;
  background: linear-gradient(145deg, #f1f3f3, #aeb7ba);
}

.customer-shield.gold {
  color: #48350a;
  background: linear-gradient(145deg, #ffe596, #c69525);
}

.customer-shield > span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 800;
}

.customer-shield > strong {
  font-size: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.customer-shield.compact {
  width: 27px;
  height: 31px;
  flex: 0 0 auto;
}

.customer-shield.compact > span {
  font-size: 11px;
}

.customer-shield.compact > strong {
  display: none;
}

.address-book-type-grid,
.address-book-identity-grid,
.address-book-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

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

.address-book-entity-field {
  margin-bottom: 17px;
  padding: 12px;
  background: #eef2ff;
  border: 1px solid #d4dcf6;
  border-radius: 11px;
}

.address-book-entity-field select {
  background: white;
}

.address-book-type-grid .field,
.address-book-identity-grid .field,
.address-book-data-grid .field {
  margin: 0 0 13px;
}

.address-book-contacts-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 10px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.address-book-contacts-heading strong,
.address-book-contacts-heading span {
  display: block;
}

.address-book-contacts-heading strong {
  font-size: 11px;
}

.address-book-contacts-heading span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.address-book-contacts,
.address-book-addresses {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.address-book-contact,
.address-book-address {
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.address-book-contact-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.address-book-address .address-book-contact-heading {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.address-book-address-description {
  min-width: 0;
  height: 28px;
  padding: 0 4px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e2ded5;
  border-radius: 0;
  font: 600 .65rem var(--ui-field-font);
  outline: none;
}

.address-book-address-description:focus { border-bottom-color: #5f7ee5; }

.address-book-contact-heading strong {
  font-size: 10px;
}

.address-book-contact-heading .icon-button {
  width: 28px;
  height: 28px;
}

.address-book-legal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.address-book-legal-toggle input {
  margin: 0;
}

.address-book-contact-grid,
.address-book-address-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.address-book-contact-grid .field,
.address-book-address-grid .field {
  margin: 0;
}

.address-book-contact-grid .full,
.address-book-address-grid .full {
  grid-column: 1 / -1;
}

.structured-address-grid {
  grid-template-columns: minmax(180px, 1fr) 72px 84px minmax(130px, .7fr) 70px;
  gap: 10px 12px;
}

.address-line-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 7px;
  min-width: 0;
  min-height: 31px;
  padding: 0 2px;
  border-bottom: 1px solid #dcd8cf;
}

.address-line-field span {
  padding-bottom: 7px;
  color: #a1a6a3;
  font-size: .58rem;
  font-weight: 700;
  text-transform: none;
  white-space: nowrap;
}

.address-line-field input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font: 500 .72rem var(--ui-field-font);
  outline: none;
}

.address-line-field:focus-within { border-bottom-color: #4d6fe0; box-shadow: 0 1px 0 #4d6fe0; }
.structured-address-grid .address-street { grid-column: 1 / 5; }
.structured-address-grid .address-number { grid-column: 5; }
.structured-address-grid .address-postal { grid-column: 1; }
.structured-address-grid .address-city { grid-column: 2 / 5; }
.structured-address-grid .address-province { grid-column: 5; }
.structured-address-grid .address-country { grid-column: 1 / -1; }

@media (max-width: 720px) {
  .structured-address-grid { grid-template-columns: minmax(0, 1fr) 72px; }
  .structured-address-grid .address-street { grid-column: 1; }
  .structured-address-grid .address-number { grid-column: 2; }
  .structured-address-grid .address-postal { grid-column: 1; }
  .structured-address-grid .address-city { grid-column: 1 / -1; }
  .structured-address-grid .address-province { grid-column: 2; grid-row: 2; }
  .structured-address-grid .address-country { grid-column: 1 / -1; }
}

.address-book-contacts-empty {
  margin: 0;
  padding: 16px;
  color: var(--ink-soft);
  background: white;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 10px;
  text-align: center;
}

.address-book-form-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.commission-management {
  width: 100%;
  max-width: 100%;
  padding: 28px;
  overflow-x: hidden;
}

.commission-management-grid {
  display: grid;
  grid-template-columns: minmax(230px, 0.62fr) minmax(0, 1.38fr);
  gap: 22px;
}

.commission-management-grid > section,
.commission-management-grid > form {
  min-width: 0;
  padding: 18px;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.commission-management-grid form h3 {
  margin: -7px 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 400;
}

.commission-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 620px;
  overflow: auto;
}

.commission-list-empty {
  margin: 0;
  padding: 18px;
  color: var(--ink-soft);
  text-align: center;
  background: white;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 11px;
}

.commission-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
}

.commission-row-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.commission-row-chat {
  width: 38px;
  height: 38px;
  color: #355344;
  background: #e8f2ec;
  border-color: #c8ded2;
}

.commission-row-chat svg {
  width: 17px;
  height: 17px;
}

.commission-row:hover,
.commission-row.active {
  background: #fff9e9;
  border-color: #dfc98f;
}

.commission-row.is-complete {
  background: #f0f8f2;
  border-color: #bfd9c8;
}

.commission-row.is-complete:hover,
.commission-row.is-complete.active {
  background: #e7f3ea;
  border-color: #9fc8ad;
}

.commission-row.is-complete .commission-row-position {
  color: #2d6a49;
  background: #dcefe2;
}

.commission-row-position {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  color: #6d5318;
  background: #fff2cf;
  border-radius: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
}

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

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

.commission-row .client-name-highlight.compact > strong {
  font-size: 9px;
}

.commission-row small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.commission-add-panel,
.commission-new-task {
  margin: 14px 0;
  padding: 13px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.commission-add-panel > strong,
.commission-new-task summary,
.commission-sequence-heading strong {
  font-size: 11px;
  font-weight: 800;
}

.commission-existing-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 9px;
}

.commission-existing-row select {
  min-width: 0;
}

.commission-new-task summary {
  cursor: pointer;
}

.commission-new-task-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 13px;
}

.commission-new-task-grid .field {
  margin: 0;
}

.commission-new-task-grid .full {
  grid-column: 1 / -1;
}

.project-workflow-group-row,
.project-workflow-schedule-row {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.project-workflow-group-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  min-height: 89px;
}

.project-workflow-schedule-row {
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 0.75fr) minmax(0, 1.5fr);
}

.project-workflow-schedule-row .duration-input-mask {
  grid-template-columns: minmax(68px, 1fr) auto minmax(68px, 1fr) auto;
  gap: 3px;
  min-height: 34px;
  padding: 3px 4px;
}

.project-workflow-schedule-row .duration-input-part {
  grid-template-columns: 24px minmax(20px, 1fr) 24px;
}

.project-workflow-schedule-row .duration-input-part button {
  min-width: 24px;
  min-height: 26px;
  font-size: 16px;
}

.project-workflow-schedule-row .duration-input-mask input[type="number"] {
  min-height: 26px;
  padding-inline: 2px;
}

.project-workflow-group-row .field,
.project-workflow-schedule-row .field {
  min-width: 0;
}

.commission-new-task > .secondary-button {
  margin-top: 11px;
}

.commission-resource-check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.commission-resource-check .resource-availability-card {
  margin-top: 0;
}

.commission-resource-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.commission-resource-actions .resource-override-button {
  margin-top: 0;
}

.commission-resource-placeholder {
  display: block;
  padding: 9px 11px;
  color: var(--ink-soft);
  background: #f7f7f5;
  border: 1px dashed var(--line);
  border-radius: 9px;
  font-size: 11px;
}

.commission-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.75fr);
  gap: 9px;
}

.commission-details-grid .field {
  margin: 0;
}

.commission-calculated-end {
  justify-content: center;
  padding: 9px 11px;
  background: #f4f7ff;
  border: 1px solid #dce4ff;
  border-radius: 11px;
}

.commission-calculated-end strong {
  color: var(--blue-dark);
  font-size: 13px;
}

.commission-calculated-end.is-late {
  background: #fff2ee;
  border-color: #ffc7b8;
}

.commission-calculated-end.is-late strong {
  color: #b43a24;
}

#task-scheduled-date-field,
#crm-activity-scheduled-date-field {
  grid-column: 1 / -1;
  justify-self: start;
  width: min(100%, 342px);
}

.guided-date-calendar {
  overflow: hidden;
  width: 100%;
  background: #fbfcff;
  border: 1px solid #dce3f4;
  border-radius: 13px;
  box-shadow: 0 5px 16px rgba(41, 58, 112, 0.06);
}

.guided-date-calendar-head {
  display: grid;
  grid-template-columns: 27px 1fr 27px;
  align-items: center;
  gap: 5px;
  padding: 5px 6px;
  background: #f1f4fc;
  border-bottom: 1px solid #dce3f4;
}

.guided-date-calendar-head strong {
  color: var(--ink);
  font-size: 12px;
  text-align: center;
  text-transform: capitalize;
}

.guided-date-calendar-head button {
  display: grid;
  place-items: center;
  width: 27px;
  height: 25px;
  padding: 0;
  color: var(--blue-dark);
  background: #fff;
  border: 1px solid #d2daf0;
  border-radius: 7px;
  font-size: 18px;
  line-height: 1;
}

.guided-date-calendar-head button:disabled {
  color: #adb3c0;
  background: #f3f4f6;
}

.guided-date-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(28px, 1fr));
  gap: 3px;
  padding: 6px;
}

.guided-date-weekday {
  padding: 1px 0 2px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.guided-date-blank {
  min-height: 30px;
}

.guided-date-day {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  min-width: 0;
  min-height: 30px;
  padding: 2px;
  color: #26429b;
  background: #eef3ff;
  border: 1px solid #ccd8ff;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.guided-date-day:hover:not(:disabled) {
  background: #dfe8ff;
  border-color: #8ca5ff;
  transform: translateY(-1px);
}

.guided-date-day.is-holiday {
  color: #9a4d08;
  background: #fff2d9;
  border-color: #efc277;
}

.guided-date-day.is-unavailable {
  color: #a9adb6;
  background: #f2f2f1;
  border-color: #e4e3df;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
}

.guided-date-day.is-selected {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(49, 88, 255, 0.28);
}

.guided-date-day.is-selected.is-holiday {
  color: #4c2700;
  background: #ffc85b;
  border-color: #d99713;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(217, 151, 19, 0.3);
}

.guided-date-day.is-recommended::after {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 4px;
  height: 4px;
  background: #3158d4;
  border-radius: 50%;
  content: "";
}

.guided-date-day.is-selected.is-recommended::after {
  background: #fff;
}

.guided-date-day.is-holiday.is-recommended::after {
  background: #9a4d08;
}

.guided-date-calendar-legend {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  margin-top: 2px;
  padding: 5px 2px 0;
  border-top: 1px solid #e6e9f2;
  color: var(--ink-soft);
  font-size: 8px;
}

.guided-date-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.guided-date-calendar-legend i {
  width: 8px;
  height: 8px;
  background: #eef3ff;
  border: 1px solid #ccd8ff;
  border-radius: 3px;
}

.guided-date-calendar-legend i.holiday {
  background: #fff2d9;
  border-color: #efc277;
}

.guided-date-calendar-legend i.unavailable {
  background: #f2f2f1;
  border-color: #e4e3df;
}

.guided-date-calendar-message {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 105px;
  padding: 10px;
  color: var(--ink-soft);
  font-size: 11px;
  text-align: center;
}

.guided-date-calendar.is-loading {
  opacity: 0.75;
}

.commission-address-book-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 7px;
}

.commission-address-book-picker select {
  min-width: 0;
}

.opportunity-customer-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.opportunity-customer-picker > select,
.opportunity-customer-picker > .address-book-combobox {
  grid-column: 1;
  min-width: 0;
}

.opportunity-customer-picker .commission-address-book-add {
  grid-column: 2;
}

.opportunity-customer-picker .opportunity-customer-replace {
  grid-column: 3;
}

.opportunity-customer-picker .commission-address-book-add,
.opportunity-customer-picker .opportunity-customer-replace {
  box-sizing: border-box;
  height: 42px;
  min-height: 42px;
}

.opportunity-customer-picker .opportunity-customer-replace {
  padding: 0 13px;
  border-color: #b9c8f2;
  color: var(--blue-dark);
  white-space: nowrap;
}

.opportunity-customer-picker .opportunity-customer-replace.active {
  color: #8a4e21;
  background: #fff8ec;
  border-color: #e4c28f;
}

.address-book-combobox.disabled {
  opacity: .72;
}

.address-book-combobox.disabled .address-book-combobox-input,
.address-book-combobox.disabled .address-book-combobox-toggle {
  cursor: not-allowed;
}

.opportunity-customer-field > small {
  color: var(--ink-soft);
  line-height: 1.35;
}

@media (max-width: 760px) {
  .opportunity-customer-picker {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .opportunity-customer-picker .opportunity-customer-replace {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.address-book-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
}

.field select.address-book-native-select {
  width: 1px;
  min-height: 1px;
  padding: 0;
  border: 0;
}

.address-book-combobox {
  position: relative;
  min-width: 0;
}

.address-book-combobox input.address-book-combobox-input {
  width: 100%;
  padding-right: 48px;
  border-color: #b8c5ee;
}

.address-book-combobox-input:focus {
  box-shadow: 0 0 0 3px rgba(75, 105, 175, 0.14);
}

.address-book-combobox-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 36px;
  height: calc(100% - 2px);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
  cursor: pointer;
}

.address-book-combobox-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.address-book-combobox-list {
  position: absolute;
  z-index: 80;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  padding: 5px;
  background: #fff;
  border: 1px solid #b8c5ee;
  border-radius: 10px;
  box-shadow: 0 18px 34px rgba(30, 41, 59, 0.18);
}

.address-book-combobox-option {
  width: 100%;
  display: block;
  padding: 8px 9px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
}

.address-book-combobox-option:hover,
.address-book-combobox-option.active {
  background: #eef2ff;
}

.address-book-combobox-option strong,
.address-book-combobox-option small {
  display: block;
}

.address-book-combobox-option strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-book-combobox-option small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.35;
}

.address-book-combobox-empty {
  padding: 12px 8px;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: center;
}

.commission-address-book-add {
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.commission-address-book-add:hover {
  color: #fff;
  background: #264bd0;
  border-color: #264bd0;
}

.commission-date-note {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.5;
}

.commission-sequence-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.commission-sequence-heading strong,
.commission-sequence-heading span {
  display: block;
}

.commission-sequence-heading div span,
.commission-sequence-heading > span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.commission-sequence {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 72px;
  max-width: 100%;
  overflow-x: hidden;
}

.commission-sequence-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  position: relative;
  z-index: 1;
}

.commission-sequence-row.is-clickable {
  cursor: pointer;
}

.commission-sequence-row.is-clickable:hover,
.commission-sequence-row.is-clickable:focus-visible {
  background: #f8f7f3;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 88, 212, 0.09);
  outline: none;
}

.commission-sequence-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 850;
}

.commission-sequence-copy {
  min-width: 0;
}

.commission-sequence-copy strong,
.commission-sequence-copy small {
  display: block;
}

.commission-sequence-copy .commission-flow-summary,
.commission-flow-link {
  color: var(--blue);
  font-weight: 750;
}

.commission-sequence-copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-sequence-copy small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.commission-sequence-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.commission-sequence-actions .icon-button {
  width: 30px;
  height: 30px;
}

.commission-flow-canvas {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 4px;
}

.commission-flow-stages {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
  z-index: 1;
}

.commission-flow-stage {
  position: relative;
  min-width: 0;
}

.commission-flow-stage.drop-common-before,
.commission-flow-stage.drop-common-after {
  border-radius: 9px;
}

.commission-flow-stage.drop-common-before {
  box-shadow: inset 0 5px 0 var(--coral), 0 0 0 2px #ffe8e2;
}

.commission-flow-stage.drop-common-after {
  box-shadow: inset 0 -5px 0 var(--coral), 0 0 0 2px #ffe8e2;
}

.commission-flow-stage-label {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.commission-flow-canvas .commission-sequence-row {
  grid-template-columns: 24px minmax(72px, 1fr) auto;
  gap: 7px;
  min-height: 52px;
  padding: 6px 7px;
  cursor: grab;
  user-select: none;
}

.commission-flow-canvas .commission-sequence-row:active {
  cursor: grabbing;
}

.commission-flow-canvas .commission-sequence-row.is-editing {
  background: #f3f6ff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 88, 212, 0.12);
}

.commission-flow-canvas .commission-sequence-number {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 9px;
}

.commission-flow-canvas .commission-sequence-copy small {
  margin-top: 1px;
  font-size: 8px;
  line-height: 1.25;
}

.workflow-card-meta {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  margin-top: 2px;
  white-space: nowrap;
}

.workflow-card-group,
.workflow-card-duration {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-card-group {
  flex: 1 1 auto;
  color: var(--blue);
  background: rgba(53, 88, 212, 0.1);
}

.workflow-card-duration {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid rgba(198, 103, 19, 0.24);
  color: #7d3c00;
  background: #fff0d8;
  font-size: 9px;
  font-weight: 900;
}

.commission-flow-canvas .commission-sequence-actions {
  grid-column: auto;
  flex-wrap: nowrap;
  gap: 3px;
  margin-top: 0;
}

.commission-flow-canvas .commission-sequence-actions .icon-button {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 7px;
  font-size: 10px;
}

.commission-flow-connectors {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.commission-flow-connectors > path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.commission-flow-arrow-head {
  fill: var(--blue);
}

.commission-flow-drop-hint {
  position: sticky;
  top: 5px;
  z-index: 4;
  width: max-content;
  max-width: calc(100% - 10px);
  margin: 0 auto -25px;
  padding: 5px 9px;
  color: white;
  background: var(--blue-dark);
  border-radius: 999px;
  box-shadow: 0 5px 18px rgba(41, 72, 189, 0.24);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}

.commission-sequence-row.is-dragging {
  opacity: 0.32;
}

.commission-sequence-row.drop-parallel-left {
  box-shadow: 0 0 0 2px var(--blue-pale);
}

.commission-sequence-row.drop-parallel-right {
  box-shadow: 0 0 0 2px var(--blue-pale);
}

.commission-sequence-row.drop-sequence-before {
  box-shadow: 0 0 0 2px #ffe8e2;
}

.commission-sequence-row.drop-sequence-after {
  box-shadow: 0 0 0 2px #ffe8e2;
}

.workflow-drop-anchor {
  display: none;
  position: absolute;
  z-index: 50;
  pointer-events: none;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .82), 0 2px 7px rgba(40, 65, 135, .2);
}

.workflow-unit-card.commission-sequence-row.drop-parallel-left > .workflow-drop-anchor,
.workflow-unit-card.commission-sequence-row.drop-parallel-right > .workflow-drop-anchor,
.workflow-unit-card.commission-sequence-row.drop-sequence-before > .workflow-drop-anchor,
.workflow-unit-card.commission-sequence-row.drop-sequence-after > .workflow-drop-anchor {
  display: block;
}

.workflow-unit-card.commission-sequence-row.drop-parallel-left > .workflow-drop-anchor,
.workflow-unit-card.commission-sequence-row.drop-parallel-right > .workflow-drop-anchor {
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--blue);
}

.workflow-unit-card.commission-sequence-row.drop-parallel-left > .workflow-drop-anchor { left: 0; }
.workflow-unit-card.commission-sequence-row.drop-parallel-right > .workflow-drop-anchor { right: 0; }

.workflow-unit-card.commission-sequence-row.drop-sequence-before > .workflow-drop-anchor,
.workflow-unit-card.commission-sequence-row.drop-sequence-after > .workflow-drop-anchor {
  right: 0;
  left: 0;
  height: 5px;
  background: var(--coral);
}

.workflow-unit-card.commission-sequence-row.drop-sequence-before > .workflow-drop-anchor { top: 0; }
.workflow-unit-card.commission-sequence-row.drop-sequence-after > .workflow-drop-anchor { bottom: 0; }

.commission-form-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.user-management {
  padding: 28px;
}

.user-management-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 22px;
}

.user-management-grid > section,
.user-management-grid > form {
  min-width: 0;
  padding: 18px;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 14px;
}

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

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

.panel-heading strong {
  font-size: 13px;
}

.panel-heading span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 480px;
  overflow: auto;
}

.user-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 11px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
}

.user-row:hover,
.user-row.active {
  border-color: #b6c2f2;
  background: #f2f4ff;
}

.user-row-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
  border-radius: 10px;
  font-family: Georgia, "Times New Roman", serif;
}

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

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

.user-row-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.user-row-name-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-microsoft-badge {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  background: white;
  border-radius: 6px;
  overflow: hidden;
}

.user-microsoft-badge img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.user-row small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.user-status {
  width: 8px;
  height: 8px;
  background: #b9bfbc;
  border-radius: 50%;
}

.user-status.active {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(75, 154, 118, 0.12);
}

.user-management-grid form h3 {
  margin: -7px 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 400;
}

.data-field-management {
  padding: 28px;
}

.data-field-management .dialog-header {
  margin-bottom: 18px;
}

.data-field-management .dialog-header .dialog-note {
  max-width: 780px;
  margin-top: 7px;
}

.data-field-association-browser {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: #f5f7fc;
  border: 1px solid #dce2f1;
  border-radius: 14px;
}

.data-field-association-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.75fr);
  align-items: end;
  gap: 18px;
}

.data-field-association-heading h3 {
  margin: 2px 0 0;
}

.data-field-association-heading .dialog-note {
  margin: 5px 0 0;
}

.data-field-association-selector {
  margin: 0;
}

.data-field-association-list,
.data-field-association-rows {
  display: grid;
  gap: 8px;
}

.data-field-association-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.data-field-association-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.data-field-association-card-head strong,
.data-field-association-card-head small {
  display: block;
}

.data-field-association-card-head small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.data-field-association-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) 18px minmax(240px, 1.2fr);
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.data-field-association-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-field-association-row > span:nth-child(2) {
  color: var(--blue);
  text-align: center;
}

.data-field-association-row select {
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
  font-size: 10px;
}

@media (max-width: 820px) {
  .data-field-association-heading,
  .data-field-association-row {
    grid-template-columns: 1fr;
  }

  .data-field-association-row > span:nth-child(2) {
    display: none;
  }
}

.data-field-management-grid {
  grid-template-columns: minmax(360px, 1fr) minmax(390px, 0.9fr);
}

.data-field-list .user-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.data-field-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  color: #58635e;
  background: #f0eee8;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-field-badge.system {
  color: #3158aa;
  background: #eaf0ff;
}

.data-field-form-grid {
  grid-template-columns: minmax(0, 1fr) 110px;
}

.data-field-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 4px 0 14px;
}

.vat-rate-management-grid {
  grid-template-columns: minmax(320px, 0.9fr) minmax(320px, 0.7fr);
}

.vat-rate-list-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.vat-rate-list-item > span:first-child,
.vat-rate-list-item > span:first-child strong,
.vat-rate-list-item > span:first-child small {
  display: block;
}

.vat-rate-list-item > span:first-child small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.vat-rate-list-item.is-inactive {
  opacity: 0.62;
}

.vat-rate-list-item .status-pill {
  padding: 5px 8px;
  color: #6c746f;
  background: #f0eee8;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.vat-rate-list-item .status-pill.active {
  color: #21704b;
  background: #e4f4ea;
}

.payment-method-management-grid,
.payment-term-management-grid {
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 0.8fr);
}

.payment-method-list-item,
.payment-term-list-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.payment-method-list-item > span:first-child,
.payment-method-list-item > span:first-child strong,
.payment-method-list-item > span:first-child small,
.payment-term-list-item > span:first-child,
.payment-term-list-item > span:first-child strong,
.payment-term-list-item > span:first-child small {
  display: block;
}

.payment-method-list-item > span:first-child small,
.payment-term-list-item > span:first-child small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-method-list-item.is-inactive,
.payment-term-list-item.is-inactive {
  opacity: 0.62;
}

.payment-method-list-item .status-pill,
.payment-term-list-item .status-pill {
  padding: 5px 8px;
  color: #6c746f;
  background: #f0eee8;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-method-list-item .status-pill.active,
.payment-term-list-item .status-pill.active {
  color: #21704b;
  background: #e4f4ea;
}

.document-identifier-form {
  display: grid;
  gap: 16px;
  max-width: 900px;
  padding: 20px;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.document-identifier-type-field {
  max-width: 430px;
}

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

.document-identifier-year-toggle {
  justify-self: start;
}

.document-identifier-preview {
  display: grid;
  grid-template-columns: auto minmax(120px, auto) 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  color: #29415f;
  background: #edf3ff;
  border: 1px solid #cedaf3;
  border-radius: 10px;
}

.document-identifier-preview > span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.document-identifier-preview strong {
  color: var(--blue);
  font-size: 20px;
  letter-spacing: 0.05em;
}

.document-identifier-preview small {
  color: var(--ink-soft);
  font-size: 9px;
}

.document-code-badge,
.document-code-inline {
  display: inline-flex;
  align-items: center;
  color: #3158aa;
  background: #eaf0ff;
  border-radius: 5px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.document-code-badge {
  width: max-content;
  margin: 0 5px 3px 0;
  padding: 2px 6px;
}

.document-code-inline {
  margin-right: 5px;
  padding: 1px 4px;
}

@media (max-width: 720px) {
  .document-identifier-config-grid,
  .document-identifier-preview {
    grid-template-columns: 1fr;
  }
}

.user-groups-field {
  margin: 0 0 16px;
  padding: 13px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.user-groups-field legend {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.user-group-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.user-group-options label {
  position: relative;
  cursor: pointer;
}

.user-group-options input {
  position: absolute;
  opacity: 0;
}

.user-group-options span {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--ink-soft);
  background: #f4f2ec;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
}

.user-group-options input:checked + span {
  color: var(--blue);
  background: var(--blue-pale);
  border-color: #cbd4ff;
}

.user-project-roles-field {
  padding: 11px;
  background: #f8f9fd;
}

.user-project-role-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.user-project-role-options label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.user-project-role-options input {
  position: absolute;
  opacity: 0;
}

.user-project-role-options > label > span {
  min-height: 46px;
  display: grid;
  align-content: center;
  gap: 1px;
  padding: 6px 8px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-project-role-options strong { font-size: 9px; }
.user-project-role-options small { font-size: 7px; line-height: 1.25; }

.user-project-role-options input:checked + span {
  color: var(--blue);
  background: var(--blue-pale);
  border-color: #bfcaff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.user-project-role-summary {
  color: #526bad !important;
  font-size: 8px !important;
}

@media (max-width: 760px) {
  .user-project-role-options { grid-template-columns: minmax(0, 1fr); }
}

.active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.active-toggle input {
  position: absolute;
  opacity: 0;
}

.active-toggle span {
  position: relative;
  width: 38px;
  height: 22px;
  background: #c8ccc9;
  border-radius: 20px;
  transition: 160ms ease;
}

.active-toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(23, 33, 31, 0.2);
  transition: 160ms ease;
}

.active-toggle input:checked + span {
  background: var(--green);
}

.active-toggle input:checked + span::after {
  transform: translateX(16px);
}

.user-form-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.action-dialog {
  width: min(760px, calc(100% - 28px));
}

.action-management {
  display: grid;
  gap: 18px;
}

.action-dialog-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.action-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.action-list {
  display: grid;
  gap: 12px;
  max-height: min(62vh, 560px);
  overflow: auto;
  padding-right: 4px;
}

.action-empty {
  margin: 0;
  padding: 22px;
  color: var(--ink-soft);
  background: #f8f6f1;
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
}

.action-card {
  display: grid;
  gap: 11px;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid #f09a25;
  border-radius: 14px;
}

.action-card.priority-3 {
  border-left-color: #e23636;
}

.action-card.priority-1 {
  border-left-color: #4b9a76;
}

.action-card.is-completed {
  background: #f7fbf8;
  border-left-color: #4b9a76;
}

.action-card.is-canceled {
  background: #f8f6f2;
  border-left-color: #8b8173;
  opacity: 0.86;
}

.action-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.action-card-header strong {
  font-size: 15px;
}

.action-priority {
  padding: 4px 8px;
  color: #a05710;
  background: #fff1dc;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.priority-3 .action-priority {
  color: #9c2d2d;
  background: #ffe1e1;
}

.priority-1 .action-priority {
  color: #257150;
  background: #e6f4ed;
}

.action-status {
  padding: 4px 8px;
  color: #8a5d2c;
  background: #fff7e8;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.action-status.completed {
  color: #257150;
  background: #e6f4ed;
}

.action-status.canceled {
  color: #5f5b54;
  background: #ece7dd;
}

.action-card p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.action-meta span {
  padding: 4px 8px;
  color: var(--ink-soft);
  background: #f6f4ee;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
}

.action-history-comment {
  padding: 10px 12px;
  color: var(--ink-soft);
  background: #f6f4ee;
  border-radius: 10px;
  font-size: 12px;
}

.action-complete-comment textarea {
  min-height: 78px;
  resize: vertical;
}

.action-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.action-form-grid {
  display: grid;
  grid-template-columns: 170px minmax(220px, 1fr) 140px;
  gap: 12px;
}

.schedule-dialog {
  width: min(620px, calc(100% - 28px));
}

.schedule-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(170px, 0.7fr);
  gap: 12px;
  margin-top: 16px;
}

.schedule-resource-suggestions {
  margin-top: 10px;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: #f1f7f4;
  border: 1px solid #d8e9e1;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 750;
}

.schedule-resource-suggestions > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.schedule-resource-suggestions small {
  font-size: 9px;
  font-weight: 650;
}

.schedule-resource-suggestions div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.schedule-resource-suggestions button {
  padding: 5px 8px;
  color: #25604b;
  background: #fff;
  border: 1px solid #bcdacc;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}

.commission-automatic-schedule strong {
  display: block;
  margin-top: 7px;
  padding: 9px 11px;
  color: #25604b;
  background: #eaf5ef;
  border-radius: 9px;
  font-size: 11px;
}

.schedule-mode-grid,
.schedule-recurrence-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 0.45fr) minmax(130px, 0.45fr);
  gap: 12px;
  margin-top: 16px;
}

.schedule-form-grid .field {
  margin: 0 0 16px;
}

.manual-schedule-panel {
  margin: 4px 0 16px;
  padding: 12px;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.manual-schedule-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 0.8fr) auto;
  align-items: start;
  gap: 10px;
}

.manual-schedule-row .field {
  margin: 0;
}

.manual-schedule-row .field > span {
  min-height: 13px;
  display: flex;
  align-items: center;
}

.manual-schedule-row .field input {
  margin-top: 7px;
}

.manual-schedule-row .secondary-button {
  align-self: start;
  margin-top: 27px;
}

.manual-schedule-list,
.schedule-preview div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.manual-schedule-list > span,
.schedule-preview > span,
.schedule-preview small {
  color: var(--ink-soft);
  font-size: 10px;
}

.manual-schedule-chip,
.schedule-preview div span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: #3151b5;
  background: #eef2ff;
  border: 1px solid #cbd7ff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.manual-schedule-chip span {
  font-size: 13px;
  line-height: 1;
}

.schedule-preview {
  margin: -2px 0 18px;
  padding: 12px;
  background: #fff;
  border: 1px dashed #cbd7ff;
  border-radius: 12px;
}

.schedule-preview strong {
  display: block;
  color: #3151b5;
  font-size: 11px;
}

.action-request-context {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.action-request-context span,
.action-request-context small {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.action-request-context strong {
  font-size: 16px;
}

.password-dialog {
  width: min(520px, calc(100% - 28px));
}

.personal-settings-dialog {
  width: min(650px, calc(100% - 28px));
}

.personal-settings-shell {
  display: grid;
  gap: 14px;
}

.personal-settings-section {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 15px;
  background: #f8f7f3;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.personal-settings-heading > div,
.personal-settings-heading strong,
.personal-settings-heading span,
.personal-local-access-note strong,
.personal-local-access-note span {
  display: block;
}

.personal-settings-heading strong {
  font-size: 13px;
}

.personal-settings-heading span,
.personal-local-access-note span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.personal-name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.personal-settings-actions,
.personal-microsoft-connection {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.personal-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.personal-settings-heading > small { color: var(--ink-soft); font-size: 10px; text-align: right; }
.personal-signature-upload { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.personal-signature-upload input[type="file"] { box-sizing: border-box; width: 100%; min-width: 0; min-height: 35px; height: 35px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 11px; }
@media (max-width: 620px) {
  .personal-signature-upload { grid-template-columns: 1fr 1fr; }
  .personal-signature-upload input[type="file"] { grid-column: 1 / -1; }
}

.personal-microsoft-identity {
  min-width: 0;
  margin-right: auto;
}

.personal-microsoft-identity strong,
.personal-microsoft-identity span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-microsoft-identity span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.personal-local-access-note {
  margin: 0;
  padding: 10px 12px;
  color: #28584c;
  background: #edf7f1;
  border: 1px solid #cde6d7;
  border-radius: 10px;
  font-size: 10px;
}

.password-notice {
  margin-bottom: 17px;
  padding: 12px 14px;
  color: #7d5b10;
  background: #fff3cf;
  border: 1px solid #f0d68a;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.5;
}

.password-footer {
  grid-template-columns: 1fr auto auto;
}

.password-footer > span:first-child {
  display: none;
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px;
}

.login-shell {
  width: min(1100px, 100%);
  min-height: 650px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 28px 90px rgba(23, 33, 31, 0.13);
  margin: auto 0;
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.19), transparent 18rem),
    var(--blue);
  color: white;
}

.login-brand .brand {
  color: white;
}

.login-brand .brand-copy small {
  color: rgba(255, 255, 255, 0.72);
}

.login-corporate-logo {
  position: absolute;
  z-index: 2;
  top: 52px;
  right: max(48px, calc((100vw - 1100px) / 2 + 32px));
  width: 170px;
  height: auto;
}

.login-brand .eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.login-brand h1 {
  max-width: 620px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(45px, 5vw, 68px);
  font-weight: 400;
  letter-spacing: -0.052em;
  line-height: 0.98;
}

.login-brand h1 em {
  color: #dbe1ff;
  font-weight: 400;
}

.login-brand p:not(.eyebrow) {
  max-width: 500px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.6;
}

.login-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-feature-list span {
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 55px;
}

.login-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 400;
}

.login-intro {
  margin: 10px 0 28px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.login-submit {
  width: 100%;
  margin-top: 8px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--ink-soft);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.microsoft-login-button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.microsoft-login-button:hover {
  border-color: #7f8ca8;
  box-shadow: 0 5px 16px rgba(32, 54, 92, .08);
}

.microsoft-login-button svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 620px) {
  .personal-name-grid {
    grid-template-columns: 1fr;
  }
  .personal-microsoft-connection {
    align-items: stretch;
    flex-direction: column;
  }
}

.login-error {
  margin: 0 0 10px;
  padding: 10px 12px;
  color: #a43e30;
  background: #fff0ed;
  border: 1px solid #f1c3bb;
  border-radius: 8px;
  font-size: 10px;
}

.login-panel > small {
  margin-top: 18px;
  color: #8b918e;
  font-size: 9px;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 1000;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: max-content;
  min-width: min(290px, calc(100vw - 32px));
  max-width: min(520px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 12px 16px 12px 13px;
  color: #26375e;
  background: linear-gradient(180deg, #f7f9ff 0%, #e9efff 100%);
  border: 1px solid #aebce7;
  border-radius: 13px;
  box-shadow: 0 18px 44px rgba(36, 58, 119, .24), inset 0 1px 0 rgba(255,255,255,.9);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 10px)) scale(.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast::before {
  content: "i";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, #5877e7 0%, #3154c7 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 5px rgba(44,74,172,.25);
  font-family: Georgia, serif;
  font-size: .84rem;
  font-weight: 800;
}

.toast.in-dialog {
  z-index: 1000;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.toast.error {
  color: #7f2c25;
  background: linear-gradient(180deg, #fff9f7 0%, #ffe9e4 100%);
  border-color: #e3a398;
  box-shadow: 0 18px 44px rgba(135, 47, 36, .22), inset 0 1px 0 rgba(255,255,255,.9);
}

.toast.error::before {
  content: "!";
  background: linear-gradient(180deg, #df6756 0%, #ad3829 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 5px rgba(151,48,35,.24);
  font-family: inherit;
}

.toast.warning {
  color: #76500d;
  background: linear-gradient(180deg, #fffdf6 0%, #fff1c9 100%);
  border-color: #dfbd69;
  box-shadow: 0 18px 44px rgba(123, 87, 18, .2), inset 0 1px 0 rgba(255,255,255,.92);
}

.toast.warning::before {
  content: "!";
  color: #5d3b00;
  background: linear-gradient(180deg, #ffd96f 0%, #e6a82e 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 2px 5px rgba(153,103,14,.22);
  font-family: inherit;
}

.system-busy {
  position: fixed;
  z-index: 1100;
  top: 18px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: min(420px, calc(100vw - 32px));
  min-height: 40px;
  box-sizing: border-box;
  padding: 9px 14px;
  color: #294ba9;
  background: rgba(247, 249, 255, .97);
  border: 1px solid #b5c2e8;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(36, 58, 119, .2);
  font-size: 12px;
  font-weight: 750;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.system-busy[hidden] { display: none; }

.system-busy.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.system-busy.in-dialog { z-index: 1100; }

.system-busy-hourglass {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: center;
  animation: system-busy-turn 1.25s ease-in-out infinite;
}

.is-request-busy::after {
  content: "";
  width: 10px;
  height: 14px;
  flex: 0 0 auto;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 66% 44%, 66% 56%, 100% 100%, 0 100%, 34% 56%, 34% 44%);
  animation: system-busy-turn 1.25s ease-in-out infinite;
}

@keyframes system-busy-turn {
  0%, 38% { transform: rotate(0deg); }
  62%, 100% { transform: rotate(180deg); }
}

@media (max-width: 680px) {
  .system-busy { top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .system-busy-hourglass,
  .is-request-busy::after { animation: none; }
}

.prisma-confirm-dialog {
  width: min(460px, calc(100vw - 32px));
  max-width: 460px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: var(--text);
  background: transparent;
  box-shadow: 0 24px 70px rgba(27, 36, 62, .3);
}

.prisma-confirm-dialog::backdrop {
  background: rgba(24, 31, 48, .38);
  backdrop-filter: blur(2px);
}

.prisma-confirm-shell {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px 12px;
  padding: 16px;
  border: 1px solid #d8dfef;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #f7f9ff 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.prisma-confirm-symbol {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #5d3b00;
  background: linear-gradient(180deg, #ffdc79 0%, #e7ac32 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 3px 7px rgba(145,96,13,.22);
  font-size: 1rem;
  font-weight: 900;
}

.prisma-confirm-copy { min-width: 0; }
.prisma-confirm-copy h2 { margin: 0 0 4px; font-size: 1rem; }
.prisma-confirm-copy p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.prisma-prompt-field { display: grid; gap: 5px; margin-top: 12px; }
.prisma-prompt-field[hidden] { display: none; }
.prisma-prompt-field span { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.prisma-prompt-field input { width: 100%; min-height: 38px; border: 1px solid var(--border); border-radius: 11px; padding: 0 12px; background: var(--surface); color: var(--text); font: inherit; box-shadow: inset 0 1px 2px rgba(35, 42, 59, .04); }
.prisma-prompt-field input:focus { border-color: var(--primary); outline: 2px solid color-mix(in srgb, var(--primary) 18%, transparent); }
.prisma-confirm-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 7px; padding-top: 5px; }
.prisma-confirm-actions button { min-height: 35px; height: 35px; padding: 0 14px; }
.prisma-confirm-dialog.danger .prisma-confirm-symbol { color: #fff; background: linear-gradient(180deg, #df6a59 0%, #af392a 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 3px 7px rgba(145,45,32,.23); }
.prisma-confirm-dialog.danger #prisma-confirm-accept { border-color: #a83b2e; background: linear-gradient(180deg, #ce5949 0%, #a63a2d 100%); color: #fff; }

@media (max-width: 1350px) {
  .topbar {
    gap: 10px 14px;
  }

  .topbar-corporate-logo {
    display: none;
  }

  .topbar-actions .admin-only,
  .topbar-actions .commission-create-only {
    width: 42px;
    padding: 0;
    font-size: 0;
  }
}

@media (max-width: 1050px) {
  .app-shell {
    padding-left: 104px;
  }

  .module-sidebar {
    width: 74px;
  }

  .module-sidebar .sidebar-label,
  .module-sidebar .module-label,
  .module-sidebar .module-subnav,
  .module-sidebar [data-action="pin-sidebar"] {
    display: none;
  }

  .module-sidebar .sidebar-header,
  .module-sidebar .module-nav-item {
    justify-content: center;
  }

  .module-sidebar .sidebar-header {
    flex-direction: column;
    gap: 6px;
  }

  .module-sidebar .module-nav-item {
    padding: 0;
  }

  .business-summary-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .business-layout,
  .business-detail-grid,
  .opportunity-workspace,
  .opportunity-linked-grid,
  .opportunity-detail-actions {
    grid-template-columns: 1fr;
  }

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

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

  .intro {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .active-work-card {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    max-width: 760px;
  }

  .task-card {
    grid-template-columns: minmax(220px, 1fr) 125px 50px auto;
  }

  .filters-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .template-tools {
    grid-template-columns: 1fr 1fr auto auto;
  }

  .template-heading {
    grid-column: 1 / -1;
  }

  .template-tools label:last-of-type {
    grid-column: 1 / 4;
  }

  .account-copy {
    display: none;
  }

  .active-timer-button {
    min-width: 42px;
    width: 42px;
    padding: 0;
  }

  .active-timer-copy {
    display: none;
  }

  .account-button {
    width: 42px;
    padding: 5px;
  }

  .topbar-actions .admin-only,
  .topbar-actions .commission-create-only {
    width: 42px;
    padding: 0;
    font-size: 0;
  }

  .user-management-grid {
    grid-template-columns: 1fr;
  }

  .commission-management-grid {
    grid-template-columns: 1fr;
  }

  .address-book-grid {
    grid-template-columns: 1fr;
  }

  .commission-board {
    grid-template-columns: 1fr;
  }

  .opportunity-board-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

@container (max-width: 760px) {
  .solution-ai-layout { grid-template-columns: minmax(0, 1fr); }
  .solution-catalog-search { grid-template-columns: minmax(0, 1fr) 58px; }
  .solution-catalog-actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
  .solution-selected-item { grid-template-columns: 105px minmax(0, 1fr) 100px; }
  .solution-selected-item small { grid-column: 2 / -1; }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0 12px 35px 88px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .home-hero h1 {
    font-size: 42px;
  }

  .module-launch-grid {
    grid-template-columns: 1fr;
  }

  .module-launch-card {
    min-height: 190px;
    padding: 18px;
  }

  .module-launch-copy strong {
    font-size: 28px;
  }

  .app-shell.sidebar-collapsed {
    padding-left: 88px;
  }

  .module-sidebar,
  .module-sidebar.is-collapsed {
    width: 68px;
    padding: 14px 9px;
  }

  .sidebar-logo {
    width: 32px;
    height: 32px;
  }

  .sidebar-controls {
    justify-content: center;
  }

  .sidebar-icon-button {
    width: 30px;
    height: 30px;
  }

  .module-heading {
    min-height: 98px;
    align-items: flex-start;
    flex-direction: column;
    padding: 26px 0 18px;
  }

  .module-heading h1 {
    font-size: 38px;
  }

  .module-heading-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .business-summary-grid,
  .placeholder-grid {
    grid-template-columns: 1fr;
  }

  .business-list-panel,
  .business-form {
    padding: 14px;
  }

  .task-dialog.opportunity-management-dialog {
    width: calc(100vw - 16px);
  }

  .opportunity-management-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(190px, 0.42fr) minmax(0, 1fr);
    height: 100%;
    min-height: 0;
  }

  .crm-entity-management-layout.is-list-collapsed {
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .opportunity-management-sidebar {
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .crm-entity-management-layout.is-list-collapsed .opportunity-management-sidebar {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .crm-entity-board-toolbar {
    align-items: flex-start;
  }

  .crm-entity-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .crm-entity-dialog-form .business-form-actions {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .business-dialog .crm-entity-dialog-form {
    --dialog-content-padding: 14px;
    padding: 14px;
  }

  .business-dialog .crm-opportunity-dialog-form {
    --dialog-content-padding: 14px;
    padding: 14px 14px 0;
  }

  .crm-opportunity-dialog-form .business-form-actions {
    grid-template-columns: 1fr auto;
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .opportunity-management-linked-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .opportunity-management-linked-head > div:last-child {
    width: 100%;
  }

  .opportunity-management-linked-head button {
    flex: 1;
  }

  .opportunity-management-linked-grid {
    grid-template-columns: 1fr;
  }

  .crm-lineage-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .crm-lineage-head span {
    text-align: left;
  }

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

  .business-row-meta {
    align-items: flex-start;
  }

  .opportunity-filters,
  .opportunity-detail-metrics,
  .opportunity-detail-fields,
  .crm-event-detail-grid {
    grid-template-columns: 1fr;
  }

  .opportunity-board-toolbar .opportunity-filters {
    grid-template-columns: 1fr;
  }

  .opportunity-filter-actions {
    justify-content: space-between;
  }

  .opportunity-view-area.is-split {
    grid-template-columns: 1fr;
  }

  .opportunity-view-area.is-split.is-list-collapsed {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .opportunity-view-area.is-split .opportunity-board {
    max-height: 330px;
  }

  .opportunity-board-header,
  .opportunity-board-card .commission-board-header {
    flex-direction: column;
  }

  .opportunity-board-card .commission-board-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .opportunity-board-value {
    grid-template-columns: 1fr 1fr;
  }

  .opportunity-board-value > span:first-child {
    grid-column: 1 / -1;
  }

  .opportunity-detail-head {
    flex-direction: column;
  }

  .business-form-actions,
  .conversion-card,
  .commission-resource-check,
  .quote-builder-row {
    grid-template-columns: 1fr;
  }

  .quote-builder-row .secondary-button {
    width: 100%;
  }

  .manual-quote-item-grid {
    grid-template-columns: 1fr;
  }

  .product-summary-dialog {
    width: calc(100vw - 18px);
    height: calc(100dvh - 18px);
    max-height: calc(100dvh - 18px);
  }

  .product-summary-content {
    padding: 14px;
  }

  .product-summary-identity,
  .product-price-charts {
    grid-template-columns: 1fr;
  }

  .product-summary-identity > .full {
    grid-column: auto;
  }

  .manual-quote-item-grid .full {
    grid-column: auto;
  }

  .quote-selected-item {
    grid-template-columns: 1fr 1fr;
  }

  .quote-selected-label,
  .quote-selected-description {
    grid-column: 1 / -1;
  }

  .topbar {
    gap: 10px;
  }

  .topbar-corporate-logo {
    display: none;
  }

  .topbar .brand {
    gap: 6px;
  }

  .topbar .brand-logo {
    width: 28px;
    height: 28px;
  }

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

  .topbar .brand-copy small {
    margin-top: 3px;
    font-size: 6px;
    letter-spacing: 0;
  }

  .topbar .environment-badge {
    display: none;
  }

  .view-switcher {
    position: fixed;
    z-index: 10;
    right: 16px;
    bottom: 16px;
    left: 16px;
    justify-content: center;
    padding: 6px;
    background: rgba(255, 253, 248, 0.94);
    box-shadow: 0 15px 40px rgba(23, 33, 31, 0.18);
    backdrop-filter: blur(10px);
  }

  .view-button {
    flex: 1;
    justify-content: center;
  }

  .primary-button.compact {
    padding: 0 13px;
  }

  .primary-button.compact svg {
    margin: 0;
  }

  .topbar-actions .secondary-button {
    width: 42px;
    padding: 0;
    font-size: 0;
  }

  .topbar-actions {
    gap: 5px;
  }

  .topbar-actions > .icon-button {
    display: none;
  }

  .intro {
    min-height: 0;
    padding: 42px 0 38px;
  }

  .intro h1 {
    font-size: 56px;
    transform: scaleX(1.04);
  }

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

  .summary-card:first-child {
    grid-column: 1 / -1;
  }

  .active-work-panel {
    padding: 14px;
    border-radius: 20px;
  }

  .active-work-title-row h2 {
    font-size: 27px;
  }

  .active-work-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .active-work-actions button,
  .active-work-open {
    width: 100%;
    margin-left: 0;
  }

  .workspace {
    padding: 20px 15px;
    border-radius: 18px;
  }

  .section-heading {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 14px;
  }

  .section-actions {
    width: 100%;
    justify-self: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .commission-board-meta {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .search-box {
    min-width: 0;
    flex: 1;
  }

  .completed-toggle {
    order: 3;
  }

  .gantt-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .filters-panel {
    grid-template-columns: 1fr;
  }

  .template-tools {
    grid-template-columns: 1fr auto auto;
  }

  .template-tools label {
    grid-column: 1 / -1;
  }

  .template-tools label:last-of-type {
    grid-column: 1 / -1;
  }

  .template-tools .primary-button {
    grid-column: 1 / -1;
  }

  .priority-legend {
    display: none;
  }

  .task-card {
    grid-template-columns: minmax(0, 1fr) 50px auto;
    gap: 12px;
    padding: 15px 12px 15px 16px;
  }

  .task-card.has-no-deadline {
    grid-template-columns: minmax(0, 1fr) 50px auto;
  }

  .task-card .metric,
  .task-card .due-block {
    display: none;
  }

  .edit-button {
    width: 34px;
    padding: 0;
  }

  .edit-button span {
    display: none;
  }

  .task-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .task-schedule-inline {
    grid-column: 1 / -1;
    flex-direction: column;
  }

  .task-schedule-inline > span {
    padding-top: 0;
  }

  .dashboard-claim-button {
    max-width: 78px;
    min-height: 28px;
    padding: 3px 6px;
    white-space: normal;
  }

  .dashboard-assignment-controls {
    grid-template-columns: 1fr;
    padding-left: 0;
  }

  .dashboard-assignment-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-assignment-actions button {
    width: 100%;
  }

  .score-grid,
  .form-grid,
  .schedule-form-grid,
  .schedule-mode-grid,
  .schedule-recurrence-grid,
  .manual-schedule-row {
    grid-template-columns: 1fr;
  }

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

  .task-assignment-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .task-assignment-actions button {
    width: 100%;
  }

  .task-schedule-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-section,
  .user-management,
  .group-management {
    padding: 20px;
  }

  .commission-management {
    padding: 20px;
  }

  .address-book-management {
    padding: 20px;
  }

  .commission-new-task-grid {
    grid-template-columns: 1fr;
  }

  .project-workflow-group-row,
  .project-workflow-schedule-row {
    grid-template-columns: 1fr;
  }

  .project-workflow-group-row {
    min-height: 0;
  }

  .commission-details-grid,
  .address-book-type-grid,
  .address-book-identity-grid,
  .address-book-data-grid,
  .address-book-filters,
  .address-book-address-grid,
  .address-book-contact-grid {
    grid-template-columns: 1fr;
  }

  .address-book-contact-grid .full {
    grid-column: auto;
  }

  .address-book-address-grid.structured-address-grid {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .structured-address-grid .address-street { grid-column: 1; }
  .structured-address-grid .address-number { grid-column: 2; }
  .structured-address-grid .address-postal { grid-column: 1; }
  .structured-address-grid .address-city { grid-column: 1 / -1; }
  .structured-address-grid .address-province { grid-column: 2; grid-row: 2; }
  .structured-address-grid .address-country { grid-column: 1 / -1; }

  .address-book-filters .secondary-button {
    justify-self: stretch;
  }

  .commission-new-task-grid .full {
    grid-column: auto;
  }

  .commission-existing-row,
  .commission-form-actions,
  .address-book-form-actions {
    grid-template-columns: 1fr;
  }

  .commission-form-actions > span,
  .address-book-form-actions > span {
    display: none;
  }

  .user-management-grid > section,
  .user-management-grid > form,
  .address-book-grid > section,
  .address-book-grid > form,
  .commission-management-grid > section,
  .commission-management-grid > form {
    padding: 14px;
  }

  .login-page {
    padding: 16px;
  }

  .login-corporate-logo {
    top: 24px;
    right: 24px;
    width: 120px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
  }

  .login-shell {
    min-height: calc(100vh - 32px);
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 290px;
    padding: 28px;
  }

  .login-brand h1 {
    font-size: 39px;
  }

  .login-feature-list {
    display: none;
  }

  .login-panel {
    padding: 32px 26px;
  }

  .task-dialog form {
    --dialog-content-padding: 21px;
    padding: 21px;
  }

  .business-dialog > form.crm-dialog-form {
    --dialog-content-padding: 21px;
    padding: 21px 21px 0;
  }

  .commission-chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(300px, 1fr) auto;
    padding: 18px;
  }

  .commission-chat-participants {
    grid-row: auto;
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #commission-chat-users {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .commission-chat-layout > form {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .commission-chat-message {
    width: 90%;
  }

  .task-assignment-actions {
    flex-wrap: wrap;
  }

  .dialog-footer {
    grid-template-columns: 1fr 1fr;
  }

  .dialog-footer > span {
    display: none;
  }

  .danger-button {
    grid-column: 1 / -1;
  }

  body {
    padding-bottom: 72px;
  }
}

.quote-supply-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid #d9dee9;
  border-radius: 10px;
  background: #f8f9fc;
}

.quote-supply-mode-bar > span {
  color: #5f6874;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.quote-supply-mode-buttons {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: #e7eaf1;
}

.quote-supply-mode-buttons button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  color: #5d6571;
  background: transparent;
  font-weight: 750;
  cursor: pointer;
}

.quote-supply-mode-buttons button.active {
  color: #fff;
  background: #3158d5;
  box-shadow: 0 2px 7px rgba(49, 88, 213, .25);
}

.quote-supply-mode-buttons button[data-mode="rental"].active {
  background: #087c65;
  box-shadow: 0 2px 7px rgba(8, 124, 101, .25);
}

.quote-rental-panel {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}

.quote-rental-heading,
.quote-rental-heading > div {
  display: flex;
  align-items: center;
}

.quote-rental-heading {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.quote-rental-heading > div { gap: 8px; }
.quote-rental-heading small { color: #6d7580; }
.quote-rental-heading button.active { color: #fff; background: #087c65; border-color: #087c65; }

.quote-rental-parameter-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(95px, 1fr));
  gap: 6px;
}

.quote-rental-parameter-grid .field { gap: 4px; }
.quote-rental-parameter-grid input,
.quote-rental-parameter-grid select { min-height: 36px; height: 36px; padding-block: 4px; }
.quote-rental-parameter-grid input:disabled,
.quote-rental-parameter-grid select:disabled { opacity: .82; color: var(--ink); background: #f7f5ef; }

.quote-rental-calculated {
  display: grid;
  grid-template-columns: repeat(9, minmax(88px, 1fr));
  gap: 5px;
  margin-top: 6px;
}

.quote-rental-calculated > span {
  display: grid;
  align-content: center;
  min-height: 42px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.quote-rental-calculated small { color: #65717c; font-size: 9px; line-height: 1.1; }
.quote-rental-calculated strong { margin-top: 3px; font-size: 12px; white-space: nowrap; }
.quote-rental-calculated .quote-rental-primary { border-color: #75baa9; background: #e4f5ef; }
.quote-rental-calculated .quote-rental-primary strong { color: #087c65; font-size: 14px; }
.quote-rental-payments { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.quote-ai-product-select { appearance: none; width: 100%; min-width: 0; height: 35px; margin: 6px 0; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233a54bf' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; color: var(--ink); font: inherit; }
.quote-ai-product-select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.quote-commission-preparation .quote-commission-plan-row .quote-work-intervention-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: auto; min-width: 0; height: 28px; min-height: 28px; max-height: 28px; padding: 0 10px; margin: 0; font-size: 11px; line-height: 1; white-space: nowrap; }
.quote-rental-payments input, .quote-rental-payments select { height: 35px; min-height: 35px; }
@media (max-width: 640px) { .quote-rental-payments { grid-template-columns: 1fr; } }
.quote-rental-payback.good strong { color: #128048; }
.quote-rental-payback.warning strong { color: #c87500; }
.quote-rental-payback.danger strong { color: #c13b34; }

.quote-rental-line-value { display: flex; align-items: baseline; justify-content: flex-end; gap: 2px; }
.quote-rental-line-value small,
.quote-offer-columns > strong > small { color: #66707b; font-size: 8px; }

.quote-supply-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 6px;
  padding: 2px 7px;
  border: 1px solid #cbd3df;
  border-radius: 999px;
  color: #495461;
  background: #f2f4f8;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}
.quote-supply-badge.rental { color: #08715d; border-color: #9ccfc0; background: #e6f5f0; }
.quote-supply-badge.mixed { color: #925b00; border-color: #ebc77b; background: #fff5dd; }

.quote-split-card {
  position: relative;
  width: 100%;
  min-width: 0;
}

.quote-split-card .opportunity-split-row {
  padding-right: 43px;
}

.quote-split-card > .quote-clone-button {
  position: absolute;
  right: 8px;
  bottom: 8px;
}

.quote-clone-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: #55616d;
  background: white;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(23, 33, 31, .06);
}

.quote-clone-button:hover,
.quote-clone-button:focus-visible {
  color: var(--blue);
  border-color: #aebcf1;
  background: var(--blue-pale);
  outline: 0;
}

.quote-clone-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rental-list-summary {
  display: grid;
  grid-template-columns: minmax(96px, 1.15fr) minmax(54px, .55fr) minmax(96px, 1fr);
  gap: 5px;
  width: 100%;
  margin: 6px 0 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.rental-list-summary > span {
  display: grid;
  min-width: 0;
  padding: 3px 7px;
  border-right: 1px solid #d1e5df;
}

.rental-list-summary > span:last-child { border-right: 0; }
.rental-list-summary strong { color: #08715d; font-size: 12px; line-height: 1.1; white-space: nowrap; }
.rental-list-summary strong small { display: inline; color: inherit; font-size: 9px; }
.rental-list-summary > span > small { margin-top: 2px; color: #68746f; font-size: 8px; font-weight: 750; text-transform: uppercase; }

.rental-list-summary.compact {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 5px;
  width: auto;
  margin-top: 4px;
  margin-bottom: 0;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 9px;
  line-height: 1.2;
}

.rental-list-summary.compact > span { display: inline; padding: 0; border: 0; }
.rental-list-summary.compact strong { color: #08715d; font-size: 9px; white-space: nowrap; }
.rental-list-summary.compact i { color: #a1aaa6; font-style: normal; }

.rental-default-settings-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid #dce2eb;
  border-radius: 12px;
  background: #f7f9fc;
}

.rental-assistance-management-grid { margin-top: 0; }

@media (max-width: 1200px) {
  .quote-rental-parameter-grid { grid-template-columns: repeat(4, minmax(110px, 1fr)); }
  .quote-rental-calculated { grid-template-columns: repeat(5, minmax(100px, 1fr)); }
  .rental-default-settings-form { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}

@media (max-width: 760px) {
  .quote-supply-mode-bar,
  .quote-rental-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-supply-mode-buttons,
  .quote-rental-heading > button {
    width: 100%;
  }

  .quote-rental-parameter-grid,
  .quote-rental-calculated {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-rental-calculated .quote-rental-primary {
    grid-column: 1 / -1;
  }

  .rental-default-settings-form {
    grid-template-columns: 1fr;
  }
}
/* Distinta tecnica Solution Architect: nessun dato economico interno. */
.solution-catalog-search {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 66px auto;
  gap: 7px;
  align-items: end;
  margin-bottom: 7px;
}

.solution-catalog-search label > span,
.solution-compact-number > span {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.solution-catalog-search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  padding: 0 10px;
}

.solution-catalog-search-field { position: relative; min-width: 0; }
.solution-catalog-results {
  position: absolute;
  z-index: 35;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow: auto;
  padding: 5px;
  border: 1px solid #cbd6ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(30, 49, 86, .18);
}

.solution-catalog-header,
.solution-catalog-result {
  display: grid;
  grid-template-columns: minmax(110px, .8fr) minmax(240px, 2.2fr) minmax(110px, .9fr) minmax(130px, 1fr);
  gap: 10px;
  align-items: center;
}

.solution-catalog-header {
  position: sticky;
  z-index: 1;
  top: -5px;
  padding: 8px 10px;
  color: var(--muted);
  background: #f3f5f9;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.solution-catalog-result {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid #eceef3;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.solution-catalog-result:hover,
.solution-catalog-result.selected { background: #eef3ff; }
.solution-catalog-result > span,
.solution-catalog-result > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.solution-catalog-header > :nth-child(3),
.solution-catalog-result > :nth-child(3) { text-align: right; }

.solution-catalog-actions { display: flex; gap: 5px; }
.solution-catalog-actions button { height: 36px; padding-inline: 10px; }

.solution-selected-item {
  display: grid;
  grid-template-columns: 120px minmax(220px, 1fr) 110px 130px;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  margin-bottom: 7px;
  padding: 5px 9px;
  border: 1px solid #cbd9f3;
  border-radius: 9px;
  background: #f4f7ff;
}
.solution-selected-item b { text-align: right; }

.solution-material-builder {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.solution-material-header,
.solution-material-row-edit {
  display: grid;
  grid-template-columns: minmax(130px, .8fr) minmax(260px, 2.2fr) 112px 76px 112px 32px;
  column-gap: 10px;
  align-items: center;
}
.solution-material-header {
  min-height: 29px;
  padding: 4px 8px;
  background: #eeeae2;
  color: #31405d;
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
}
.solution-material-header > :nth-child(n+3):not(:last-child) { text-align: right; }
.solution-material-row-edit {
  position: relative;
  box-sizing: border-box;
  width: calc(100% - 16px);
  min-height: 46px;
  margin: 5px 8px;
  padding: 5px 10px;
  background: #fff;
  border: 1px solid #e4e8ef;
  border-radius: 8px;
}
.solution-material-row-edit.bundle-parent { border-left: 3px solid #3159ca; }
.solution-material-row-edit.bundle-component {
  width: calc(100% - 32px);
  min-height: 39px;
  margin-right: 8px;
  margin-left: 24px;
  padding-left: 10px;
  background: #fafbfe;
}
.solution-material-row-edit.bundle-component::before {
  content: '';
  position: absolute;
  left: -9px;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: #8ba3dd;
}
.solution-material-row-edit.selected {
  background: #edf2ff;
  border-color: #6e89db;
  border-left: 3px solid #3558d4;
  box-shadow: none;
}
.solution-material-code {
  min-width: 0;
  overflow: hidden;
  color: #254aa8;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.solution-material-description { min-width: 0; }
.solution-material-description > small { display: block; color: #3159ca; font-size: .6rem; font-weight: 800; }
.solution-material-description > button {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.solution-work-association-markers {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
  vertical-align: middle;
}
.solution-workflow-single-actions,
.workflow-model-actions {
  align-items: center;
  gap: 3px;
}
.solution-bundle-tools { display: flex; gap: 8px; margin-top: 2px; }
.solution-bundle-summary { margin: 2px 0; color: var(--muted); font-size: .68rem; line-height: 1.25; white-space: pre-line; }
.solution-bundle-tools button { padding: 0; border: 0; background: none; color: #3159ca; font-size: .65rem; cursor: pointer; }
.solution-line-number {
  display: flex;
  align-items: center;
  justify-self: end;
  width: 100%;
  min-height: 25px;
  height: 27px;
  padding: 1px 3px;
  border: 1px solid #d8dce5;
  border-radius: 7px;
  background: #f7f8fb;
  overflow: hidden;
}
.solution-line-number:focus-within { background: #fff; border-color: #8097dd; box-shadow: 0 0 0 3px rgba(72, 102, 194, .12); }
.solution-line-number input { flex: 1 1 auto; width: 0; min-width: 0; height: 21px; border: 0; padding: 1px 0; background: transparent; text-align: right; }
.solution-line-number small { padding-right: 5px; color: var(--muted); }
.solution-line-total { text-align: right; }
.solution-line-price-readonly {
  min-width: 0;
  padding-right: 5px;
  text-align: right;
  white-space: nowrap;
}
.solution-material-row-edit > .solution-line-delete {
  align-self: center;
  justify-self: end;
  width: 25px;
  min-width: 25px;
  min-height: 25px;
  height: 25px;
  padding: 5px;
  border-radius: 6px;
  transform: none;
}
.solution-material-row-edit > .solution-line-delete svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.solution-material-total { display: flex; justify-content: flex-end; gap: 20px; padding: 8px 47px 8px 8px; border-top: 1px solid var(--line); background: #f5f8ff; }
.solution-builder-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; }
.solution-builder-footer small { color: var(--muted); }

.solution-workflow-canvas { margin-top: 3px; }
.solution-workflow-canvas .workflow-unit-stage { align-items: start; }
.solution-workflow-canvas .workflow-unit-stage > span {
  align-self: start;
  padding-top: 8px;
}
.solution-workflow-canvas .workflow-unit-stage-grid > .workflow-unit-card {
  grid-row: 1;
  align-self: start;
}
.solution-workflow-canvas .workflow-unit-stage-grid { row-gap: 20px; }
.solution-workflow-single-actions { display: flex; justify-content: flex-end; min-height: 22px; padding: 3px 6px 0; }
.solution-association-button,
.solution-association-marker {
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid #b8c7e6;
  border-radius: 999px;
  background: #f1f5ff;
  color: #3159ca;
  font-size: .65rem;
  font-weight: 800;
  cursor: pointer;
}
.solution-association-marker { color: #d27a00; border-color: #efc980; background: #fff6df; letter-spacing: -1px; }
.solution-association-marker.static { display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; vertical-align: middle; }

@media (max-width: 1050px) {
  .solution-catalog-search { grid-template-columns: minmax(240px, 1fr) 60px; }
  .solution-catalog-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .solution-material-builder { overflow-x: auto; }
  .solution-material-header, .solution-material-row-edit { min-width: 850px; }
}
/* Approvvigionamento: pannello amministrativo compatto */
.purchase-orders-page {
  display: grid;
  gap: 10px;
}

.purchase-orders-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.purchase-orders-head h2,
.purchase-orders-head p { margin: 0; }
.purchase-orders-head > div:first-child > p:last-child { color: var(--muted); font-size: .82rem; }

.purchase-orders-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.purchase-warehouse-field { width: 220px; margin: 0; }
.purchase-warehouse-field select { height: 36px; }
.purchase-realtes-default { align-self: end; margin-bottom: 1px; }

.purchase-orders-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 7px;
}

.purchase-orders-summary > span {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}

.purchase-orders-summary strong { color: var(--primary); font-size: 1rem; }
.purchase-orders-summary small { color: var(--muted); }
.purchase-orders-summary .warning strong { color: #a65a00; }

.purchase-orders-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.purchase-orders-column {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.purchase-orders-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
}

.purchase-orders-column-head > div:not(.purchase-status-filters) { display: grid; gap: 1px; }
.purchase-orders-column-head small { color: var(--muted); font-size: .72rem; }
.purchase-demand-list,
.purchase-order-list { display: grid; gap: 12px; padding: 7px; }

.purchase-draft-card {
  display: grid;
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised, #fff);
  cursor: pointer;
}
.purchase-draft-card:hover,
.purchase-draft-card:focus-visible { border-color: #8ea7ee; background: #f8faff; }
.purchase-draft-card.has-alerts { border-left: 3px solid #d69225; padding-left: 8px; }
.purchase-draft-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.purchase-draft-card-heading > span { display: grid; min-width: 0; }
.purchase-draft-card-heading small { color: var(--muted); font-size: .65rem; text-transform: uppercase; }
.purchase-draft-card-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.purchase-draft-card-heading > b {
  padding: 3px 8px;
  color: #44536c;
  background: #edf0f4;
  border-radius: 999px;
  font-size: .66rem;
  letter-spacing: .04em;
}
.quote-preparation-supply-choice { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0; border-top:1px solid var(--border); }
.quote-preparation-supply-choice > span { min-width:0; overflow-wrap:anywhere; }
.quote-preparation-supply-choice > button { flex-shrink:0; }
.purchase-draft-card-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: 8px; align-items: start; }
.purchase-draft-card-summary > .purchase-draft-card-total { text-align: right; white-space: nowrap; }
.purchase-draft-card-summary > .warning { grid-column: 1 / -1; }
.purchase-order-origin + .purchase-order-origin { border-top: 1px solid #cbd3e1; margin-top: 8px; padding-top: 8px; }
.purchase-order-origin > header { display: grid; gap: 3px; padding: 7px 8px; }
.purchase-order-origin > header strong { color: #243e9b; font-size: 13px; }
.purchase-order-origin > header small { color: var(--muted); font-size: 11px; }
.purchase-draft-origin + .purchase-draft-origin,
.purchase-draft-customer + .purchase-draft-customer { border-top: 1px solid #cbd3e1; padding-top: 10px; margin-top: 10px; }
.purchase-draft-card-summary > span { display: grid; gap: 1px; }
.purchase-draft-card-summary small { color: var(--muted); font-size: .61rem; text-transform: uppercase; }
.purchase-draft-card-summary strong { font-size: .78rem; }
.purchase-draft-card-summary .warning strong { color: #a65a00; }
.purchase-draft-card-codes { overflow: hidden; color: #3558d4; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.purchase-draft-card-alert { color: #955900; font-size: .69rem; }

.purchase-demand-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-raised, #fff);
}

.purchase-demand-row.has-alerts { border-left: 3px solid #d69225; padding-left: 6px; }
.purchase-demand-check { display: grid; place-items: start center; padding-top: 2px; }
.purchase-demand-check input { width: 17px; height: 17px; }
.purchase-demand-main { min-width: 0; display: grid; gap: 4px; }
.purchase-demand-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.purchase-demand-title strong { white-space: nowrap; color: var(--primary); }
.purchase-demand-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.purchase-demand-main > small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.purchase-demand-metrics {
  display: grid;
  grid-template-columns: 72px 72px 100px 100px minmax(120px, 1fr);
  align-items: end;
  gap: 5px;
}

.purchase-demand-metrics > span { display: grid; gap: 0; min-width: 0; }
.purchase-demand-metrics small { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .025em; }
.purchase-demand-metrics b { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-demand-supplier b { color: #344869; }

.purchase-alerts { display: flex; flex-wrap: wrap; gap: 4px; }
.purchase-alert {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #edf3ff;
  color: #315486;
  font-size: .69rem;
  line-height: 1.25;
}
.purchase-alert.warning { background: #fff0ce; color: #875400; }
.purchase-alert.danger { background: #fde5e2; color: #9f3026; }
.purchase-alert.positive { background: #e3f4e9; color: #287345; }
.purchase-alternatives { font-size: .72rem; color: var(--muted); }
.purchase-alternatives summary { cursor: pointer; color: var(--primary); }
.purchase-alternatives div { display: grid; gap: 2px; padding: 5px 2px 0; }

.purchase-order-card {
  border: 1px solid #cbd3e1;
  border-radius: 11px;
  box-shadow: 0 2px 5px rgba(35, 53, 80, .05);
  background: var(--surface-raised, #fff);
  overflow: hidden;
}
.purchase-order-card.completed { background: #f2f8f3; }
.purchase-order-card.is-canceled { background: #f5e9e8; border-color: #d8b4b0; }
.purchase-order-card.is-canceled .purchase-order-line { background: transparent; }
.purchase-order-card.is-canceled .purchase-order-state,
.business-badge.purchase-canceled-badge {
  color: #8b3038;
  background: #f8dfe1;
  border-color: #d99da4;
}
.purchase-order-card > header {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto 100px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
}
.purchase-order-state { justify-self: start; }
.purchase-order-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.purchase-order-card > header > div { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.purchase-order-card > header > div span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-order-card > header > b { text-align: right; }
.purchase-order-status { margin: 0; }
.purchase-order-status span { display: none; }
.purchase-order-status select { height: 31px; padding-block: 2px; font-size: .75rem; }
.purchase-order-lines { display: grid; }
.purchase-order-line {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, .72fr) 112px 58px 82px 82px auto;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 6px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
}
.purchase-order-line:last-child { border-bottom: 0; }
.purchase-order-line > div:first-child { display: grid; min-width: 0; }
.purchase-order-line > div:first-child > span,
.purchase-order-line > div:first-child > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-order-line > div:first-child > span { font-size: .77rem; }
.purchase-order-line > div:first-child > small { color: var(--muted); font-size: .67rem; }
.purchase-order-line > span { display: grid; text-align: right; }
.purchase-order-line > span small { color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.purchase-order-line > span b { font-size: .75rem; }
.purchase-line-destination { display: grid; min-width: 0; gap: 2px; }
.purchase-line-destination small { color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.purchase-line-destination select { width: 100%; min-width: 0; height: 31px; padding: 4px 24px 4px 7px; font-size: .7rem; }
.purchase-line-realtes { align-self: center; }
.purchase-line-realtes span { min-height: 31px; padding: 4px 7px; font-size: .66rem; line-height: 1.1; }
.receipt-destination-change { padding: 7px; border: 1px solid #efbf69; border-radius: 9px; background: #fff8e8; }
.purchase-line-alerts { grid-column: 1 / -1; }

.purchase-draft-dialog {
  width: min(1500px, calc(100vw - 28px));
  max-width: 1500px;
  height: min(900px, calc(100dvh - 28px));
  max-height: calc(100dvh - 28px);
  overflow: hidden;
}
.purchase-draft-dialog::backdrop { background: rgba(20, 27, 48, .42); }
.purchase-draft-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; min-height: 0; }
.purchase-draft-shell > .dialog-header { position: static; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.purchase-draft-shell > .dialog-header h2,
.purchase-draft-shell > .dialog-header p { margin: 0; }
.purchase-draft-content { display: grid; align-content: start; gap: 12px; min-height: 0; overflow: auto; padding: 12px 16px; }
.purchase-draft-customer { display: grid; gap: 7px; padding: 9px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.purchase-draft-customer > h3 { margin: 0; padding: 3px 0 5px 9px; border-left: 3px solid #3553d9; color: #243e9b; font-size: 1.1rem; font-weight: 750; line-height: 1.3; overflow-wrap: anywhere; }
.purchase-draft-origin { display: grid; gap: 5px; }
.purchase-draft-origin > h4 { margin: 0; color: var(--muted); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; }
.purchase-draft-line {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) 76px minmax(180px, .8fr) minmax(190px, .9fr) 112px 96px 92px;
  align-items: end;
  gap: 7px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 11px;
  background: var(--surface-raised, #fff);
}
.purchase-draft-line.is-moved { color: #737b86; background: #f0f1f3; border-color: #d8dbe0; }
.purchase-draft-product { display: grid; align-self: center; min-width: 0; gap: 1px; }
.purchase-draft-product > strong,
.purchase-draft-product > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-draft-product > strong { font-size: .76rem; }
.purchase-draft-product > small { color: var(--muted); font-size: .66rem; }
.purchase-draft-code { justify-self: start; padding: 0; color: var(--primary); font-size: .78rem; font-weight: 800; }
.purchase-draft-moved { color: #6d727b; font-size: .66rem; font-weight: 700; }
.purchase-draft-line .field { min-width: 0; margin: 0; }
.purchase-draft-line .field > span:first-child,
.purchase-draft-cost small,
.purchase-draft-availability small { font-size: .61rem; }
.purchase-draft-line input,
.purchase-draft-line select,
.purchase-draft-realtes > span { min-height: 35px; height: 35px; }
.purchase-draft-line input,
.purchase-draft-line select { width: 100%; min-width: 0; padding-block: 5px; font-size: .72rem; }
.purchase-draft-realtes { align-self: end; }
.purchase-draft-realtes > span { padding: 5px 7px; font-size: .66rem; line-height: 1.1; }
.purchase-draft-cost,
.purchase-draft-availability { display: grid; align-self: end; gap: 1px; min-width: 0; }
.purchase-draft-cost small,
.purchase-draft-availability small { color: var(--muted); text-transform: uppercase; }
.purchase-draft-cost strong,
.purchase-draft-availability strong { font-size: .75rem; }
.purchase-draft-availability.unavailable strong { color: #a65a00; }
.purchase-draft-line-notices { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.purchase-stock-source {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(280px, 1fr) 90px auto;
  align-items: center;
  gap: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
}
.purchase-stock-source > strong { font-size: .72rem; color: #284e89; }
.purchase-stock-zero-cost { display: block; margin-top: 3px; color: #287345; font-weight: 600; }
.purchase-stock-source > select,
.purchase-stock-source > input,
.purchase-stock-source > button {
  box-sizing: border-box;
  height: 35px;
  min-height: 35px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #cbd4e3;
  border-radius: 8px;
  background-color: #fffdf8;
  color: #24345f;
  font-family: var(--ui-field-font);
  font-size: 11px;
  line-height: normal;
  box-shadow: none;
}
.purchase-stock-source > select { cursor: pointer; }
.purchase-stock-source > button { font-weight: 800; background: #edf2ff; }
.purchase-stock-source > button:hover { background: #dfe8ff; transform: none; }
.purchase-stock-source > select:focus-visible,
.purchase-stock-source > input:focus-visible,
.purchase-stock-source > button:focus-visible { outline: 2px solid #6681d5; outline-offset: 2px; }
@media (max-width: 1100px) {
  .purchase-stock-source { grid-template-columns: minmax(0, 1fr) 80px auto; }
  .purchase-stock-source > strong { grid-column: 1 / -1; }
}
.purchase-stock-allocation {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e3f4e9;
  color: #287345;
  font-size: .69rem;
}
.purchase-stock-source .purchase-stock-allocation { grid-column: 1 / -1; justify-self: start; }
.purchase-stock-reservations { display: grid; gap: 5px; padding: 9px; background: #f2f8f3; border: 1px solid #b9d7c1; border-radius: 9px; }
.purchase-stock-reservations h3 { margin: 0 0 3px; font-size: .78rem; }
.purchase-stock-reservations > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.purchase-stock-reservations > div > span:first-child { display: grid; font-size: .72rem; }
.purchase-stock-reservations small { color: var(--muted); }
.purchase-draft-line-notices > span { padding: 3px 7px; color: #425675; background: #edf3ff; border-radius: 999px; font-size: .66rem; }
.purchase-draft-line-notices > .warning { color: #875400; background: #fff0ce; }
.purchase-draft-line-notices > .positive { color: #287345; background: #e3f4e9; }
.purchase-draft-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.purchase-draft-footer > span { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; padding: 8px 12px; border-left: 3px solid #3553d9; border-radius: 8px; background: #edf2ff; color: #243e9b; font-size: .85rem; font-weight: 600; }
.purchase-draft-footer > span strong { color: #203580; font-size: 1.3rem; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.purchase-draft-footer > div { display: flex; gap: 7px; }

.goods-receipt-serial-override {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 3px 0 7px;
}
.goods-receipt-serial-override .field { flex: 1; margin: 0; }
.goods-receipt-ownership-flags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.inline-input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 5px;
}
.inline-input-action .secondary-button { min-height: 36px; padding-inline: 10px; }
.warehouse-item-picker { position: relative; display: block; }
.warehouse-item-picker > input { width: 100%; }
.warehouse-item-search-results {
  position: absolute;
  z-index: 25;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 280px;
  overflow: auto;
  padding: 5px;
  border: 1px solid #cfd6d1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(27, 35, 31, .16);
}
.warehouse-item-search-results[hidden] { display: none; }
.warehouse-item-search-results > button {
  display: grid;
  grid-template-columns: minmax(105px, .45fr) minmax(0, 1fr);
  gap: 2px 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-bottom: 1px solid #edf0ed;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.warehouse-item-search-results > button:last-child { border-bottom: 0; }
.warehouse-item-search-results > button:hover { background: #f0f5ff; }
.warehouse-item-search-results > button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.warehouse-item-search-results > button small {
  grid-column: 1 / -1;
  color: var(--muted);
}
.warehouse-unit-list {
  display: grid;
  gap: 3px;
  margin-top: 5px;
}
.warehouse-unit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 3px 5px 3px 8px;
  border: 1px solid #e1e5e2;
  border-radius: 8px;
  background: #fbfcfb;
  font-size: .72rem;
}
.warehouse-unit-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.warehouse-unit-badges,
.supply-package-head-actions { display: flex; align-items: center; gap: 5px; }
.asset-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: .62rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .025em;
  white-space: nowrap;
}
.asset-badge.realtes { color: #275174; background: #e4f1fb; border: 1px solid #bcd8eb; }
.asset-badge.rental { color: #854f00; background: #fff0cf; border: 1px solid #e9bd60; }
.asset-identity-dialog { width: min(650px, calc(100vw - 28px)); }
.asset-identity-dialog::backdrop { background: rgba(25, 30, 34, .4); }
.asset-identity-history {
  display: grid;
  gap: 4px;
  max-height: 170px;
  overflow: auto;
  padding: 7px;
  border: 1px solid #e0e3e0;
  border-radius: 9px;
  background: #f8faf8;
}
.asset-identity-history > div {
  display: grid;
  grid-template-columns: minmax(130px, .8fr) minmax(120px, .8fr) minmax(0, 1fr);
  gap: 7px;
  padding-block: 3px;
  border-bottom: 1px solid #e5e8e5;
  font-size: .7rem;
}
.asset-identity-history > div:last-child { border-bottom: 0; }
.asset-identity-history small { color: var(--muted); }

.supply-package-reference {
  color: #315f57 !important;
  display: block;
}

.supply-package-list { gap: 7px; }
.supply-package-card {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid #d9dedb;
  border-left: 3px solid #c49431;
  border-radius: 11px;
  background: #fffdfa;
}
.supply-package-card.ready { border-left-color: #2b966a; background: #f5fbf7; }
.supply-package-card.partial { border-left-color: #e0a126; }
.supply-package-card > header,
.supply-package-card > header > div {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.supply-package-card > header { justify-content: space-between; }
.supply-package-head-actions > b { color: #315f57; }
.supply-package-card > header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.supply-package-card > header > b { color: #315f57; }
.supply-package-card > small { color: var(--muted); }
.supply-package-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ece9;
}
.supply-package-progress span {
  display: block;
  height: 100%;
  background: #3a9b72;
  border-radius: inherit;
}
.supply-package-components { display: grid; gap: 2px; }
.supply-package-components > span {
  display: grid;
  grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 74px;
  align-items: center;
  gap: 8px;
  min-height: 25px;
  padding: 2px 5px;
  border-radius: 6px;
  font-size: .73rem;
}
.supply-package-components > span.ready { background: #e9f6ee; }
.supply-package-components em {
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.supply-package-components strong { text-align: right; }

.warehouse-entry-panel {
  margin-bottom: 12px;
}

.warehouse-entry-form {
  display: grid;
  gap: 9px;
  padding: 12px;
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, #fff 96%, var(--accent));
  box-shadow: 0 10px 28px rgba(36, 41, 39, .06);
}

.warehouse-entry-head,
.warehouse-entry-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.warehouse-entry-head h2 {
  margin: 1px 0 0;
  font-size: 1rem;
}

.warehouse-entry-modes {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f4f3ef;
}

.warehouse-mode-button {
  min-height: 30px;
  padding: 3px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}

.warehouse-mode-button.active {
  border-color: #aebcf0;
  background: #e8edff;
  color: #2747b4;
  box-shadow: 0 2px 5px rgba(49, 88, 255, .12);
}

.warehouse-catalog-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 9px;
  background: #f4f6fc;
}

.warehouse-catalog-picker > small {
  max-width: 300px;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: .64rem;
}

.warehouse-entry-grid {
  display: grid;
  align-items: end;
  gap: 6px;
  min-width: 0;
}

.warehouse-entry-grid.catalog-fields {
  grid-template-columns: 56px minmax(78px, .72fr) minmax(84px, .76fr) minmax(78px, .72fr) minmax(88px, .8fr) minmax(180px, 2fr) minmax(98px, .82fr) minmax(185px, 1.3fr);
}

.warehouse-entry-grid.inventory-fields {
  grid-template-columns: minmax(118px, 1.08fr) minmax(85px, .75fr) minmax(132px, 1fr) minmax(126px, 1fr) minmax(92px, .78fr) minmax(135px, 1.18fr) minmax(112px, .92fr);
}
#warehouse-entry-unit-rows > div { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e1e4ea; grid-template-columns: 56px repeat(5, minmax(100px, 1fr)); }
@media (max-width: 900px) { #warehouse-entry-unit-rows > div { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.warehouse-entry-form .compact-field {
  min-width: 0;
  margin: 0;
  gap: 3px;
}

.warehouse-entry-form .compact-field > span:first-child {
  font-size: .61rem;
  letter-spacing: .035em;
}

.warehouse-entry-form .compact-field input,
.warehouse-entry-form .compact-field select,
.warehouse-entry-form .compact-field textarea {
  width: 100%;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: .75rem;
  line-height: 1.2;
}

.warehouse-entry-form .compact-field textarea {
  resize: vertical;
}

.mini-action-button {
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 900;
  cursor: pointer;
}

.warehouse-entry-flags {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 6px 13px;
  min-height: 34px;
  padding-top: 2px;
}

.warehouse-entry-flags .override-field { width: min(320px, 100%); }
.warehouse-entry-flags .notes-field { flex: 1 1 240px; }

.warehouse-aggregate-header {
  display: grid;
  grid-template-columns: auto 155px 170px minmax(260px, 1fr);
  align-items: end;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid #cbd5f5;
  border-radius: 9px;
  background: #f2f5ff;
}

.warehouse-aggregate-header[hidden] { display: none; }
.warehouse-group-type-label {
  align-self: center;
  color: #4765c5;
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.warehouse-entry-actions {
  justify-content: flex-end;
  padding-top: 2px;
}

.warehouse-entry-actions .secondary-button,
.warehouse-entry-actions .primary-button {
  min-height: 32px;
  padding: 4px 13px;
  font-size: .72rem;
}
.warehouse-insert-button[hidden] { display: none; }

.warehouse-composition {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #dbe1f3;
  border-radius: 10px;
  background: #fbfcff;
}

.warehouse-composition[hidden] { display: none; }
.warehouse-composition-table { display: grid; gap: 4px; min-width: 0; }
.warehouse-composition-head,
.warehouse-composition-row {
  display: grid;
  grid-template-columns: minmax(115px, .23fr) minmax(260px, 1fr) 54px 30px;
  align-items: center;
  gap: 8px;
}

.warehouse-composition-head {
  padding: 0 9px 2px;
  color: var(--ink-soft);
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.warehouse-composition-row {
  position: relative;
  min-height: 44px;
  padding: 5px 7px 5px 12px;
  border: 1px solid #d8def0;
  border-radius: 9px;
  background: #fff;
}

.warehouse-composition-row.parent-row {
  border-color: #b9c8fa;
  background: #f2f5ff;
}

.warehouse-component-branch {
  position: relative;
  display: grid;
  gap: 4px;
  margin-left: 12px;
  padding-left: 13px;
  border-left: 2px solid #8eabf6;
}

.warehouse-component-branch .component-row::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -14px;
  width: 13px;
  border-top: 2px solid #8eabf6;
}

.warehouse-composition-code {
  overflow: hidden;
  color: #5471c9;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-composition-description {
  display: grid;
  min-width: 0;
}

.warehouse-composition-description small {
  color: #5377e0;
  font-size: .58rem;
  font-weight: 900;
}

.warehouse-composition-description b,
.warehouse-composition-description em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-composition-description b { font-size: .76rem; }
.warehouse-composition-description em { color: var(--muted); font-size: .63rem; font-style: normal; }

.asset-badge.group,
.business-badge.group-link {
  border: 1px solid #b8c6ee;
  background: #edf1ff;
  color: #3e5eb7;
  cursor: pointer;
}

.warehouse-group-dialog {
  width: min(980px, calc(100vw - 28px));
  max-height: min(86vh, 820px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
}

.warehouse-group-dialog::backdrop { background: rgba(25, 30, 34, .42); }
.warehouse-group-dialog-shell { display: grid; gap: 9px; padding: 14px; }
.warehouse-group-dialog-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.warehouse-group-dialog-meta span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef1f8;
  color: var(--ink-soft);
  font-size: .67rem;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .warehouse-entry-grid.catalog-fields,
  .warehouse-entry-grid.inventory-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .warehouse-entry-grid .description-field { grid-column: span 2; }
  .warehouse-entry-grid .tracking-field { grid-column: span 2; }
}

@media (max-width: 760px) {
  .warehouse-entry-head { align-items: stretch; flex-direction: column; }
  .warehouse-entry-modes { width: 100%; }
  .warehouse-mode-button { flex: 1; }
  .warehouse-catalog-picker { grid-template-columns: 1fr; }
  .warehouse-catalog-picker > small { display: none; }
  .warehouse-entry-grid.catalog-fields,
  .warehouse-entry-grid.inventory-fields,
  .warehouse-aggregate-header { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warehouse-group-type-label,
  .warehouse-aggregate-header .description-field { grid-column: 1 / -1; }
  .warehouse-composition-head,
  .warehouse-composition-row { grid-template-columns: 92px minmax(0, 1fr) 42px 28px; }
}

@media (max-width: 1200px) {
  .purchase-orders-layout { grid-template-columns: 1fr; }
  .purchase-draft-line { grid-template-columns: minmax(220px, 1.3fr) 76px minmax(170px, .9fr) minmax(180px, 1fr); }
  .purchase-draft-realtes,
  .purchase-draft-cost,
  .purchase-draft-availability { align-self: end; }
}
@media (max-width: 760px) {
  .purchase-orders-head { align-items: stretch; flex-direction: column; }
  .purchase-orders-actions { justify-content: stretch; }
  .purchase-warehouse-field { width: 100%; }
  .purchase-orders-summary { grid-template-columns: repeat(2, 1fr); }
  .purchase-demand-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-order-card > header { grid-template-columns: 1fr; }
  .purchase-order-line { grid-template-columns: minmax(0, 1fr) 70px; }
  .purchase-line-alerts { grid-column: 1 / -1; }
  .purchase-draft-card-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-draft-line { grid-template-columns: 1fr 1fr; }
  .purchase-draft-product,
  .purchase-draft-line-notices { grid-column: 1 / -1; }
  .purchase-draft-footer { align-items: stretch; flex-direction: column; }
  .purchase-draft-footer > div { justify-content: flex-end; }
}
.warehouse-module [data-warehouse-section][hidden] {
  display: none !important;
}

.warehouse-module[data-warehouse-view="articles"] .warehouse-dashboard,
.warehouse-module[data-warehouse-view="movements"] .warehouse-dashboard,
.warehouse-module[data-warehouse-view="stock"] .warehouse-dashboard {
  grid-template-columns: minmax(0, 1fr);
}

.warehouse-module[data-warehouse-view="articles"] .warehouse-dashboard > .business-stack:first-child,
.warehouse-module[data-warehouse-view="movements"] .warehouse-dashboard > .business-stack:first-child,
.warehouse-module[data-warehouse-view="stock"] .warehouse-dashboard > .business-stack:first-child {
  display: none;
}

.warehouse-module[data-warehouse-view="licenses"] .warehouse-dashboard,
.warehouse-module[data-warehouse-view="associations"] .warehouse-dashboard {
  align-items: start;
}

.warehouse-settings-grid {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(360px, 1.28fr);
  gap: 12px;
  align-items: start;
}

.warehouse-settings-actions,
.warehouse-settings-row-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.warehouse-settings-row-actions {
  flex: 0 0 auto;
}

.warehouse-stock-table,
.warehouse-movement-table {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.warehouse-stock-table-head,
.warehouse-stock-table-row {
  display: grid;
  grid-template-columns: 112px 150px 120px minmax(220px, 1fr) 64px minmax(150px, .8fr);
  align-items: center;
  min-width: 820px;
}

.warehouse-stock-table-head,
.warehouse-movement-table-head {
  min-height: 34px;
  padding: 0 10px;
  background: #f2f5fb;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.warehouse-stock-table-row {
  width: 100%;
  min-height: 42px;
  padding: 5px 10px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.warehouse-stock-table-row:hover {
  background: #f6f8ff;
}

.warehouse-stock-table-row > *,
.warehouse-movement-table-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}

.warehouse-movement-table-head,
.warehouse-movement-table-row {
  display: grid;
  grid-template-columns: 132px 54px 150px minmax(180px, 1fr) 120px 70px minmax(170px, .9fr) 140px;
  align-items: center;
  min-width: 1120px;
}

.warehouse-movement-table-row {
  min-height: 44px;
  padding: 5px 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.warehouse-movement-table-row button {
  justify-self: start;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid #ccd7f3;
  border-radius: 7px;
  background: #f5f7ff;
  color: #2749b5;
  font: inherit;
  cursor: pointer;
}

.warehouse-origin-label {
  color: var(--muted);
}

.warehouse-stock-dialog {
  width: min(820px, calc(100vw - 32px));
}

.warehouse-stock-filters, .warehouse-stock-transfer {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 9px;
  margin-bottom: 12px;
  align-items: end;
}
.warehouse-stock-filters label, .warehouse-stock-transfer label { display: grid; gap: 4px; min-width: 0; font-size: 11px; }
.warehouse-stock-filters input, .warehouse-stock-filters select,
.warehouse-stock-transfer input:not([type="checkbox"]), .warehouse-stock-transfer select,
.warehouse-stock-transfer button {
  box-sizing: border-box; height: 35px; min-height: 35px; width: 100%; margin: 0;
  padding: 0 10px; border: 1px solid #cbd4e3; border-radius: 8px;
  font-family: var(--ui-field-font); font-size: 11px;
}
.warehouse-stock-transfer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.warehouse-stock-transfer > strong, .warehouse-stock-wide { grid-column: 1 / -1; }
.warehouse-stock-transfer fieldset { border: 0; padding: 0; margin: 0; }
.warehouse-stock-transfer .warehouse-stock-unit-choice { display: flex; align-items: center; min-height: 30px; }
.warehouse-stock-unit-choice input { width: 16px; height: 16px; accent-color: #3555d9; }
.warehouse-stock-history { display: grid; gap: 8px; margin-top: 16px; }
.warehouse-stock-history > div { display: grid; grid-template-columns: 1fr auto; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.warehouse-stock-history small { grid-column: 1 / -1; overflow-wrap: anywhere; }
.warehouse-stock-dialog { max-height: 90vh; overflow-y: auto; }
@media (max-width: 600px) {
  .warehouse-stock-filters, .warehouse-stock-transfer { grid-template-columns: 1fr; }
}

.warehouse-stock-dialog-shell {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.warehouse-stock-detail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.warehouse-stock-detail-grid > span,
.warehouse-stock-detail-description,
.warehouse-stock-detail-locations {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcff;
}

.warehouse-stock-detail-grid small,
.warehouse-stock-detail-description small {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.warehouse-stock-detail-description p {
  margin: 0;
}

.warehouse-stock-detail-locations span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.warehouse-stock-detail-units {
  display: grid;
  gap: 3px;
  max-height: 230px;
  overflow: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcff;
}

.warehouse-stock-detail-unit-head,
.warehouse-stock-detail-units > button {
  display: grid;
  grid-template-columns: 112px minmax(135px, 1fr) minmax(110px, .8fr) 90px;
  gap: 7px;
  align-items: center;
  min-width: 520px;
}

.warehouse-stock-detail-unit-head {
  padding: 2px 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.warehouse-stock-detail-units > button {
  min-height: 31px;
  padding: 4px 7px;
  border: 1px solid #e0e4ee;
  border-radius: 7px;
  background: #fff;
  color: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.warehouse-stock-detail-units > button:hover { border-color: #b9c7ee; background: #f3f6ff; }
.warehouse-stock-detail-units > button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.warehouse-stock-detail-groups {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 900px) {
  .warehouse-settings-grid,
  .warehouse-module[data-warehouse-view="licenses"] .warehouse-dashboard,
  .warehouse-module[data-warehouse-view="associations"] .warehouse-dashboard {
    grid-template-columns: 1fr;
  }
  .warehouse-stock-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.task-card,
.task-card.has-no-deadline {
  grid-template-columns: minmax(0, 1fr) 110px 280px;
  column-gap: 14px;
  row-gap: 8px;
}
.task-card > .task-main { grid-column: 1; grid-row: 1 / 3; }
.task-card > .task-creator {
  grid-column: 3; grid-row: 1;
  display: grid; grid-template-columns: auto 140px;
  justify-content: end;
  gap: 6px; align-self: start; text-align: right;
}
.task-creator > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.task-card > .due-block { grid-column: 2; grid-row: 1 / 3; }
.task-card > .task-card-actions { grid-column: 3; grid-row: 2; flex-direction: row; align-items: center; }
.task-card-actions .dashboard-claim-button { width: 116px; min-width: 116px; flex: 0 0 116px; height: 34px; box-sizing: border-box; }
.task-card-actions .edit-button { width: 34px; min-width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; color: #3654ff; background: #e9ecff; border: 1px solid transparent; border-radius: 8px; }
.task-card-actions .edit-button:hover { color: #2842d8; background: #dce2ff; }
.task-card-actions .edit-button:focus-visible { outline: 2px solid #3654ff; outline-offset: 2px; }
.task-card-actions .priority-score { width: 42px; min-width: 42px; text-align: center; }
.task-identities { display: flex; gap: 6px; align-items: center; min-width: 0; margin-bottom: 5px; }
.task-identities .client-name-highlight { height: 25px; box-sizing: border-box; margin: 0; align-items: center; min-width: 0; }
.task-identities .task-number-badge { flex: 0 0 auto; }
@media (max-width: 900px) {
  .task-card, .task-card.has-no-deadline { grid-template-columns: minmax(0, 1fr) 280px; }
  .task-card > .task-creator, .task-card > .task-card-actions { grid-column: 2; }
  .task-card > .due-block { display: none; }
}
@media (max-width: 620px) {
  .task-card, .task-card.has-no-deadline { grid-template-columns: minmax(0, 1fr); }
  .task-card > .task-main { grid-column: 1; grid-row: 2; }
  .task-card > .task-creator { grid-column: 1; grid-row: 1; justify-self: end; width: min(280px, 100%); }
  .task-card > .task-card-actions { grid-column: 1; grid-row: 3; flex-wrap: wrap; }
}

.task-card.is-process-waiting {
  border-color: #e4b35a;
  background: linear-gradient(90deg, #fffaf0 0, var(--surface) 24%);
}

.process-stage-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid #b9c9ef;
  border-radius: 999px;
  background: #edf3ff;
  color: #294c9c;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.process-stage-badge.waiting {
  border-color: #e3b461;
  background: #fff3d8;
  color: #8b5600;
}

.task-operational-link.process-link {
  border-color: rgba(53, 88, 212, .28);
  background: rgba(53, 88, 212, .08);
  color: #294c9c;
}

.active-work-meta .task-operational-link.process-link {
  color: #0b245f;
  background: #fff;
  border-color: rgba(255, 255, 255, .96);
  box-shadow: 0 4px 12px rgba(7, 26, 85, .2);
}

.active-work-meta .task-operational-link.process-link:hover:not(:disabled) {
  color: #061947;
  background: #eaf0ff;
  border-color: #c6d4ff;
}

.active-work-meta .task-operational-link.process-link:focus-visible {
  outline: 3px solid #72ffbd;
  outline-offset: 2px;
}

/*
 * Standard grafico unico per tutte le pagine sovrapposte.
 * Le singole finestre definiscono soltanto dimensioni e layout del contenuto.
 */
:root {
  --overlay-dialog-radius: 18px;
  --overlay-dialog-border: #d9d7d0;
  --overlay-dialog-shadow: 0 28px 90px rgba(23, 33, 31, 0.26);
  --overlay-dialog-backdrop: rgba(19, 27, 25, 0.55);
}

dialog[class] {
  box-sizing: border-box;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--overlay-dialog-border);
  border-radius: var(--overlay-dialog-radius);
  box-shadow: var(--overlay-dialog-shadow);
}

dialog[class]::backdrop {
  background: var(--overlay-dialog-backdrop);
  backdrop-filter: blur(4px);
}

dialog[class] .dialog-header {
  gap: 14px;
  border-color: var(--overlay-dialog-border);
}

dialog[class] .dialog-header > .icon-button:last-child {
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
}

dialog[class] .dialog-actions,
dialog[class] .dialog-footer,
dialog[class] .business-form-actions {
  border-color: var(--overlay-dialog-border);
}

/* Il contenitore scorrevole deve terminare al bordo della barra sticky.
   Il padding inferiore del form lascia altrimenti scoperto il contenuto. */
dialog.business-dialog form.crm-entity-dialog-form,
dialog.business-dialog form.crm-opportunity-dialog-form,
dialog.business-dialog > form.crm-dialog-form,
#task-dialog form#task-form {
  padding-bottom: 0;
}

.maintenance-quote-editor,
.maintenance-quote-actions {
  background: var(--surface);
}
.intervention-materials {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line, #ddd8cf);
}

.intervention-material-list { display: grid; gap: 6px; }
.intervention-material-row {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr) repeat(3, auto);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 8px;
  border: 1px solid #ded9cf;
  border-radius: 11px;
  background: #fffdfa;
}
.intervention-material-row.is-blocking { border-left: 4px solid #d58a20; }
.intervention-material-row.is-ready { border-left-color: #27945c; background: #f5fbf7; }
.intervention-material-row.associated-material { grid-template-columns: auto minmax(0,1fr) auto; }
.intervention-material-state {
  justify-self: start;
  padding: 4px 7px;
  border-radius: 999px;
  background: #f3eee5;
  color: #665d52;
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
}
.intervention-material-state[data-status="to_purchase"],
.intervention-material-state[data-status="ordered"],
.intervention-material-state[data-status="partially_received"] { background: #fff0d6; color: #91580d; }
.intervention-material-state[data-status="reserved"],
.intervention-material-state[data-status="available"],
.intervention-material-state[data-status="delivered"],
.intervention-material-state[data-status="used"] { background: #dff4e7; color: #176b3e; }
.intervention-material-copy { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; min-width: 0; align-items: baseline; }
.intervention-material-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intervention-material-copy small { grid-column: 1 / -1; color: var(--muted, #68706d); }
.intervention-material-copy small b { color: #3a5aa9; font-weight: 800; }
.intervention-material-manage { white-space: nowrap; }

.material-request-workflow-dialog {
  width: min(1080px, calc(100vw - 28px));
  max-width: 1080px;
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 17px;
  background: #fbfaf7;
  box-shadow: 0 22px 65px rgba(27, 36, 62, .25);
}
.material-request-workflow-dialog::backdrop { background: rgba(18, 22, 28, .42); backdrop-filter: blur(2px); }
.material-request-workflow-shell {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
  max-height: calc(100dvh - 28px);
  padding: 14px;
  overflow: hidden;
  border: 1px solid #dfdcd4;
  border-radius: 17px;
  background: #fffdfa;
}
.material-request-workflow-shell > .task-dialog-header { margin: 0; position: relative; padding-right: 47px; }
#material-request-workflow-dialog [data-action="close-material-request-workflow"] {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  min-width: 35px;
  min-height: 35px;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 1px solid #c73636;
  border-radius: 8px;
  background: #c73636;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
#material-request-workflow-dialog [data-action="close-material-request-workflow"]:hover { background: #a92525; border-color: #a92525; }
#material-request-workflow-dialog [data-action="close-material-request-workflow"]:focus-visible { outline: 2px solid #a92525; outline-offset: 2px; }
#material-request-workflow-content {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 0 3px 3px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scroll-padding-bottom: 58px;
}
.material-request-context-card {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 7px;
  padding: 7px;
  border: 1px solid #dce2ef;
  border-radius: 12px;
  background: #f7f9fd;
}
.material-request-context-card > div { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 6px 8px; border-radius: 9px; background: rgba(255,255,255,.76); }
.material-request-context-card span { color: #667080; font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.material-request-context-card strong,
.material-request-context-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-request-context-card strong { font-size: .78rem; }
.material-request-context-card small { color: var(--muted); font-size: .67rem; }
.material-request-context-card .material-request-stage { justify-self: start; margin-bottom: 2px; padding: 3px 7px; border-radius: 999px; background: #e9efff; color: #3156ba; }
.material-request-context-card .material-request-stage[data-stage="sa_review"] { background: #eee8ff; color: #6a42aa; }
.material-request-context-card .material-request-stage[data-stage="catalog_verification"] { background: #fff0d4; color: #8b570d; }
.material-request-context-card .material-request-stage[data-stage="procurement"],
.material-request-context-card .material-request-stage[data-stage="fulfillment"] { background: #fff0d4; color: #8b570d; }
.material-request-context-card .material-request-stage[data-stage="completed"] { background: #e4f6ea; color: #17683e; }
.material-request-work-card {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 7px;
  align-items: end;
  padding: 9px;
  border: 1px solid #ded9cf;
  border-radius: 12px;
  background: #fffdfa;
}
.material-request-section-heading { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.material-request-section-heading h3,
.material-request-section-heading p { margin: 0; }
.material-request-section-heading h3 { font-size: .87rem; }
.material-request-section-heading p { color: var(--muted); font-size: .66rem; }
.material-request-section-heading > span { padding: 4px 8px; border-radius: 999px; background: #eef2fb; color: #4d5f85; font-size: .65rem; font-weight: 800; white-space: nowrap; }
.material-request-search-field { grid-column: span 5; position: relative; }
.material-request-new-item { grid-column: span 1; display: grid; grid-template-rows: 13px 35px; gap: 3px; min-width: 0; }
.material-request-new-item > span { color: var(--muted); font-size: .58rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.material-request-new-item > button { box-sizing: border-box; width: 100%; min-width: 0; height: 35px; min-height: 35px; max-height: 35px; align-self: end; padding: 0 7px; line-height: 1; }
.material-request-selected-item { grid-column: span 6; box-sizing: border-box; display: grid; grid-template-columns: minmax(80px, auto) minmax(0, 1fr) 29px; align-items: center; align-self: end; gap: 7px; height: 35px; min-height: 35px; max-height: 35px; padding: 2px 4px 2px 9px; overflow: hidden; border: 1px solid #d9deea; border-radius: 9px; background: #f7f9fd; }
.material-request-selected-item > span:nth-child(2) { display: grid; min-width: 0; }
.material-request-selected-item strong,
.material-request-selected-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-request-selected-item strong { font-size: .72rem; }
.material-request-selected-item small { color: var(--muted); font-size: .62rem; }
.material-request-selected-item > .icon-button { box-sizing: border-box; width: 29px; min-width: 29px; height: 29px; min-height: 29px; max-height: 29px; align-self: center; padding: 0; }
.material-request-selected-code { color: #3156ba; font-size: .7rem; font-weight: 850; }
.material-request-empty-selection { grid-column: 1 / -1; color: var(--muted); font-size: .7rem; }
.material-request-description-field { grid-column: span 6; }
.material-request-charge-field { grid-column: span 3; }
.material-request-price-field { grid-column: span 3; }
.material-request-commercial-notes,
.material-request-technical-notes { grid-column: span 6; }
.material-request-sa-field { grid-column: span 4; }
.material-request-verification-panel { grid-column: 1 / -1; display: grid; gap: 6px; padding: 8px; border: 1px solid #ead8b4; border-radius: 10px; background: #fff9ed; }
.material-request-verification-panel > div { display: grid; gap: 1px; }
.material-request-verification-panel > div small { color: var(--muted); font-size: .66rem; }
.material-request-verification-panel article { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(160px, 1fr) auto auto auto; align-items: center; gap: 7px; min-width: 0; padding: 5px 6px; border-radius: 8px; background: rgba(255,255,255,.8); }
.material-request-verification-panel article > span:not(.material-request-verification-state) { display: grid; min-width: 0; }
.material-request-verification-panel article small { overflow: hidden; color: var(--muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.material-request-verification-state { padding: 4px 7px; border-radius: 999px; background: #fff0d4; color: #8b570d; font-size: .62rem; font-weight: 800; white-space: nowrap; }
.material-request-verification-state[data-status="verified"] { background: #e4f6ea; color: #17683e; }
.anchored-form-grid > .field.material-request-description-field {
  grid-template-rows: 13px minmax(54px, auto);
  align-self: stretch;
}
.anchored-form-grid > .field.material-request-commercial-notes,
.anchored-form-grid > .field.material-request-technical-notes {
  grid-template-rows: 13px minmax(76px, auto);
  align-self: stretch;
}
.material-request-work-card textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  padding: 6px 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.material-request-work-card textarea[readonly] { background: #f3f5f8; color: #626b76; }
.material-request-catalog-results { position: absolute; z-index: 45; top: calc(100% + 3px); left: 0; right: 0; max-height: 250px; overflow: auto; padding: 4px; border: 1px solid #d5dbe8; border-radius: 10px; background: #fff; box-shadow: 0 12px 28px rgba(33,37,41,.16); }
.material-request-catalog-results button { display: grid; grid-template-columns: 115px minmax(0, 1fr) 185px; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.material-request-catalog-results button:hover { background: #eef3ff; }
.material-request-catalog-results span,
.material-request-catalog-results small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-request-workflow-actions {
  position: sticky;
  bottom: -3px;
  z-index: 4;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 12px;
  margin: 2px -9px -9px;
  padding: 9px;
  border-top: 1px solid #e5e0d7;
  border-radius: 0 0 11px 11px;
  background: rgba(255, 253, 250, .98);
  box-shadow: 0 -8px 16px rgba(255, 253, 250, .94);
}
.material-request-owner { min-width: 0; color: var(--muted); font-size: .66rem; }
.material-request-workflow-buttons { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; min-width: 0; }
.material-request-workflow-buttons > button { flex: 0 0 auto; }

@media (max-width: 820px) {
  .material-request-context-card { grid-template-columns: 1fr; }
  .material-request-search-field,
  .material-request-new-item,
  .material-request-selected-item,
  .material-request-description-field,
  .material-request-commercial-notes,
  .material-request-technical-notes { grid-column: 1 / -1; }
  .material-request-charge-field,
  .material-request-price-field,
  .material-request-sa-field { grid-column: span 6; }
  .material-request-workflow-actions { grid-template-columns: minmax(0, 1fr); }
  .material-request-verification-panel article { grid-template-columns: minmax(0, 1fr); }
  .material-request-workflow-buttons { justify-content: flex-start; }
}

.intervention-material-dialog { width: min(1120px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 0; border-radius: 18px; padding: 0; overflow: hidden; background: #fbfaf7; box-shadow: 0 22px 58px rgba(31, 36, 48, .22); }
.intervention-material-dialog::backdrop { background: rgba(18, 22, 28, .42); backdrop-filter: blur(2px); }
.intervention-material-dialog .task-dialog-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  max-height: calc(100vh - 32px);
  padding: 14px;
  overflow: auto;
  background: #fbfaf7;
}
.intervention-material-dialog .dialog-header,
.intervention-material-dialog .dialog-actions,
.intervention-material-notes-field { grid-column: 1 / -1; }
.intervention-material-dialog .dialog-header { align-items: flex-start; margin: 0 0 2px; }
.intervention-material-dialog .dialog-header h2 { font-family: var(--ui-field-font); font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.intervention-material-dialog .dialog-header p:not(.eyebrow) { margin: 3px 0 0; color: var(--muted); font-size: .72rem; }
.intervention-material-dialog .field { min-width: 0; margin: 0; gap: 4px; }
.intervention-material-device-row,
.intervention-material-catalog-row,
.intervention-material-draft,
.intervention-material-flags {
  box-sizing: border-box;
  min-width: 0;
  border: 1px solid #e1ddd5;
  border-radius: 12px;
  background: rgba(255, 255, 255, .74);
}
.intervention-material-device-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(245px, 330px); align-items: end; gap: 8px; padding: 8px; }
.intervention-material-device-card {
  box-sizing: border-box;
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 35px;
  padding: 5px 10px;
  border: 1px solid #d9dfee;
  border-radius: 9px;
  background: #f5f7fc;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}
.intervention-material-device-card:hover { border-color: #9eb2ed; background: #eef3ff; }
.intervention-material-device-card.is-selected { border-color: #315ee9; background: #e8efff; box-shadow: 0 0 0 2px rgba(49,94,233,.12); }
.intervention-material-device-card span { color: #667087; font-size: .59rem; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.intervention-material-device-card strong,
.intervention-material-device-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intervention-material-device-card strong { font-size: .78rem; }
.intervention-material-device-card small { color: var(--muted); font-size: .63rem; }
.intervention-material-device-row .field > span,
.intervention-material-catalog-row .field > span,
.intervention-material-notes-field > span { font-size: .62rem; font-weight: 850; letter-spacing: .045em; }
.intervention-material-task-picker,
.intervention-material-catalog-row input { box-sizing: border-box; height: 35px; min-height: 35px; border: 1px solid #d8d3ca; border-radius: 9px; background: #fff; box-shadow: none; }
.intervention-material-task-picker { position: relative; }
.intervention-material-task-picker > summary { box-sizing: border-box; display: flex; align-items: center; min-width: 0; height: 33px; padding: 0 31px 0 10px; overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; list-style: none; }
.intervention-material-task-picker > summary::-webkit-details-marker { display: none; }
.intervention-material-task-picker > summary::after { position: absolute; right: 11px; content: '⌄'; color: #56606d; font-size: .8rem; }
.intervention-material-task-picker > div { position: absolute; z-index: 55; top: calc(100% + 4px); right: 0; width: min(440px, 78vw); max-height: 230px; overflow: auto; padding: 5px; border: 1px solid #d5d9e3; border-radius: 10px; background: #fff; box-shadow: 0 14px 30px rgba(31,37,49,.17); }
.intervention-material-task-picker > div label { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 7px; min-height: 31px; padding: 3px 7px; border-radius: 7px; font-size: .7rem; }
.intervention-material-task-picker > div label:hover { background: #eef3ff; }
.intervention-material-task-picker > div input { width: 15px; height: 15px; margin: 0; accent-color: #315ee9; }
.intervention-material-task-empty { display: block; padding: 8px 9px; color: var(--muted); font-size: .68rem; }
.intervention-material-closed-tasks {
  display: grid;
  grid-template-columns: minmax(270px, 1fr) auto minmax(310px, .9fr);
  align-items: end;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid #e6c97a;
  border-radius: 11px;
  background: #fff9e9;
}
.intervention-material-closed-tasks[hidden] { display: none; }
.intervention-material-closed-tasks-copy { display: grid; align-self: center; gap: 2px; min-width: 0; }
.intervention-material-closed-tasks-copy strong { color: #5b4512; font-size: .76rem; }
.intervention-material-closed-tasks-copy span { color: #756337; font-size: .66rem; line-height: 1.25; }
.intervention-material-resolution-modes { display: grid; grid-template-columns: repeat(2, minmax(106px, 1fr)); gap: 5px; }
.intervention-material-resolution-modes .intervention-material-resolution-button,
.intervention-material-resolution-field input,
.intervention-material-resolution-field select {
  box-sizing: border-box;
  height: 35px;
  min-height: 35px;
  border-radius: 9px;
}
.intervention-material-resolution-modes .intervention-material-resolution-button { padding: 0 11px; white-space: nowrap; }
.intervention-material-resolution-button.is-active { border-color: #6681da; background: #eaf0ff; color: #2448b2; box-shadow: inset 0 0 0 1px rgba(69,99,194,.08); }
.intervention-material-resolution-field { min-width: 0; }
.intervention-material-resolution-field[hidden] { display: none; }
.intervention-material-resolution-field > span { font-size: .62rem; font-weight: 850; letter-spacing: .045em; }
@media (max-width: 1050px) {
  .intervention-material-closed-tasks { grid-template-columns: 1fr 1fr; }
  .intervention-material-closed-tasks-copy { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .intervention-material-closed-tasks { grid-template-columns: 1fr; }
  .intervention-material-closed-tasks-copy { grid-column: auto; }
}
.intervention-material-catalog-row { display: grid; grid-template-columns: minmax(280px, 1fr) 68px auto; align-items: end; gap: 7px; padding: 8px; }
.intervention-material-search-field { position: relative; }
.intervention-material-quantity-field input { padding-inline: 6px; text-align: center; }
.intervention-material-catalog-actions { display: grid; grid-template-columns: repeat(4, minmax(76px, auto)); gap: 5px; }
.intervention-material-catalog-actions .secondary-button { box-sizing: border-box; height: 35px; min-height: 35px; padding: 0 11px; border-color: #ded8cf; border-radius: 9px; background: linear-gradient(#fff, #f7f4ee); box-shadow: 0 1px 2px rgba(36,41,48,.05); }
.intervention-material-manual-row { display: grid; grid-template-columns: minmax(280px, 1fr) 68px 72px auto; align-items: end; gap: 7px; padding: 8px; border: 1px solid #dbe1ef; border-radius: 11px; background: #f5f8ff; }
.intervention-material-manual-row[hidden] { display: none; }
.intervention-material-manual-row input,
.intervention-material-manual-row .primary-button { box-sizing: border-box; height: 35px; min-height: 35px; }
.intervention-material-manual-row .primary-button { padding: 0 12px; border-radius: 9px; white-space: nowrap; }
.intervention-material-search-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  padding: 4px;
  border: 1px solid #d8d2c8;
  border-radius: 10px;
  background: white;
  box-shadow: 0 12px 28px rgba(33, 37, 41, .16);
}
.intervention-material-search-results button {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 150px;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}
.intervention-material-search-results button:hover { background: #eef3ff; }
.intervention-material-search-results span,
.intervention-material-search-results small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intervention-material-draft { position: relative; display: grid; gap: 4px; padding: 7px; background: #f7f9fd; }
.intervention-material-draft-heading,
.intervention-material-draft-row { box-sizing: border-box; display: grid; width: 100%; min-width: 0; grid-template-columns: 140px minmax(0, 1fr) 106px 48px; align-items: center; column-gap: 6px; }
.intervention-material-draft-heading { padding: 0 10px; color: #606a7b; font-size: .58rem; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.intervention-material-draft-row { position: relative; min-height: 44px; padding: 0 10px; border: 1px solid #dedbd5; border-radius: 9px; background: #fffdfa; cursor: pointer; }
.intervention-material-draft-row:hover { border-color: #aebbe2; }
.intervention-material-draft-row.is-selected { border-color: #315ee9; background: #f4f7ff; box-shadow: 0 0 0 1px rgba(49,94,233,.12); }
.intervention-material-draft-row.is-parent { background: #f4f6fc; border-color: #b9c8f2; }
.intervention-material-draft-row.is-component { width: calc(100% - 22px); margin-left: 22px; min-height: 38px; background: #fff; }
.intervention-material-tree { position: absolute; pointer-events: none; }
.intervention-material-draft-row.is-component .intervention-material-tree { position: absolute; left: -15px; top: -7px; bottom: -7px; width: 13px; border-left: 2px solid #7898ef; }
.intervention-material-draft-row.is-component::before { position: absolute; top: calc(50% - 1px); left: -15px; width: 15px; height: 2px; border-radius: 0 2px 2px 0; background: #7898ef; content: ''; pointer-events: none; }
.intervention-material-draft-row.is-component.is-last-component .intervention-material-tree { bottom: 50%; }
.intervention-material-draft-row > b { min-width: 0; padding: 0 8px; overflow: hidden; color: #315ab4; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.intervention-material-draft-description { display: grid; min-width: 0; padding: 0 8px; }
.intervention-material-draft-description strong,
.intervention-material-draft-description small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intervention-material-draft-description strong { font-size: .72rem; }
.intervention-material-draft-description > small:last-child { color: var(--muted); font-size: .59rem; }
.intervention-material-bundle-badge,
.intervention-material-component-badge { color: #4b6bc5; font-size: .55rem; font-weight: 900; letter-spacing: .04em; }
.intervention-material-draft-row > label { display: grid; grid-template-columns: minmax(56px, 64px) auto; align-items: center; justify-content: end; gap: 4px; min-width: 0; padding: 0 5px 0 0; }
.intervention-material-draft-row > label input,
.intervention-material-aggregate-name { box-sizing: border-box; width: 100%; height: 29px; min-height: 29px; padding: 3px 6px; border: 1px solid #d9dce5; border-radius: 7px; background: #fff; font: inherit; box-shadow: none; }
.intervention-material-draft-row > label input { text-align: right; }
.intervention-material-draft-row > label small { color: var(--muted); font-size: .58rem; }
.intervention-material-draft-row > .icon-button { box-sizing: border-box; width: 31px; min-width: 31px; height: 31px; min-height: 31px; padding: 0; justify-self: center; }
.intervention-material-draft-empty { margin: 0; padding: 12px; border: 1px dashed #cad2e5; border-radius: 8px; color: var(--muted); font-size: .7rem; text-align: center; }
.intervention-material-flags { display: flex; align-items: center; gap: 7px; padding: 7px 8px; }
.intervention-material-flags .selection-toggle { box-sizing: border-box; min-height: 32px; padding: 0 12px; border: 1px solid #d7d3ca; border-radius: 999px; background: #fff; color: #59616e; box-shadow: none; }
.intervention-material-flags .selection-toggle.active { border-color: #315ee9; background: #e9efff; color: #244dbd; }
.intervention-material-notes-field textarea { box-sizing: border-box; width: 100%; min-height: 58px; padding: 7px 9px; border: 1px solid #d8d3ca; border-radius: 9px; background: #fffdf7; font: inherit; box-shadow: none; resize: vertical; }
.intervention-material-dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin: 0; padding-top: 7px; border-top: 1px solid #e6e1d9; }

@media (max-width: 900px) {
  .intervention-material-device-row,
  .intervention-material-catalog-row,
  .intervention-material-manual-row { grid-template-columns: 1fr; }
  .intervention-material-catalog-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .intervention-material-draft-heading { display: none; }
  .intervention-material-draft-row { grid-template-columns: minmax(84px, 115px) minmax(0, 1fr) 90px 42px; column-gap: 4px; }
  .intervention-material-row { grid-template-columns: 1fr auto auto; }
  .intervention-material-state { grid-column: 1 / -1; }
}
.opportunity-service-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.opportunity-service-actions > .primary-button,
.opportunity-service-actions > .crm-supply-split-button {
  box-sizing: border-box;
  width: 150px;
  min-width: 150px;
  height: 40px;
  min-height: 40px;
}
.opportunity-service-actions > .primary-button { padding: 0 14px; }
.opportunity-service-actions .crm-service-supply,
.opportunity-service-actions .crm-service-maintenance,
.opportunity-service-actions .crm-service-support {
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.opportunity-service-actions .crm-service-supply { background: #3558d4; }
.opportunity-service-actions .crm-service-maintenance { background: #0878c9; }
.opportunity-service-actions .crm-service-support { background: #006b83; }
.crm-supply-split-button {
  display: inline-flex;
  position: relative;
  height: 40px;
  background: #3558d4;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(53,88,212,.2);
  overflow: visible;
}
.opportunity-service-actions .crm-supply-split-button > .crm-service-supply {
  box-sizing: border-box;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  margin: 0;
  background: #3558d4;
  border: 0;
  border-radius: 8px 0 0 8px;
  box-shadow: none;
}
.crm-supply-project-menu { position: static; }
.crm-supply-project-menu > summary {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 0;
  color: #fff;
  background: #3558d4;
  border-left: 1px solid rgba(255,255,255,.28);
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  list-style: none;
}
.crm-supply-project-menu > summary svg { width: 19px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.crm-supply-project-menu > summary::-webkit-details-marker { display: none; }
.crm-supply-project-menu.disabled { pointer-events: none; opacity: .55; }
.crm-supply-split-button:has(.crm-supply-project-menu[open]) > .crm-service-supply { border-radius: 8px 0 0 0; }
.crm-supply-project-menu[open] > summary { border-radius: 0 8px 0 0; }
.crm-supply-project-menu > div {
  position: absolute;
  z-index: 30;
  top: 100%;
  left: 0;
  right: 0;
  min-width: 100%;
  padding: 0;
  background: #3558d4;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.28);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 24px rgba(31,42,68,.18);
  overflow: hidden;
}
.crm-supply-project-menu > div button { width: 100%; padding: 8px 12px; border: 0; border-radius: 0; background: #3558d4; color: #fff; text-align: left; font-weight: 800; }
.crm-supply-project-menu > div button:hover { background: #2949b5; color: #fff; }
.opportunity-service-linked-groups { margin-top: 10px; }
.opportunity-service-links {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.opportunity-service-links + .opportunity-service-links {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #dddfe5;
}
.opportunity-service-links h4 { margin: 0 0 3px; font-size: 11px; }
.opportunity-service-quote { display: block; width: 100%; text-align: left; padding: 8px 0; border: 0; border-bottom: 1px solid #e5e5e5; border-radius: 0; background: transparent; color: inherit; }
.opportunity-service-quote:hover { color: #3558d4; }
.opportunity-service-quote[class*="quote-row-color-"],
.opportunity-service-quote[class*="quote-row-color-"]:hover {
  color: var(--quote-row-color);
}
.opportunity-service-quote[class*="quote-row-color-"]:hover strong { text-decoration: underline; }
.opportunity-service-quote:focus-visible { outline: 2px solid #3558d4; outline-offset: 2px; }
.quote-row-color-accepted { --quote-row-color: #176039; }
.quote-row-color-rejected { --quote-row-color: #ad3038; }
.quote-row-color-draft { --quote-row-color: #171717; }
.quote-row-color-waiting { --quote-row-color: #b35a08; }
.quote-split-card[class*="quote-row-color-"] .crm-informative-title,
.quote-split-card[class*="quote-row-color-"] .document-code-inline,
.crm-entity-board-card[class*="quote-row-color-"] .commission-board-header h3 {
  color: var(--quote-row-color);
}
.quote-split-card[class*="quote-row-color-"] .crm-informative-split-row {
  border-left: 4px solid var(--quote-row-color);
}
.crm-informative-split-row {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: 17px 19px 19px;
  gap: 1px;
  height: 65px;
  min-height: 65px;
  max-height: 65px;
  padding: 4px 8px;
  overflow: hidden;
  cursor: pointer;
}
.crm-informative-identities,
.crm-informative-footer {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  overflow: hidden;
}
.crm-informative-identities .document-code-inline,
.crm-informative-identities .client-name-highlight {
  box-sizing: border-box;
  height: 17px;
  min-height: 17px;
  margin-top: 0;
  padding: 1px 5px;
  align-items: center;
  line-height: 13px;
}
.crm-informative-identities .document-code-inline {
  flex: 0 0 auto;
  margin-right: 0;
}
.crm-informative-identities .client-name-highlight {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.crm-informative-identities .client-name-highlight strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 13px;
}
.crm-informative-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  line-height: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.crm-informative-footer { justify-content: space-between; }
.crm-informative-footer > :first-child { flex: 0 1 auto; min-width: 0; }
.crm-informative-footer > .quote-status-compact-group {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  min-width: 0;
  gap: 4px;
}
.crm-informative-footer .quote-status-compact-group > .quote-status-display {
  height: 17px;
  min-height: 17px;
  margin-left: 0;
  padding: 0 6px 0 4px;
  border-radius: 999px;
  line-height: 15px;
}
.quote-status-compact-group.status-rejected .quote-traffic-light .red,
.quote-status-compact-group.status-expired .quote-traffic-light .red { background: #ed3d35; box-shadow: 0 0 5px rgba(237, 61, 53, .95); }
.quote-status-compact-group.status-sent .quote-traffic-light .amber { background: #ffc331; box-shadow: 0 0 5px rgba(255, 195, 49, .9); }
.quote-status-compact-group.status-accepted .quote-traffic-light .green { background: #22d36d; box-shadow: 0 0 5px rgba(34, 211, 109, .9); }
.crm-informative-value {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  font-size: 10px;
  line-height: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.crm-informative-value .project-value { padding: 0; }
.service-list-row.crm-informative-split-row {
  width: 100%;
  text-align: left;
}
.service-list-row.crm-informative-split-row > .crm-informative-title {
  font-size: 11px;
  line-height: 17px;
}
.service-list-row.crm-informative-split-row .service-list-row-badges {
  justify-content: flex-start;
  min-width: 0;
  overflow: hidden;
}
.service-list-row.crm-informative-split-row .contract-status {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.commission-board-card.stacked-card-layout .opportunity-card-actions .primary-button.compact {
  flex: 0 0 auto;
  width: auto;
  min-width: 76px;
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}
.repair-activity-row { display:flex; align-items:center; gap:12px; padding:10px 12px; margin:6px 0; border:1px solid #dce1ef; border-radius:12px; background:#f7f8fc; }
.repair-activity-completed { display:flex; align-items:center; gap:8px; padding:5px 0; color:#66716d; font-size:12px; border-bottom:1px solid #e5e9e6; }
.repair-activity-completed > span:not(.repair-activity-completed-title) { flex-shrink:0; }
.repair-activity-completed-title { min-width:0; overflow-wrap:anywhere; }
.repair-activity-copy { display:grid; gap:4px; min-width:0; flex:1; }
.repair-activity-copy .document-code-badge { justify-self:start; }
.repair-activity-copy strong, .repair-activity-copy small { overflow-wrap:anywhere; }
.repair-activity-copy small { color:#66716d; }
.repair-activity-status { font-size:12px; font-weight:700; }
.repair-activity-actions { display:flex; gap:6px; flex-wrap:wrap; }
.repair-activity-actions button { min-width:125px; }
@media (max-width:760px) { .repair-activity-row { flex-wrap:wrap; } .repair-activity-copy { flex-basis:70%; } .repair-activity-actions { width:100%; } }
.purchase-stock-choice { margin:4px 0; font-size:12px; }
.purchase-stock-choice > summary { color:#b42318; font-weight:700; cursor:pointer; list-style:none; }
.purchase-stock-choice > summary::-webkit-details-marker { display:none; }
.purchase-stock-selection { display:grid; gap:8px; padding:8px 0; }
.purchase-stock-devices { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:6px; max-height:220px; overflow:auto; }
.purchase-stock-device { display:grid; gap:2px; min-height:35px; padding:4px 10px; line-height:1.2; text-align:left; cursor:pointer; border:1px solid #dce1ef; border-radius:10px; background:#fff; color:#25334a; box-shadow:none; }
.purchase-stock-device[aria-pressed="true"] { background:#edf2ff; border-color:#3553d9; box-shadow:inset 0 0 0 1px #3553d9; }
.purchase-stock-device:focus-visible { outline:2px solid #3553d9; outline-offset:2px; }
.purchase-stock-device span, .purchase-stock-device strong { overflow-wrap:anywhere; }
.purchase-stock-selection > button { justify-self:start; min-height:35px; }
#purchase-draft-content .purchase-draft-line, .purchase-draft-columns { display:grid; grid-template-columns: minmax(115px,.9fr) minmax(160px,1.8fr) 65px minmax(135px,1.1fr) minmax(155px,1.2fr) 90px 80px; gap:7px; align-items:center; min-width:970px; box-sizing:border-box; margin:0; }
#purchase-draft-content .purchase-draft-line { padding:5px 8px; }
.purchase-draft-columns { padding:0 8px; border:1px solid transparent; font-size:10px; font-weight:700; color:var(--muted); }
.purchase-draft-origin { overflow-x:auto; }
#purchase-draft-content .purchase-draft-code { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.purchase-draft-description { min-width:0; font-size:12px; }
.purchase-draft-description > summary { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; font-weight:600; }
.purchase-draft-description-details { display:grid; gap:6px; padding:8px 0; white-space:normal; }
#purchase-draft-content .purchase-draft-line .field > span:first-child, #purchase-draft-content .purchase-draft-availability > small { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
#purchase-draft-content .purchase-draft-availability { align-self:center; }
#purchase-draft-content .purchase-draft-line > *, #purchase-draft-content .purchase-draft-line .field { align-self:center; margin:0; }
#purchase-draft-content .purchase-draft-line .field { display:flex; align-items:center; padding:0; gap:0; height:35px; }
#purchase-draft-content .purchase-draft-line input, #purchase-draft-content .purchase-draft-line select { box-sizing:border-box; height:35px; min-height:35px; margin:0; padding:5px 8px; }
#purchase-draft-content .purchase-draft-cost, #purchase-draft-content .purchase-draft-availability { align-self:center; gap:0; padding:0; margin:0; }
#purchase-draft-content .purchase-draft-availability { display:flex; align-items:center; min-height:35px; }
#purchase-draft-content .purchase-draft-line, .purchase-draft-columns { grid-template-columns:minmax(65px,.65fr) minmax(160px,1.5fr) 100px minmax(265px,1.6fr) minmax(150px,1fr) 90px 80px; }
#purchase-draft-content strong.purchase-draft-description { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.purchase-draft-quantity-stock, .purchase-draft-classification-group { display:flex; align-items:center; gap:5px; min-width:0; }
.purchase-draft-quantity-stock .field, .purchase-draft-classification-group .field { flex:1; min-width:0; }
.purchase-stock-icon { display:grid; place-items:center; width:30px; height:35px; min-width:30px; padding:5px; border:1px solid #e7bdb9; border-radius:8px; background:#fff1ef; color:#b42318; box-shadow:none; }
.purchase-stock-icon svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.purchase-stock-icon:disabled { color:#9298a1; background:#f0f1f3; border-color:#e0e2e6; cursor:default; opacity:1; }
.purchase-classification-confidence { display:inline-flex; align-items:center; justify-content:center; gap:5px; width:70px; min-width:70px; height:35px; min-height:35px; padding:0 6px; flex:0 0 70px; border:0; border-radius:7px; font-size:11px; font-weight:700; color:#287345; background:#e3f4e9; white-space:nowrap; box-shadow:none; }
.purchase-classification-confidence:disabled { opacity:1; cursor:default; }
.purchase-classification-confidence:not(:disabled) { cursor:pointer; }
.purchase-classification-confidence:focus-visible { outline:2px solid #3553d9; outline-offset:2px; }
.purchase-classification-confidence.needs-review { color:#875400; background:#fff0ce; }
.purchase-classification-confidence button { display:grid; place-items:center; width:22px; height:22px; min-height:0; padding:1px; border:0; background:transparent; box-shadow:none; border-radius:4px; }
.purchase-classification-confidence img { width:20px; height:20px; flex:0 0 20px; object-fit:contain; }
#purchase-stock-choice-dialog { width:min(640px,90vw); }
.purchase-stock-dialog-body { padding:16px; }
.purchase-stock-dialog-body > header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.purchase-stock-dialog-body > header button { width:35px; height:35px; flex-shrink:0; }
.purchase-stock-dialog-body .purchase-stock-choice > summary { display:none; }
.purchase-order-list-column .purchase-order-lines { overflow-x:auto; }
.purchase-order-list-column .purchase-order-line { grid-template-columns: minmax(105px,.8fr) minmax(140px,1.4fr) minmax(120px,1fr) 58px 82px 90px 110px; min-width:770px; gap:7px; padding:6px 8px; align-items:center; }
.purchase-order-line .purchase-line-code, .purchase-order-line .purchase-line-description, .purchase-order-line .purchase-line-destination-text { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; font-size:12px; }
.purchase-order-line .purchase-cost-changed { color:#b42318; font-weight:700; }
.purchase-order-line > button { height:35px; padding:5px 8px; font-size:11px; }
.purchase-orders-column-head > .purchase-status-filters { display:flex; flex-direction:row; align-items:center; gap:6px; flex-wrap:nowrap; flex-shrink:0; }
.purchase-status-filters button { width:auto; flex:0 0 auto; height:35px; padding:5px 10px; font-size:12px; white-space:nowrap; }
.purchase-status-filters [aria-pressed="true"] { color:#fff; background:#3553d9; border-color:#3553d9; }
.purchase-order-list-column .purchase-order-card > header { grid-template-columns:minmax(150px,1fr) auto auto; background:#edf2ff; padding:9px; border-bottom:1px solid #ccd7f7; }
.purchase-order-card > header .purchase-order-supplier { color:#243e9b; font-size:15px; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.purchase-order-card > header .document-code-badge { flex-shrink:0; font-size:15px; font-weight:800; line-height:1.3; padding:5px 8px; }
.purchase-order-actions [data-action="cancel-purchase-order"], .purchase-order-line [data-action="prepare-purchase-receipt"] { box-sizing:border-box; width:110px; min-width:110px; height:35px; min-height:35px; padding:5px 8px; font-size:11px; white-space:nowrap; }
.purchase-order-column-head { display:grid; grid-template-columns:minmax(105px,.8fr) minmax(140px,1.4fr) minmax(120px,1fr) 58px 82px 90px 110px; min-width:770px; gap:7px; align-items:center; padding:7px 8px; font-size:10px; font-weight:700; color:var(--muted); border-bottom:1px solid var(--border); }
.purchase-order-column-head > span:nth-child(n+4):nth-child(-n+6) { text-align:right; }
.purchase-order-total { display:flex; justify-content:flex-end; padding:9px; border-top:1px solid var(--border); }
.purchase-order-total > span { display:flex; align-items:baseline; gap:10px; padding:7px 11px; background:#edf2ff; border-radius:8px; color:#243e9b; font-size:12px; font-weight:600; }
.purchase-order-total strong { font-size:19px; font-weight:800; font-variant-numeric:tabular-nums; }
@media(max-width:760px) { .purchase-order-list-column .purchase-order-card > header { grid-template-columns:1fr auto; } .purchase-order-actions { grid-column:1 / -1; } }
.purchase-order-card.is-partially-canceled { background:var(--surface-raised,#fff); border-color:#e5bd81; }
.purchase-order-card.is-partially-canceled .purchase-order-state, .business-badge.purchase-partial-canceled-badge { color:#925300; background:#ffebcc; border-color:#e8b66c; }
.purchase-order-card .purchase-order-line.is-received { background:#edf7ee; }
.purchase-order-card .purchase-order-line.is-line-canceled { background:#fbe9e8; }
.purchase-order-card .purchase-order-line.is-partial-canceled { background:#fff5e5; }
.business-badge.purchase-received-badge { color:#27653c; background:#dff0e3; border-color:#b1d5ba; }

.goods-issue-address-inline { display:flex; align-items:stretch; gap:8px; min-width:0; }
.goods-issue-address-inline > input { flex:1 1 0; min-width:0; width:0; }
.goods-issue-address-inline > .goods-issue-address-add {
  display:inline-flex; align-items:center; justify-content:center;
  flex:0 0 35px; width:35px; min-width:35px; min-height:35px;
  padding:0; margin:0; border:1px solid #3655d9; border-radius:10px;
  background:#3655d9; color:#fff; font-size:24px; line-height:1; box-shadow:none;
}
.goods-issue-address-inline > .goods-issue-address-add:hover { background:#2944bb; border-color:#2944bb; }
.goods-issue-address-inline > .goods-issue-address-add { position:relative; font-size:0; }
.goods-issue-address-inline > .goods-issue-address-add::before,
.goods-issue-address-inline > .goods-issue-address-add::after {
  content:""; position:absolute; top:50%; left:50%;
  transform:translate(-50%,-50%); background:currentColor; border-radius:1px;
  margin:0; padding:0;
}
.goods-issue-address-inline > .goods-issue-address-add::before { width:12px; height:2px; }
.goods-issue-address-inline > .goods-issue-address-add::after { width:2px; height:12px; }

.goods-issue-material-main > .goods-issue-product-summary { display:flex; align-items:center; gap:10px; min-width:0; }
.goods-issue-material-main > .goods-issue-product-summary b { flex:0 0 auto; font-size:12px; }
.goods-issue-material-main > .goods-issue-product-summary strong { min-width:0; font-size:12px; }
.goods-issue-material-main { min-height:44px; align-items:center; }
.goods-issue-units { padding:8px; gap:6px; }
.goods-issue-units > div { display:grid; grid-template-columns:minmax(0,1fr); gap:6px; }
.goods-issue-units label { display:flex; width:100%; min-width:0; min-height:36px; box-sizing:border-box; padding:7px 10px; gap:10px; font-size:12px; }
.goods-issue-units label > span { min-width:0; white-space:nowrap; overflow-x:auto; }
.goods-issue-material input.goods-issue-material-check,
.goods-issue-material input.goods-issue-unit-check {
  width:18px; height:18px; min-width:18px; min-height:18px; max-width:18px; max-height:18px;
  flex:0 0 18px; padding:0; margin:0; box-sizing:border-box; accent-color:#3655d9;
}

.goods-issue-material input.goods-issue-material-check:indeterminate {
  appearance:none; border:1px solid #a8b9f0; border-radius:3px;
  background-color:#edf2ff;
  background-image:linear-gradient(#8da4e8,#8da4e8),linear-gradient(#8da4e8,#8da4e8);
  background-size:10px 2px,2px 10px; background-position:center; background-repeat:no-repeat;
}

/* Modulo fatturazione: coda compatta e leggibile, coerente con i pannelli amministrativi. */
.billing-page { display: grid; gap: 12px; }
.billing-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcff; }
.billing-page-head h2 { margin: 1px 0 4px; }
.billing-page-head p:last-child { margin: 0; color: var(--ink-soft); }
.billing-page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.billing-summary { display: grid; grid-template-columns: repeat(4, minmax(125px, 1fr)); gap: 8px; }
.billing-stat { display: grid; grid-template-columns: 1fr auto; align-items: baseline; min-height: 72px; padding: 10px 12px; border: 1px solid #dce2ec; border-radius: 12px; background: #f7f9fc; }
.billing-stat span { grid-column: 1 / -1; color: #526071; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.billing-stat strong { font-size: 23px; line-height: 1; }
.billing-stat small { color: #344054; font-weight: 700; }
.billing-stat.ready { background: #edf9f3; border-color: #a7dec1; }
.billing-stat.review { background: #fff7e8; border-color: #efce88; }
.billing-stat.blocked { background: #fff0ed; border-color: #efb7aa; }
.billing-history { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 9px 12px; border: 1px solid #bdd4ed; border-radius: 12px; background: #eef6ff; }
.billing-history > div { display: grid; gap: 2px; }
.billing-history span, .billing-history-state { color: #4f6074; font-size: 12px; }
.billing-history-state { text-align: right; }
.billing-reconciliation { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px 14px; min-height: 52px; padding: 9px 12px; border: 1px solid #d8d1ef; border-radius: 12px; background: #f7f4ff; }
.billing-reconciliation-copy { display: grid; gap: 2px; min-width: 0; }
.billing-reconciliation-copy span { color: #5f6172; font-size: 12px; }
.billing-reconciliation-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.billing-reconciliation-stats span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid #d6d9e1; border-radius: 999px; background: #fff; color: #566173; font-size: 11px; font-weight: 750; white-space: nowrap; }
.billing-reconciliation-stats span.certain { color: #12643e; border-color: #9cd5b8; background: #eaf8f1; }
.billing-reconciliation-stats span.probable { color: #855600; border-color: #e6c373; background: #fff5dc; }
.billing-reconciliation-stats span.unmatched { color: #8b3b30; border-color: #e2b1a8; background: #fff0ed; }
.billing-reconciliation-stats span.confirmed { color: #244f86; border-color: #a9c5e7; background: #edf5ff; }
.billing-confirmed-toggle { display: inline-flex; align-items: center; gap: 4px; min-height: 27px; padding: 4px 9px; border: 1px solid #a9c5e7; border-radius: 999px; background: #edf5ff; color: #244f86; font: inherit; font-size: 11px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.billing-confirmed-toggle:hover { border-color: #6d9ccc; background: #e2effd; }
.billing-confirmed-history { grid-column: 1 / -1; min-width: 0; overflow: hidden; border: 1px solid #c9d8ea; border-radius: 10px; background: #fff; }
.billing-confirmed-history > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 6px 9px; border-bottom: 1px solid #d8e1ec; background: #edf5ff; }
.billing-confirmed-history > header > span { display: grid; gap: 1px; }
.billing-confirmed-history > header small { color: #5d6d80; font-size: 10px; font-weight: 500; }
.billing-confirmed-history > header > b { display: grid; place-items: center; min-width: 27px; height: 27px; border: 1px solid #a9c5e7; border-radius: 999px; background: #fff; color: #244f86; font-size: 11px; }
.billing-confirmed-list { display: grid; gap: 5px; max-height: min(42vh, 430px); padding: 6px; overflow: auto; }
.billing-confirmed-row { display: grid; grid-template-columns: minmax(220px, 1.1fr) 24px minmax(230px, 1.15fr) minmax(135px, .55fr) auto; align-items: center; gap: 8px; min-height: 56px; padding: 6px 8px; border: 1px solid #dce3ed; border-left: 4px solid #4f79b7; border-radius: 9px; background: #fbfdff; }
.billing-confirmed-row.reopened { border-left-color: #c28a31; background: #fffaf0; }
.billing-confirmed-prisma, .billing-confirmed-document, .billing-confirmed-audit { display: grid; gap: 1px; min-width: 0; }
.billing-confirmed-row span { color: #5c6c7e; font-size: 9px; font-weight: 800; letter-spacing: .025em; text-transform: uppercase; }
.billing-confirmed-row strong, .billing-confirmed-row small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-confirmed-row strong { color: #25364d; font-size: 11px; }
.billing-confirmed-row small { color: #677486; font-size: 10px; }
.billing-confirmed-link { color: #5f7fa8; font-size: 15px; font-weight: 850; text-align: center; }
.billing-confirmed-audit { padding-left: 8px; border-left: 1px solid #dce3ed; }
.billing-confirmed-detail-audit { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; margin-top: 9px; padding: 9px 11px; border: 1px solid #b9cde4; border-radius: 9px; background: #edf5ff; color: #38516f; font-size: 11px; }
.billing-confirmed-detail-audit small { grid-column: 1 / -1; color: #5d6d80; }
.billing-reopen-action { border-color: #d1a65e; background: #fff7e8; color: #774f0c; }
.billing-toolbar { display: grid; grid-template-columns: 170px minmax(210px, 270px) minmax(260px, 1fr); gap: 8px; align-items: end; }
.billing-toolbar .field { margin: 0; }
.billing-toolbar input, .billing-toolbar select { height: 35px; }
.billing-queue-panel { overflow: hidden; border: 1px solid #d7dde7; border-radius: 14px; background: #fff; }
.billing-queue-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #dfe4ec; background: #f4f7fb; }
.billing-queue-head span { color: #667085; font-size: 12px; }
.billing-item-list { display: grid; gap: 6px; padding: 7px; max-height: min(58vh, 650px); overflow: auto; }
.billing-item { display: grid; grid-template-columns: minmax(260px, 1.7fr) minmax(155px, .65fr) 115px minmax(150px, .65fr); align-items: center; gap: 10px; min-height: 62px; padding: 7px 10px; border: 1px solid #dfe4ec; border-left-width: 4px; border-radius: 10px; background: #fff; }
.billing-item.ready { border-left-color: #2fa36b; }
.billing-item.billing-multiple-selected { border-color: #3656cc; background: #f5f8ff; }
.billing-multiple-select { grid-column: 1 / -1; justify-self: start; }
.billing-multiple-select[aria-pressed="true"] { color: #2747bb; border-color: #3656cc; background: #e5eeff; }
.billing-multiple-dialog { width: min(1050px, calc(100vw - 30px)); }
.billing-multiple-dialog .crm-dialog-form { padding: 18px; display: grid; gap: 10px; }
.billing-multiple-sources, .billing-multiple-invoice { border: 1px solid #d4def0; border-radius: 10px; overflow: hidden; background: #fbfdff; }
.billing-multiple-sources header, .billing-multiple-invoice header { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; background: #edf3ff; }
.billing-multiple-sources > div, .billing-multiple-choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; }
.billing-multiple-sources small, .billing-multiple-choice small { display: block; color: #667085; font-size: 11px; }
.billing-multiple-sources b, .billing-multiple-choice b { white-space: nowrap; }
.billing-multiple-suggestions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.billing-multiple-suggestions small { flex-basis: 100%; color: #667085; }
.billing-multiple-candidates { display: grid; gap: 8px; max-height: 42vh; overflow: auto; }
.billing-multiple-choice { width: 100%; min-height: 35px; text-align: left; color: var(--ink); border: 0; border-top: 1px solid #dfe6f2; background: #fff; cursor: pointer; }
.billing-multiple-choice.selected { background: #e5eeff; box-shadow: inset 3px 0 #3656cc; }
.billing-multiple-choice:disabled { opacity: .5; cursor: default; }
.billing-multiple-choice:focus-visible { outline: 2px solid #3656cc; outline-offset: -2px; }
.billing-multiple-footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.billing-multiple-footer p { margin: 0; font-weight: 700; }
.billing-multiple-footer .has-difference { color: #a7442c; }
.billing-item.review { border-left-color: #e6a429; }
.billing-item.blocked { border-left-color: #d45d4c; }
.billing-item.excluded { border-left-color: #98a2b3; opacity: .72; }
.billing-item-main, .billing-item-period, .billing-item-amount, .billing-item-state { display: grid; gap: 2px; min-width: 0; }
.billing-kind { color: #526274; font-size: 10px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.billing-item-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-item-main small, .billing-item-state small { overflow: hidden; color: #667085; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.billing-item-period span, .billing-item-amount span { color: #667085; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.billing-item-amount { text-align: right; }
.billing-state-badge { justify-self: start; padding: 3px 7px; border: 1px solid #cbd5e1; border-radius: 999px; background: #f5f7fa; font-size: 10px; font-weight: 800; }
.billing-state-badge.ready { color: #12643e; border-color: #8dd0ae; background: #e8f7ef; }
.billing-state-badge.review { color: #8a5a00; border-color: #e5bf6d; background: #fff4d8; }
.billing-state-badge.blocked { color: #963928; border-color: #e4aa9e; background: #ffede9; }
.billing-item-suggestion { grid-column: 1 / -1; display: grid; grid-template-columns: 150px 185px minmax(220px, 1fr) minmax(240px, 1.2fr); align-items: center; gap: 8px; min-height: 30px; margin: 1px -3px -2px; padding: 4px 7px; border: 1px solid #e2d5a9; border-radius: 7px; background: #fff9e9; color: #5e5131; font-size: 10px; }
.billing-item-suggestion.certain { border-color: #a8d7bd; background: #edf9f2; color: #245c3f; }
.billing-item-suggestion span { font-weight: 850; text-transform: uppercase; letter-spacing: .025em; }
.billing-item-suggestion strong, .billing-item-suggestion em, .billing-item-suggestion small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; }
.billing-item-suggestion small { color: inherit; opacity: .82; }
.billing-document-source { display: inline-flex; align-items: center; width: max-content; margin-right: 5px; padding: 2px 6px; border: 1px solid #b8c4d4; border-radius: 999px; background: #f1f5f9; color: #4b5d73; font-size: 9px; font-style: normal; font-weight: 850; line-height: 1.2; text-transform: uppercase; white-space: nowrap; }
.billing-document-source.legacy { border-color: #d7bd7b; background: #fff5d9; color: #78570d; }
.billing-document-source.prisma { border-color: #9ec9b2; background: #eaf8f1; color: #17613e; }
.billing-suggestion-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; padding-top: 2px; }
.billing-suggestion-actions .compact { min-height: 30px; padding: 4px 10px; font-size: 11px; }
.billing-item-manual { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; margin: 1px -3px -2px; padding: 4px 7px; border: 1px dashed #d8d0bc; border-radius: 7px; background: #fffcf4; color: #6d6249; font-size: 11px; }
.billing-match-dialog { width: min(980px, calc(100vw - 28px)); }
.billing-match-dialog .crm-dialog-form { display: grid; gap: 10px; max-height: min(82vh, 760px); }
.billing-match-search input { height: 35px; }
.billing-match-summary { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; min-height: 35px; padding: 5px 9px; border: 1px solid #cbd9ea; border-radius: 9px; background: #eef6ff; }
.billing-match-summary span, .billing-match-summary small { color: #667085; font-size: 11px; }
.billing-match-summary strong { color: #244f86; }
.billing-match-results { display: grid; gap: 6px; min-height: 160px; max-height: min(52vh, 480px); overflow: auto; }
.billing-match-row { display: grid; grid-template-columns: 145px minmax(260px, 1fr) 125px auto; align-items: center; gap: 9px; min-height: 58px; padding: 6px 8px; border: 1px solid #dfe4ec; border-left-width: 4px; border-radius: 9px; background: #fff; }
.billing-match-row.certain { border-left-color: #2fa36b; }
.billing-match-row.probable { border-left-color: #e6a429; }
.billing-match-row.weak { border-left-color: #98a2b3; }
.billing-match-row > div { display: grid; gap: 2px; min-width: 0; }
.billing-match-row span, .billing-match-row small { color: #667085; font-size: 10px; }
.billing-match-description strong, .billing-match-description small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-match-amount { text-align: right; }
.billing-match-reason { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-item-suggestion { grid-template-columns: 1fr; align-items: stretch; min-height: 0; padding: 7px; }
.billing-comparison { display: grid; gap: 7px; min-width: 0; }
.billing-comparison-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px; }
.billing-comparison-head strong { color: #815600; font-size: 10px; letter-spacing: .025em; text-transform: uppercase; }
.billing-comparison.certain .billing-comparison-head strong { color: #17613e; }
.billing-comparison-head small { overflow: hidden; color: #6b6250; font-size: 10px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.billing-comparison-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.billing-comparison-source { display: grid; gap: 5px; min-width: 0; padding: 7px 9px; border: 1px solid #cbd8e8; border-radius: 8px; background: #f3f8ff; }
.billing-comparison-source.excel { border-color: #dfc987; background: #fff9e8; }
.billing-comparison-source header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.billing-comparison-source header span { color: #667085; font-size: 9px; font-weight: 750; letter-spacing: .025em; text-transform: uppercase; }
.billing-comparison-source > strong { overflow: hidden; color: #25354b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.billing-comparison-source dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; margin: 0; }
.billing-comparison-source dl > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 5px; min-width: 0; }
.billing-comparison-source dt { color: #697586; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.billing-comparison-source dd { min-width: 0; margin: 0; overflow: hidden; color: #26364b; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.billing-comparison.detailed { gap: 10px; }
.billing-comparison.detailed .billing-comparison-source { min-height: 185px; align-content: start; padding: 12px; }
.billing-comparison.detailed .billing-comparison-source > strong { font-size: 14px; white-space: normal; }
.billing-comparison.detailed .billing-comparison-source dl { grid-template-columns: 1fr; gap: 8px; margin-top: 6px; }
.billing-comparison.detailed .billing-comparison-source dl > div { grid-template-columns: 92px minmax(0, 1fr); }
.billing-comparison.detailed .billing-comparison-source dt, .billing-comparison.detailed .billing-comparison-source dd { font-size: 11px; }
.billing-comparison.detailed .billing-comparison-source dd { white-space: normal; }
.billing-comparison-dialog { width: min(960px, calc(100vw - 28px)); }
.billing-comparison-dialog .crm-dialog-form { min-width: 0; overflow: hidden; }
.billing-comparison-dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.billing-comparison-dialog-actions button { width: 100%; min-width: 0; }
.billing-comparison-dialog-actions button:only-child { grid-column: 1 / -1; }
.billing-ready-action { border-color: #77b394; background: #eef9f3; color: #17613e; }
.billing-item-manual > span { display: grid; gap: 1px; }
.billing-item-manual > span small { color: #716750; font-size: 10px; }
.billing-item-manual > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

@media (max-width: 980px) {
  .billing-page-head, .billing-history { align-items: stretch; flex-direction: column; }
  .billing-reconciliation { grid-template-columns: 1fr; align-items: stretch; }
  .billing-page-actions { justify-content: flex-start; }
  .billing-summary { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .billing-toolbar { grid-template-columns: 1fr 1fr; }
  .billing-search { grid-column: 1 / -1; }
  .billing-item { grid-template-columns: minmax(210px, 1fr) 125px 120px; }
  .billing-item-state { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; }
  .billing-item-suggestion { grid-template-columns: 145px minmax(160px, .75fr) minmax(220px, 1fr); }
  .billing-item-suggestion small { grid-column: 1 / -1; }
  .billing-match-row { grid-template-columns: 125px minmax(200px, 1fr) 110px auto; }
  .billing-item-suggestion { grid-template-columns: 1fr; }
  .billing-comparison-columns { grid-template-columns: 1fr; }
  .billing-history-state { text-align: left; }
  .billing-reconciliation-stats { justify-content: flex-start; }
  .billing-confirmed-row { grid-template-columns: 1fr 22px 1fr auto; }
  .billing-confirmed-audit { grid-column: 1 / -2; padding: 5px 0 0; border-top: 1px solid #dce3ed; border-left: 0; }
}

@media (max-width: 620px) {
  .billing-summary, .billing-toolbar { grid-template-columns: 1fr; }
  .billing-search { grid-column: auto; }
  .billing-item { grid-template-columns: 1fr auto; }
  .billing-item-period { grid-column: 1; }
  .billing-item-amount { grid-column: 2; grid-row: 1 / span 2; }
  .billing-item-state { grid-column: 1 / -1; }
  .billing-item-suggestion { grid-template-columns: 1fr; }
  .billing-item-suggestion small { grid-column: auto; }
  .billing-suggestion-actions { justify-content: flex-start; flex-wrap: wrap; }
  .billing-item-manual { align-items: stretch; flex-direction: column; }
  .billing-match-summary, .billing-match-row { grid-template-columns: 1fr auto; }
  .billing-match-description, .billing-match-reason { grid-column: 1 / -1; }
  .billing-match-amount { grid-column: 1; text-align: left; }
  .billing-comparison-dialog-actions { grid-template-columns: 1fr; }
  .billing-confirmed-row { grid-template-columns: 1fr auto; }
  .billing-confirmed-link { display: none; }
  .billing-confirmed-document, .billing-confirmed-audit { grid-column: 1 / -1; }
  .billing-confirmed-row > button { grid-column: 2; grid-row: 1; }
  .billing-confirmed-detail-audit { grid-template-columns: 1fr; }
  .billing-confirmed-detail-audit small { grid-column: auto; }
}

.billing-proposals { display: grid; gap: 8px; padding: 10px; border: 1px solid #c9d7ed; border-radius: 12px; background: #f4f8ff; }
.billing-proposal > header > .billing-proposal-actions,
.billing-proposal-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; align-self: center; }
.billing-proposal-line > .billing-proposal-actions { flex-wrap: nowrap; }
.billing-manual-note { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 9px; color: var(--ink-soft); font-size: .75rem; }
.billing-manual-dialog { width: min(1050px, calc(100vw - 28px)); }
.billing-manual-dialog .crm-dialog-form { display: grid; gap: 10px; max-height: 85vh; overflow-y: auto; }
.billing-manual-fields { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr); gap: 8px; padding: 9px; background: #f3f8ff; border: 1px solid #d5e1f1; border-radius: 10px; }
.billing-quote-editor { width: min(1360px, 96vw); }
.billing-shared-quote-host { min-width: 0; }
.billing-quote-editor .quote-builder { margin: 0; }
.billing-quote-editor .quote-builder-row { align-items: end; }
.billing-quote-editor .quote-builder-row input,
.billing-quote-editor .quote-builder-row button { height: 35px; min-height: 35px; }
.billing-quote-editor .quote-subscription-products-heading,
.billing-quote-editor .quote-fulfillment-route,
.billing-quote-editor .quote-work-association-markers { display: none; }
.billing-quote-footer { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.billing-quote-footer > .field { flex: 0 1 220px; }
.billing-quote-footer > .billing-manual-total { flex: 1 1 320px; }
.billing-manual-lines { display: grid; gap: 6px; }
.billing-manual-line { display: grid; grid-template-columns: minmax(190px, 1fr) 70px 65px 100px 140px 35px; gap: 7px; align-items: end; padding: 8px; border: 1px solid #c7d8ed; border-radius: 10px; background: #edf5ff; }
.billing-manual-dialog .field { min-width: 0; }
.billing-manual-dialog .field input, .billing-manual-dialog .field select { height: 35px; min-height: 35px; min-width: 0; width: 100%; padding: 0 8px; border: 1px solid #b9cae5; border-radius: 8px; }
.billing-manual-line .icon-button { width: 35px; height: 35px; min-width: 35px; min-height: 35px; }
.billing-manual-total { padding: 8px 10px; text-align: right; border: 1px solid #bfd3eb; border-radius: 9px; background: #e4effc; font-weight: 700; }
@media (max-width: 780px) {
  .billing-manual-fields { grid-template-columns: 1fr 1fr; }
  .billing-manual-customer { grid-column: 1 / -1; }
  .billing-manual-line { grid-template-columns: 1fr 1fr 1fr 35px; }
  .billing-manual-line > label:first-child { grid-column: 1 / -1; }
  .billing-manual-line > label:nth-child(5) { grid-column: 1 / 4; }
  .billing-proposal-line > .billing-proposal-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
.atera-dialog { width: min(1280px, 96vw); padding: 16px; }
.atera-help { color: var(--ink-soft); font-size: .78rem; margin: 6px 0; }
.atera-settings { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto auto; gap: 8px; align-items: end; padding: 10px; background: #f3f8ff; border: 1px solid #c6d8ec; border-radius: 10px; }
.atera-settings .field,.atera-record .field { min-width: 0; }
.atera-dialog input:not([type=checkbox]),.atera-dialog select,.atera-settings input:not([type=checkbox]) { width: 100%; min-width: 0; height: 35px; min-height: 35px; border: 1px solid #bacfe8; border-radius: 8px; padding: 0 8px; background: #fff; }
.atera-dialog button:not(.icon-button) { min-height: 35px; }
.atera-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 6px; }
.atera-tabs { display: flex; gap: 5px; }
.atera-tabs .active { color: #fff; background: var(--accent, #3d55ce); }
.atera-toolbar .atera-search { width: auto; flex: 1 1 230px; }
.atera-source-panel { background: #f1f7ff; border: 1px solid #bacfe8; border-radius: 10px; padding: 10px; margin: 8px 0; }
.atera-source-panel .atera-toolbar { align-items: flex-end; margin: 6px 0; }
.atera-source-panel .field { flex: 1 1 190px; min-width: 0; }
.atera-source-panel button { min-height: 35px; }
.atera-comparison { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; border: 1px solid #bacfe8; border-radius: 10px; padding: 10px; margin: 8px 0; background: #f1f7ff; }
.atera-comparison > div { min-width: 0; overflow-wrap: anywhere; }
.atera-comparison small,.atera-comparison span { display: block; }
.atera-comparison p { margin: 6px 0; }
.atera-ambiguous { background: #fff4dc !important; border: 1px solid #dda238 !important; border-left: 4px solid #dda238 !important; }
@media (max-width: 650px) { .atera-comparison { grid-template-columns: minmax(0,1fr); } }
.atera-status { font-size: .75rem; color: var(--ink-soft); margin-bottom: 8px; }
.atera-records { display: grid; gap: 6px; }
.atera-record { display: grid; grid-template-columns: minmax(250px, 1.4fr) minmax(200px, 1fr) auto; align-items: center; gap: 8px; padding: 9px; border: 1px solid #bfd2e9; border-radius: 10px; background: #edf5ff; }
.atera-record > div { min-width: 0; display: grid; gap: 3px; }
.atera-record strong { font-size: .86rem; overflow-wrap: anywhere; }
.atera-record small { font-size: .72rem; overflow-wrap: anywhere; }
.atera-alert { color: #995811; }
.atera-fields { grid-column: 1 / -1; font-size: .72rem; overflow-wrap: anywhere; }
.atera-invoice { grid-template-columns: minmax(0,1fr) auto; }
.atera-detail { margin-top: 10px; padding: 12px; border: 1px solid #b6cce5; border-radius: 10px; background: #e5f0ff; }
.atera-line-table { display: grid; gap: 4px; font-size: .8rem; }
.atera-line-table > div { display: grid; grid-template-columns: minmax(150px,1fr) 80px 100px 100px; gap: 8px; border-radius: 7px; padding: 7px; background: #fff; }
.atera-line-table small { display: block; color: var(--ink-soft); }
.atera-line-table .atera-line-head { background: #d5e5fa; font-weight: 700; }
@media(max-width: 850px) { .atera-settings,.atera-record { grid-template-columns: minmax(0,1fr); } .atera-line-table { overflow-x: auto; } .atera-line-table > div { min-width: 500px; } }
.billing-proposals-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.billing-proposals-head > div { display: grid; gap: 2px; }
.billing-proposals-head small { color: var(--ink-soft); font-size: .76rem; }
.billing-proposals-head > span { padding: 5px 9px; border: 1px solid #c5d5ee; border-radius: 9px; background: #fff; font-size: .76rem; white-space: nowrap; }
.billing-proposal-list { display: grid; gap: 8px; }
.billing-proposal { overflow: hidden; border: 1px solid #b9cae5; border-radius: 11px; background: #fff; }
.billing-proposal > header { display: grid; grid-template-columns: minmax(220px,1fr) auto auto; align-items: center; gap: 12px; padding: 7px 9px; background: #e9f1fd; }
.billing-proposal > header > div { display: grid; gap: 1px; }
.billing-proposal > header span,.billing-proposal > header small { color: var(--ink-soft); font-size: .7rem; }
.billing-proposal > header > div:nth-child(2) { text-align: right; }
.billing-proposal-lines { display: grid; gap: 1px; background: #dce6f5; }
.billing-proposal-line { display: grid; grid-template-columns: minmax(260px,1fr) 78px 105px 74px 105px auto; align-items: end; gap: 7px; padding: 6px 8px; background: #fbfdff; }
.billing-proposal-line label { display: grid; gap: 2px; min-width: 0; }
.billing-proposal-line label > span { color: var(--ink-soft); font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.billing-proposal-line input { width: 100%; height: 35px; min-width: 0; padding: 0 8px; border: 1px solid #b9cae5; border-radius: 8px; background: #fff; }
.billing-proposal-line > strong { align-self: center; text-align: right; white-space: nowrap; }
.billing-proposal-line > button { align-self: center; }
@media (max-width: 980px) {
  .billing-proposal-line { grid-template-columns: minmax(220px,1fr) 70px 96px 70px; }
  .billing-proposal-line > strong,.billing-proposal-line > button { grid-row: 2; }
  .billing-proposal-line > strong { grid-column: 3; }
  .billing-proposal-line > button { grid-column: 4; }
}
@media (max-width: 700px) {
  .billing-proposals-head,.billing-proposal > header { align-items: stretch; grid-template-columns: 1fr; flex-direction: column; }
  .billing-proposal > header > div:nth-child(2) { text-align: left; }
  .billing-proposal-line { grid-template-columns: 1fr 70px; }
  .billing-proposal-line label:first-child { grid-column: 1 / -1; }
  .billing-proposal-line > strong { grid-column: 1; grid-row: auto; text-align: left; }
  .billing-proposal-line > button { grid-column: 2; grid-row: auto; }
}
