:root {
  --ink: var(--text-primary, #071C24);
  --muted: var(--text-secondary, #56666B);
  --line: var(--border, #C8CEC9);
  --soft: var(--background, #F4F1E9);
  --paper: var(--surface, #FFFFFF);
  --nav: var(--text-primary, #071C24);
  --brand: var(--text-primary, #071C24);
  --brand-2: var(--text-primary, #071C24);
  --warn: #b46b00;
  --danger: #c94448;
  --ok: #2d7d46;
  --violet: #6d4aa0;
  --shadow: 0 2px 10px rgba(7, 28, 36, .05);
}

/* Raccolta tecnica integrata e verbale tecnico della sede */
.technical-survey-workspace { min-width: 0; }
.integrated-checklist-layout { margin-top: 14px; }
.integrated-checklist-nav .integrated-sections-label {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line, #dbe2e8);
}
.integrated-checklist-nav button.section-active { box-shadow: inset 3px 0 0 rgba(255,255,255,.65); }
.integrated-checklist-content { overflow: hidden; }
.integrated-environment-base {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line, #dbe2e8);
}
.technical-survey-layout {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.technical-survey-nav {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  display: grid;
  gap: 6px;
  padding: 14px;
}
.technical-survey-nav > strong { padding: 2px 4px 8px; }
.technical-survey-nav button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  text-align: left;
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--ink, #1b2730);
  border: 1px solid var(--line, #dbe2e8);
  box-shadow: none;
}
.technical-survey-nav button span { min-width: 0; white-space: normal; overflow-wrap: anywhere; font-size: 12px; line-height: 1.3; }
.technical-survey-nav button small { white-space: nowrap; opacity: .7; }
.technical-survey-nav button.active {
  color: #fff;
  background: var(--primary, #184f63);
  border-color: var(--primary, #184f63);
}
.technical-survey-content { min-width: 0; padding: 18px; }
.technical-survey-header-fields,
.technical-survey-general-files,
.technical-survey-active-section { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line, #dbe2e8); }
.technical-survey-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 12px;
  border: 1px solid var(--line, #dbe2e8);
  border-radius: 12px;
}
.technical-survey-reasons label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.technical-survey-reasons input { width: auto; }
.technical-survey-section-note { display: grid; gap: 6px; margin-bottom: 12px; }
.technical-survey-register { margin: 12px 0 18px; padding: 14px; border: 1px solid #bfd2de; border-radius: 12px; background: #f7fafc; }
.technical-survey-register-rows { display: grid; gap: 10px; }
.technical-survey-register-row { padding: 12px; border: 1px solid var(--line, #dbe2e8); border-radius: 10px; background: #fff; }
.technical-survey-register-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.technical-survey-register-head .link-danger { min-height: 0; padding: 3px 7px; background: none; color: #b52f2f; box-shadow: none; }
.technical-survey-register-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.technical-survey-register-grid label { display: grid; gap: 4px; font-size: 12px; }
.technical-survey-rows { display: grid; gap: 9px; }
.technical-survey-row {
  border: 1px solid var(--line, #dbe2e8);
  border-left: 4px solid #a7b3bb;
  border-radius: 12px;
  background: var(--surface, #fff);
  overflow: hidden;
}
.technical-survey-row.is-ok { border-left-color: #2c9163; }
.technical-survey-row.is-nc { border-left-color: #c84646; }
.technical-survey-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 92px;
  gap: 10px;
  align-items: end;
  padding: 11px 12px;
}
.technical-survey-question { display: grid; gap: 3px; min-width: 0; }
.technical-survey-question small { color: var(--muted, #687781); }
.technical-survey-question strong { line-height: 1.35; }
.technical-survey-row-main label,
.technical-survey-detail-grid label,
.technical-survey-upload label { display: grid; gap: 4px; font-size: 12px; }
.technical-survey-row details { border-top: 1px solid var(--line, #dbe2e8); }
.technical-survey-row summary { cursor: pointer; padding: 9px 12px; color: var(--primary, #184f63); font-size: 12px; font-weight: 700; }
.technical-survey-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 4px 12px 12px;
}
.technical-survey-detail-grid .wide { grid-column: 1 / -1; }
.technical-survey-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 10px; align-items: center; }
.technical-survey-file {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 6px 8px;
  border-radius: 9px;
  background: #f4f7f8;
  border: 1px solid var(--line, #dbe2e8);
  font-size: 12px;
}
.technical-survey-file > span:first-child { overflow-wrap: anywhere; }
.technical-survey-file a { font-weight: 700; }
.technical-survey-file .link-danger { padding: 0 4px; min-width: 0; background: none; color: #b52f2f; box-shadow: none; font-size: 18px; }
.technical-survey-upload {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px 12px;
  background: #f8fafb;
}
.technical-survey-existing { display: flex; gap: 8px; padding: 8px 12px 0; }
.technical-survey-existing select { flex: 1; }
.technical-survey-savebar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line, #dbe2e8);
  border-radius: 12px;
  box-shadow: 0 -6px 20px rgba(28, 48, 58, .08);
}
.technical-survey-savebar span { color: var(--muted, #687781); font-size: 12px; }

@media (max-width: 980px) {
  .technical-survey-layout { grid-template-columns: 1fr; }
  .technical-survey-nav {
    position: static;
    max-height: none;
    display: flex;
    align-items: stretch;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .technical-survey-nav > strong {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    max-width: 180px;
    padding: 8px 10px;
    border-radius: 9px;
    background: #eef4f8;
    color: var(--brand-2);
    font-size: 12px;
  }
  .technical-survey-nav button {
    flex: 0 0 min(250px, 42vw);
    scroll-snap-align: start;
  }
}

@media (max-width: 640px) {
  .technical-survey-nav { padding: 10px; }
  .technical-survey-nav > strong { max-width: 145px; }
  .technical-survey-nav button { flex-basis: min(260px, 76vw); }
  .technical-survey-row-main { grid-template-columns: 1fr 72px 82px; }
  .technical-survey-question { grid-column: 1 / -1; }
  .technical-survey-detail-grid,
  .technical-survey-register-grid,
  .technical-survey-upload { grid-template-columns: 1fr; }
  .technical-survey-detail-grid .wide { grid-column: auto; }
  .technical-survey-existing,
  .technical-survey-savebar { align-items: stretch; flex-direction: column; }
}

.settings-save-bar {
  align-items: center;
  border-color: #c9d6e2;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  position: sticky;
  bottom: 12px;
  z-index: 8;
}

.settings-save-bar h2 {
  margin: 0 0 4px;
}

.settings-save-bar p {
  margin: 0;
  color: #526575;
}

.settings-save-bar.is-dirty {
  border-color: #d7b15a;
  box-shadow: 0 14px 34px rgba(92, 74, 27, .16);
}

.settings-save-bar .actions {
  flex: 0 0 auto;
}

.admin-settings-save-options {
  display: grid;
  gap: 10px;
  margin: 14px 0 8px;
}

.admin-settings-save-options button {
  align-items: flex-start;
  display: grid;
  gap: 4px;
  justify-items: start;
  min-height: 72px;
  text-align: left;
  width: 100%;
}

.admin-settings-save-options small {
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  opacity: .82;
}

@media (max-width: 720px) {
  .settings-save-bar {
    align-items: stretch;
    bottom: 0;
    display: grid;
  }

  .settings-save-bar .actions {
    justify-content: stretch;
  }

  .settings-save-bar .actions button {
    flex: 1 1 auto;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}

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

button {
  border: 0;
  background: var(--brand);
  color: white;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(201, 68, 72, .18);
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}

button:hover:not(:disabled) {
  background: #b83b3f;
  box-shadow: 0 4px 12px rgba(201, 68, 72, .22);
}

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

.login-form .password-toggle:active:not(:disabled) {
  transform: translateY(-50%);
}

button.secondary {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

button.secondary:hover:not(:disabled) {
  background: #f3f7fa;
  color: var(--ink);
  box-shadow: none;
}

button.warn { background: var(--warn); }
button.danger { background: var(--danger); }
button.warn:hover:not(:disabled) { background: #985b00; }
button.danger:hover:not(:disabled) { background: #b83b3f; }
button.blue {
  background: var(--brand-2);
  box-shadow: 0 2px 8px rgba(28, 82, 125, .18);
}

button.blue:hover:not(:disabled) {
  background: #164566;
  box-shadow: 0 4px 12px rgba(28, 82, 125, .22);
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

button.ghost:hover:not(:disabled) {
  background: #f3f7fa;
  color: var(--ink);
  box-shadow: none;
}

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

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(201, 68, 72, .18);
}

.button-link:hover {
  background: #b83b3f;
  color: #fff;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  min-height: 38px;
  padding: 8px 10px;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: 0;
  padding: 0;
  accent-color: var(--brand);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(28, 82, 125, .18);
  border-color: var(--brand-2);
}

.province-native-select {
  display: none;
}

.province-combobox {
  position: relative;
  min-width: 0;
}

.province-combobox-button {
  position: relative;
  width: 100%;
  min-height: 38px;
  padding: 8px 34px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  text-align: left;
  font-weight: 500;
  white-space: normal;
}

.province-combobox-button::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  transform: translateY(-50%);
}

.province-combobox-button:hover,
.province-combobox-button:focus {
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.province-combobox-button:focus {
  outline: 2px solid rgba(28, 82, 125, .18);
  border-color: var(--brand-2);
}

.province-combobox-panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #c8d9e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(28, 82, 125, .16);
}

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

.province-search {
  min-height: 34px;
  padding: 7px 9px;
  border-color: #c8d9e6;
  background: #f8fbfd;
  font-size: 13px;
}

.province-options {
  display: grid;
  gap: 3px;
  max-height: 220px;
  overflow: auto;
}

.province-option {
  min-height: 30px;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  text-align: left;
  font-size: 13px;
  font-weight: 550;
}

.province-option:hover,
.province-option:focus,
.province-option[aria-selected="true"] {
  background: #e5eff7;
  color: var(--ink);
  box-shadow: none;
}

.province-option-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: var(--nav);
  color: white;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: grid;
  grid-template-columns: 1fr 34px;
  align-items: center;
  gap: 8px 12px;
  padding: 10px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(244,247,249,.93));
  box-shadow:
    0 16px 34px rgba(8, 25, 38, .18),
    inset 0 1px 0 rgba(255,255,255,.85);
}

.mark {
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  width: 100%;
  height: 76px;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
}

.mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong { display: block; font-size: 16px; }
.brand span { display: block; color: #637481; font-size: 12px; margin-top: 2px; }

.brand-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
  padding-left: 0;
}

.user-profile-trigger {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 4px 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  box-shadow: none;
  text-align: left;
}

.user-profile-trigger:hover:not(:disabled),
.user-profile-trigger:focus-visible {
  background: #eaf1f5;
  color: inherit;
  box-shadow: none;
  outline: 2px solid rgba(28, 82, 125, .18);
}

.brand-user-name {
  display: block;
  color: #172026;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.brand-user-role {
  display: block;
  color: #60707d;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.logout-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(28, 82, 125, .18);
  background: var(--nav);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(28, 82, 125, .18);
}

.logout-icon:hover:not(:disabled) {
  background: #164566;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(28, 82, 125, .22);
}

.logout-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  width: 100%;
  background: transparent;
  color: rgba(255,255,255,.82);
  text-align: left;
  border-radius: 6px;
  box-shadow: none;
}

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

.nav button.active,
.nav button:hover {
  background: rgba(255,255,255,.14);
  color: white;
}

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

.content {
  min-width: 0;
  padding: 24px;
}

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

.topbar h1 {
  margin: 0;
  font-size: 25px;
  letter-spacing: 0;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.login-screen {
  min-height: 100vh;
  padding: 0;
  display: grid;
  align-items: center;
  background: #172026;
}

.login-hero {
  display: grid;
  position: relative;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: #172026;
}

.login-hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  grid-template-areas: "copy form";
  grid-template-rows: auto;
  align-content: center;
  align-items: center;
  column-gap: clamp(42px, 6vw, 92px);
  row-gap: 0;
  min-height: 100vh;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: clamp(34px, 5vw, 72px);
}

.login-copy-main {
  grid-area: copy;
  align-self: center;
  max-width: 700px;
  color: #ffffff;
  transform: none;
}

.login-eyebrow {
  color: #ffd9d9;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-hero h1 {
  max-width: 700px;
  margin: 8px 0 0;
  color: #ffffff;
  font-size: clamp(40px, 4.8vw, 68px);
  line-height: 1.08;
  letter-spacing: 0;
  text-shadow: 0 10px 32px rgba(0,0,0,.28);
}

.login-hero p {
  max-width: 620px;
  margin: 18px 0 0;
  color: rgba(255,255,255,.86);
  font-size: 17px;
  line-height: 1.55;
}

.login-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.login-points span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 999px;
  background: rgba(255,255,255,.13);
  color: #ffffff;
  font-size: 12px;
  font-weight: 750;
  backdrop-filter: blur(8px);
}

.login-form {
  grid-area: form;
  align-self: center;
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 10px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .25);
  backdrop-filter: blur(18px);
}

.login-form-logo {
  display: block;
  width: min(310px, 82%);
  height: auto;
  margin: 0 auto 8px;
}

.login-form-head {
  display: block;
  padding-bottom: 4px;
  text-align: center;
}

.login-form-head h2 {
  margin: 0;
  color: #2f4352;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0;
}

.login-form-head p {
  max-width: none;
  margin: 8px 0 0;
  color: #526672;
  font-size: 13px;
  line-height: 1.45;
}

.login-form-head small {
  display: block;
  margin-top: 7px;
  color: #6b7c87;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: #263844;
  font-size: 13px;
  font-weight: 750;
}

.login-form button {
  width: 100%;
  margin-top: 2px;
}

.login-form input {
  min-height: 42px;
  padding: 9px 11px;
}

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

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

.login-form .password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.login-form .password-toggle:hover:not(:disabled) {
  transform: translateY(-50%);
  background: #eef3f6;
  color: var(--ink);
  box-shadow: none;
}

.login-form .password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-form .password-toggle .eye-closed {
  display: none;
}

.login-form .password-toggle.is-visible .eye-open {
  display: none;
}

.login-form .password-toggle.is-visible .eye-closed {
  display: block;
}

.forgot-password {
  min-height: auto;
  margin-top: -2px;
  padding: 0;
  background: transparent;
  color: var(--brand-2);
  box-shadow: none;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.forgot-password:hover:not(:disabled) {
  background: transparent;
  color: var(--brand);
  box-shadow: none;
}

.password-change-form {
  gap: 12px;
}

.password-policy-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.password-policy-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #657783;
  font-size: 11.5px;
  line-height: 1.3;
}

.password-policy-list li > span {
  display: inline-grid;
  flex: 0 0 19px;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid #c8d4dc;
  border-radius: 50%;
  background: #f5f8fa;
  color: #788a96;
  font-size: 12px;
  font-weight: 900;
}

.password-policy-list li.is-valid {
  color: #196843;
  font-weight: 700;
}

.password-policy-list li.is-valid > span {
  border-color: #69ad8b;
  background: #e6f5ed;
  color: #17633f;
}

.password-change-error {
  margin: 0;
  font-size: 12px;
}

.login-error {
  max-width: 420px;
  margin-top: 12px;
}

.login-hero-media {
  position: absolute;
  inset: 0;
  margin: 0;
  background: #dfe7ec;
  z-index: 0;
}

.login-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(13,32,46,.84) 0%, rgba(13,32,46,.68) 42%, rgba(13,32,46,.22) 100%),
    linear-gradient(0deg, rgba(0,0,0,.18), rgba(0,0,0,.04));
  pointer-events: none;
}

.login-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  object-fit: cover;
}

.guide-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -6px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-2);
  border-radius: 8px;
  background: #f8fafb;
  box-shadow: 0 4px 12px rgba(28, 82, 125, .05);
}

.guide-box strong {
  display: block;
  color: var(--brand-2);
  font-size: 13px;
}

.guide-box p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.guide-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  max-width: 50%;
}

.guide-steps span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid #d8e3ea;
  border-radius: 999px;
  background: #fff;
  color: #283640;
  font-size: 11.5px;
  font-weight: 750;
  cursor: help;
}

.crm-guide {
  align-items: flex-start;
  margin-top: -4px;
  padding: 14px 16px;
  border-left-width: 5px;
  background: #ffffff;
}

.crm-guide strong {
  font-size: 14px;
}

.crm-guide p {
  max-width: 980px;
  font-size: 13px;
  line-height: 1.45;
}

.crm-guide .guide-steps {
  align-items: center;
  gap: 8px;
  max-width: 56%;
}

.crm-guide .guide-steps span {
  min-height: 30px;
  padding: 6px 10px;
  border-color: #cddbe5;
  background: #f7fafc;
  color: #17364f;
  font-size: 12px;
}

[title] {
  cursor: help;
}

button[title],
a[title] {
  cursor: pointer;
}

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

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

.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-10 { grid-column: span 10; }
.span-11 { grid-column: span 11; }
.span-12 { grid-column: span 12; }

.panel, .card {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.card {
  padding: 16px;
}

.panel h2, .card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

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

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.metric {
  min-height: 116px;
  display: grid;
  align-content: space-between;
}

button.metric-button {
  width: 100%;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}

button.metric-button:hover:not(:disabled) {
  border-color: rgba(28, 82, 125, .42);
  background: #f8fbfd;
  color: var(--ink);
  box-shadow: 0 10px 26px rgba(28, 82, 125, .14);
}

button.metric-button:focus-visible {
  outline: 2px solid rgba(201, 68, 72, .28);
  outline-offset: 2px;
}

.metric b {
  font-size: 30px;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric .chip.ok { background: #dff0e4; color: #19582c; }
.metric .chip.warn { background: #fff1d8; color: #7c4900; }
.metric .chip.danger { background: #fae5e6; color: #9d2e32; }
.metric .chip.blue { background: #e5eff7; color: #1c527d; }
.metric .chip.violet { background: #eee7fb; color: #563687; }

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

.dashboard-role-section {
  display: grid;
  gap: 14px;
  padding-top: 2px;
}

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

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

.dashboard-kpis .metric {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 16px;
  border-color: #dce7ee;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(28, 82, 125, .08);
}

.dashboard-kpis .metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  width: auto;
  background: var(--brand-2);
}

.dashboard-kpis .metric-violet::before { background: var(--violet); }
.dashboard-kpis .metric-warn::before { background: var(--warn); }
.dashboard-kpis .metric-danger::before { background: var(--danger); }

.dashboard-kpis .metric-blue {
  background: linear-gradient(135deg, #ffffff 0%, #f2f8fc 100%);
}

.dashboard-kpis .metric-violet {
  background: linear-gradient(135deg, #ffffff 0%, #f7f3fd 100%);
}

.dashboard-kpis .metric-warn {
  background: linear-gradient(135deg, #ffffff 0%, #fff7e8 100%);
}

.dashboard-kpis .metric-danger {
  background: linear-gradient(135deg, #ffffff 0%, #fff1f2 100%);
}

.dashboard-kpis button.metric-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #c7d9e5;
  background: #ffffff;
  box-shadow: 0 18px 34px rgba(28, 82, 125, .16);
}

.dashboard-kpis .metric span {
  color: #465965;
  font-weight: 650;
  line-height: 1.25;
}

.dashboard-metric-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.dashboard-metric-head > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-metric-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e5eff7;
  color: var(--brand-2);
}

.dashboard-metric-icon img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(25%) sepia(39%) saturate(1076%) hue-rotate(166deg) brightness(91%) contrast(88%);
}

.dashboard-metric-icon.violet {
  background: #eee7fb;
  color: var(--violet);
}

.dashboard-metric-icon.violet img {
  filter: brightness(0) saturate(100%) invert(28%) sepia(18%) saturate(2184%) hue-rotate(226deg) brightness(91%) contrast(89%);
}

.dashboard-metric-icon.warn {
  background: #fff1d8;
  color: var(--warn);
}

.dashboard-metric-icon.warn img {
  filter: brightness(0) saturate(100%) invert(37%) sepia(84%) saturate(933%) hue-rotate(20deg) brightness(94%) contrast(101%);
}

.dashboard-metric-icon.danger {
  background: #fae5e6;
  color: var(--danger);
}

.dashboard-metric-icon.danger img {
  filter: brightness(0) saturate(100%) invert(34%) sepia(45%) saturate(1090%) hue-rotate(311deg) brightness(91%) contrast(91%);
}

.dashboard-kpis .metric b {
  margin: 6px 0 8px;
  color: #102a3d;
  font-size: 32px;
  font-weight: 720;
  letter-spacing: 0;
}

.dashboard-kpis .metric .chip {
  width: fit-content;
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
  font-weight: 600;
}

.dashboard-metric-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.dashboard-trend {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(28, 82, 125, .08);
  color: #4f6471;
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
}

.dashboard-trend::before {
  content: none;
}

.dashboard-trend.blue { color: var(--brand-2); }
.dashboard-trend.violet { background: rgba(109, 74, 160, .1); color: var(--violet); }
.dashboard-trend.warn { background: rgba(180, 107, 0, .12); color: var(--warn); }
.dashboard-trend.danger { background: rgba(201, 68, 72, .12); color: var(--danger); }

.dashboard-panels {
  align-items: stretch;
  gap: 16px;
}

.dashboard-panel {
  border-color: #dce7ee;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
  box-shadow: 0 12px 28px rgba(28, 82, 125, .08);
  overflow: hidden;
  padding-top: 0;
}

button.dashboard-panel-button {
  width: 100%;
  min-height: 100%;
  padding: 0 18px 18px;
  border: 1px solid #dce7ee;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 28px rgba(28, 82, 125, .08);
}

button.dashboard-panel-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #bfd4e1;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 18px 34px rgba(28, 82, 125, .15);
}

button.dashboard-panel-button:focus-visible {
  outline: 2px solid rgba(28, 82, 125, .34);
  outline-offset: 2px;
}

.dashboard-panel-button .section-title {
  display: flex;
}

.dashboard-panel-button .section-title > span:first-child {
  display: grid;
  gap: 4px;
}

.dashboard-panel-button .section-title > i {
  color: var(--brand-2);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-panel-title {
  color: #102a3d;
  font-size: 14px;
  font-weight: 700;
}

.dashboard-panel-button .section-title small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.dashboard-panel-content {
  display: block;
  width: 100%;
}

.dashboard-record-preview {
  display: grid;
  gap: 3px;
  padding: 9px 0;
  border-bottom: 1px solid #edf2f5;
}

.dashboard-record-preview:last-child {
  border-bottom: 0;
}

.dashboard-record-preview strong {
  color: #17384f;
  font-size: 13px;
}

.dashboard-record-preview small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-action-center {
  padding: 0 18px 18px;
  border-left: 6px solid var(--brand-2);
  background: linear-gradient(135deg, #fff 0%, #f3f8fb 100%);
}

.dashboard-action-center > .section-title {
  margin: 0 -18px 12px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid #e6eef2;
}

.dashboard-action-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.dashboard-action-list > button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid #d7e3ea;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.dashboard-action-list > button:hover:not(:disabled) {
  border-color: #a9c4d4;
  background: #fbfdfe;
  color: var(--ink);
  transform: translateY(-1px);
}

.dashboard-action-list > button > span:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dashboard-action-list strong,
.dashboard-action-list small,
.dashboard-action-list em {
  overflow-wrap: anywhere;
}

.dashboard-action-list small,
.dashboard-action-list em {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-action-list em {
  font-style: normal;
}

.dashboard-action-list > button > i {
  color: var(--brand-2);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.dashboard-action-rank {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5eff7;
  color: var(--brand-2);
  font-size: 17px;
  font-weight: 900;
}

.dashboard-action-rank.warn { background: #fff1d8; color: #7c4900; }
.dashboard-action-rank.danger { background: #fae5e6; color: #9d2e32; }

.dashboard-panel .section-title {
  align-items: flex-start;
  margin: 0 -18px 16px;
  padding: 14px 18px 13px;
  border-bottom: 1px solid #edf2f5;
  background: linear-gradient(90deg, rgba(28, 82, 125, .09), rgba(255,255,255,0));
}

.dashboard-panel .section-title h2 {
  margin-bottom: 0;
  color: #102a3d;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
}

.dashboard-panel .section-title p {
  max-width: 680px;
  margin-top: 5px;
  line-height: 1.35;
}

.section-title.compact {
  margin-bottom: 14px;
}

.dashboard-hours {
  display: grid;
  align-content: start;
}

.dashboard-client-name {
  display: block;
  min-height: 38px;
  color: #102a3d;
  font-size: 15px;
  line-height: 1.3;
}

.dashboard-usage-value {
  margin: 14px 0 8px;
  color: var(--brand-2);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.dashboard-small {
  margin: 9px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-score {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: start;
}

.dashboard-ring {
  --value: 0;
  display: grid;
  place-items: center;
  width: 154px;
  height: 154px;
  margin: 2px auto 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(var(--brand-2) calc(var(--value) * 1%), #dfe9ef 0);
  box-shadow:
    inset 0 0 0 1px #dce7ee,
    0 14px 28px rgba(28, 82, 125, .14);
}

.dashboard-ring-inner {
  display: grid;
  justify-items: center;
  align-content: center;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: #ffffff;
}

.dashboard-ring-inner strong {
  display: block;
  color: #102a3d;
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}

.dashboard-ring-inner span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.dashboard-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.dashboard-mini-stats span,
.dashboard-money-grid > div,
.dashboard-money-grid > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbfd, #edf5fa);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.dashboard-mini-stats b,
.dashboard-money-grid strong {
  color: #102a3d;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  overflow-wrap: anywhere;
}

.dashboard-bars {
  display: grid;
  gap: 9px;
}

.dashboard-bar-row {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  min-height: 26px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #f8fbfd;
}

.dashboard-bar-row span {
  color: #354854;
  font-size: 12.5px;
  font-weight: 620;
  line-height: 1.2;
}

.dashboard-bar-row b {
  color: #102a3d;
  font-weight: 680;
  text-align: right;
}

.dashboard-bar-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe9ef;
}

.dashboard-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-2), #5f96b8);
}

.dashboard-bar-row.stage-nuova_lead .dashboard-bar-track i,
.dashboard-bar-row.stage-lead_da_qualificare .dashboard-bar-track i {
  background: linear-gradient(90deg, #1c527d, #72a6c5);
}

.dashboard-bar-row.stage-preventivo_da_autorizzare .dashboard-bar-track i,
.dashboard-bar-row.stage-attesa_accettazione_preventivo .dashboard-bar-track i {
  background: linear-gradient(90deg, #6d4aa0, #a58ac8);
}

.dashboard-bar-row.stage-contratto_da_inviare .dashboard-bar-track i,
.dashboard-bar-row.stage-contratto_firmato_da_validare .dashboard-bar-track i {
  background: linear-gradient(90deg, #b46b00, #d8a34d);
}

.dashboard-bar-row.stage-cliente_acquisito .dashboard-bar-track i {
  background: linear-gradient(90deg, #2d7d46, #6ab47d);
}

.dashboard-bar-row.stage-lead_persa .dashboard-bar-track i {
  background: linear-gradient(90deg, #c94448, #df8588);
}

.dashboard-money-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.dashboard-money-grid > div:first-child,
.dashboard-money-grid > span:first-child {
  background: linear-gradient(180deg, #f3f8fc, #e8f2f8);
}

.dashboard-money-grid > div:last-child,
.dashboard-money-grid > span:last-child {
  background: linear-gradient(180deg, #f4fbf6, #e5f4e9);
}

.dashboard-money-grid strong {
  font-size: 21px;
}

.dashboard-quote-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  min-height: 170px;
  padding-top: 8px;
}

.dashboard-quote-item {
  display: grid;
  grid-template-rows: auto auto minmax(86px, 1fr);
  gap: 6px;
  min-height: 158px;
  padding: 10px 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fc 100%);
  box-shadow: inset 0 0 0 1px rgba(28, 82, 125, .08);
}

.dashboard-quote-item.violet {
  background: linear-gradient(180deg, #ffffff 0%, #f8f5fd 100%);
}

.dashboard-quote-item.ok {
  background: linear-gradient(180deg, #ffffff 0%, #f4fbf6 100%);
}

.dashboard-quote-item.warn {
  background: linear-gradient(180deg, #ffffff 0%, #fff8ec 100%);
}

.dashboard-quote-track {
  display: flex;
  align-items: end;
  width: 100%;
  min-height: 86px;
  margin-top: 2px;
  overflow: hidden;
  border-radius: 6px;
  background: #eaf1f5;
}

.dashboard-quote-track i {
  display: block;
  width: 100%;
  min-height: 8px;
  border-radius: 6px 6px 0 0;
  background: rgba(28, 82, 125, .34);
}

.dashboard-quote-item.violet i { background: rgba(109, 74, 160, .45); }
.dashboard-quote-item.ok i { background: rgba(45, 125, 70, .45); }
.dashboard-quote-item.warn i { background: rgba(180, 107, 0, .48); }

.dashboard-quote-item span {
  color: #455965;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.15;
}

.dashboard-quote-item strong {
  color: #102a3d;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.dashboard-view .kpi-bar {
  height: 12px;
  background: #e9f0f4;
}

.dashboard-view .chip {
  font-weight: 600;
}

.dashboard-view .workflow {
  gap: 10px;
}

.dashboard-view .crm-workflow {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-view .crm-workflow .step {
  position: relative;
  min-height: 86px;
  padding: 12px 11px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.52);
}

.dashboard-view .crm-workflow .step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -12px;
  z-index: 2;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 9px solid #b9cad6;
  transform: translateY(-50%);
}

.dashboard-view .crm-workflow .step::before {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  margin-bottom: 9px;
  border-radius: 999px;
  background: var(--brand-2);
}

.dashboard-view .crm-workflow .step.done {
  border-color: #cfe0ec;
  background: linear-gradient(180deg, #f8fbfd, #eef6fb);
}

.dashboard-view .crm-workflow .step.blocked {
  border-color: #efd1d2;
  background: linear-gradient(180deg, #fffafa, #fff1f2);
}

.dashboard-view .crm-workflow .stage-nuova_lead::before,
.dashboard-view .crm-workflow .stage-lead_da_qualificare::before { background: var(--brand-2); }
.dashboard-view .crm-workflow .stage-preventivo_da_autorizzare::before,
.dashboard-view .crm-workflow .stage-attesa_accettazione_preventivo::before { background: var(--violet); }
.dashboard-view .crm-workflow .stage-contratto_da_inviare::before,
.dashboard-view .crm-workflow .stage-contratto_firmato_da_validare::before { background: var(--warn); }
.dashboard-view .crm-workflow .stage-cliente_acquisito::before { background: var(--ok); }
.dashboard-view .crm-workflow .stage-lead_persa::before { background: var(--danger); }

.dashboard-view .crm-workflow .step b {
  color: #102a3d;
  font-size: 13px;
  font-weight: 650;
  min-height: 32px;
}

.dashboard-view .crm-workflow .step span {
  margin-top: 6px;
  color: #60707d;
  line-height: 1.25;
}

.dashboard-view .list {
  gap: 10px;
}

.dashboard-view .notice {
  border-radius: 8px;
  background: linear-gradient(90deg, #f7fafc, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(28, 82, 125, .04);
}

.dashboard-view .log {
  border: 1px solid #223340;
  background: #0f1b24;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 26, 32, .38);
}

.modal-card {
  width: min(680px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(17, 26, 32, .24);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.modal-head h2 {
  margin: 0;
  color: var(--brand-2);
  font-size: 18px;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.modal-close {
  flex: 0 0 auto;
}

.modal-body {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.user-profile-view {
  display: grid;
  gap: 12px;
}

.user-profile-details {
  display: grid;
  gap: 8px;
  margin: 0;
}

.user-profile-details > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.user-profile-details > div:last-child { border-bottom: 0; }
.user-profile-details dt { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.user-profile-details dd { margin: 0; overflow-wrap: anywhere; font-weight: 650; }

.user-profile-document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.user-profile-document-text {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.user-profile-document-text pre {
  max-height: 440px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
  color: var(--ink);
  font: 13px/1.55 Arial, sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lead-work-modal,
.modal-card:has(#lead-work-form) {
  width: min(1120px, calc(100vw - 40px));
}

.quote-preview-modal {
  width: min(1040px, calc(100vw - 40px));
}

.modal-card:has(#lead-contact-form) {
  width: min(860px, calc(100vw - 40px));
}

.lead-work-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--line);
}

.lead-work-tab-button {
  background: #ffffff;
  color: var(--brand-2);
  border: 1px solid var(--line);
  box-shadow: none;
  min-height: 34px;
  padding: 7px 11px;
}

.lead-work-tab-button:hover:not(:disabled) {
  background: #eef5f9;
  color: var(--brand-2);
  box-shadow: none;
}

.lead-work-tab-button.active {
  background: var(--brand-2);
  color: #ffffff;
  border-color: var(--brand-2);
}

.lead-work-tab-panel {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  padding-top: 12px;
}

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

.lead-work-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.88), #ffffff 35%);
}

.lead-estimate-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.lead-estimate-payment {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.lead-estimate-payment label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 700;
}

.lead-estimate-payment small {
  color: var(--muted);
}

.lead-estimate-costs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.quote-approval-badge,
.quote-approval-stale {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 750;
}

.quote-approval-badge {
  color: var(--ok);
  border: 1px solid rgba(45, 125, 70, .28);
  background: #edf8f0;
}

.quote-approval-badge::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--ok);
  font-size: 11px;
  line-height: 1;
}

.quote-approval-stale {
  color: var(--warn);
  border: 1px solid rgba(180, 107, 0, .28);
  background: #fff7e8;
}

.quote-preview-totals {
  margin-bottom: 12px;
}

.quote-document-page {
  display: grid;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid #ccd8e2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(23, 32, 38, .08);
}

.quote-document-cover {
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--brand-2);
}

.quote-document-cover span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.quote-document-cover h2 {
  margin: 0;
  color: var(--brand-2);
  font-size: 24px;
}

.quote-document-cover p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.quote-document-section {
  display: grid;
  gap: 10px;
}

.quote-document-section h3 {
  margin: 0;
  color: var(--brand-2);
  font-size: 15px;
}

.quote-document-section p {
  margin: 0;
  color: #33424c;
  font-size: 13px;
  line-height: 1.48;
}

.quote-document-informative {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.quote-document-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-document-table {
  min-width: 0;
  border: 0;
  border-radius: 0;
  table-layout: auto;
}

.quote-document-table th {
  background: #e5eff7;
  color: var(--brand-2);
}

.quote-document-table th,
.quote-document-table td {
  font-size: 12px;
  line-height: 1.35;
}

.quote-document-list {
  margin: 0;
  padding-left: 18px;
  color: #33424c;
  font-size: 13px;
  line-height: 1.45;
}

.quote-document-signatures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
  color: #33424c;
  font-size: 12px;
  line-height: 1.55;
}

.quote-preview-conditions p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.quote-preview-actions {
  margin-top: 12px;
}

@media (max-width: 720px) {
  .lead-estimate-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-estimate-footer button {
    width: 100%;
  }
}

.manual-lead-modal,
.modal-card:has(#manual-lead-form) {
  width: min(920px, calc(100vw - 40px));
  max-height: calc(100vh - 20px);
}

.manual-lead-modal .modal-head,
.modal-card:has(#manual-lead-form) .modal-head {
  padding: 10px 12px;
}

.manual-lead-modal .modal-head h2,
.modal-card:has(#manual-lead-form) .modal-head h2 {
  font-size: 16px;
}

.manual-lead-modal .modal-head p,
.modal-card:has(#manual-lead-form) .modal-head p {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.25;
}

.manual-lead-modal .modal-body,
.modal-card:has(#manual-lead-form) .modal-body {
  padding: 10px 12px 12px;
}

#manual-lead-form {
  gap: 8px 10px;
}

#manual-lead-form label {
  gap: 4px;
  font-size: 12px;
}

#manual-lead-form input,
#manual-lead-form select,
#manual-lead-form .province-combobox-button {
  min-height: 32px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 12.5px;
}

#manual-lead-form .form-section-label {
  margin-top: 0;
  font-size: 10px;
}

#manual-lead-form .ateco-picker {
  gap: 7px;
  padding: 10px;
}

#manual-lead-form .ateco-picker-head {
  gap: 8px;
}

#manual-lead-form .ateco-picker-head small {
  font-size: 11px;
}

#manual-lead-form .ateco-picker-grid {
  gap: 8px;
}

#manual-lead-form .manual-ateco-column {
  gap: 6px;
}

#manual-lead-form .manual-ateco-column [data-manual-ateco-search],
#manual-lead-form .manual-ateco-meta-row input {
  min-height: 30px;
  padding: 5px 7px;
  font-size: 12px;
}

#manual-lead-form .manual-ateco-column [data-manual-ateco-results] {
  height: 112px;
  font-size: 12px;
}

#manual-lead-form .ateco-summary.manual-ateco-summary {
  min-height: 138px;
}

#manual-lead-form .actions {
  margin-top: 0;
}

#manual-lead-form .actions button {
  min-height: 34px;
  padding: 7px 12px;
}

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

.modal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

button.modal-row-button {
  width: 100%;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

button.modal-row-button:hover:not(:disabled) {
  border-color: #bfd4e1;
  background: #f3f8fc;
  color: var(--ink);
}

button.modal-row-button:focus-visible {
  outline: 2px solid rgba(28, 82, 125, .3);
  outline-offset: 1px;
}

.dashboard-row-end {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-row-end > i {
  color: var(--brand-2);
  font-size: 22px;
  font-style: normal;
  line-height: 1;
}

.dashboard-modal-footer {
  margin-top: 14px;
}

.app-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 26, 32, .46);
}

.app-dialog {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(17, 26, 32, .28);
}

.app-dialog-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e5eff7;
  color: var(--brand-2);
  font-weight: 900;
}

.app-dialog-warn .app-dialog-mark {
  background: #fff1d8;
  color: #8a5400;
}

.app-dialog-danger .app-dialog-mark {
  background: #fae5e6;
  color: var(--danger);
}

.app-dialog h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.app-dialog p {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.app-dialog-field {
  display: grid;
  gap: 6px;
}

.app-dialog-field span {
  color: #425563;
  font-size: 12.5px;
  font-weight: 750;
}

.app-dialog-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #d8e1e7;
  border-radius: 7px;
  background: #f7fafc;
  color: #334b5b;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
  cursor: pointer;
}

.app-dialog-checkbox input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.app-dialog-field textarea {
  min-height: 92px;
}

.authorization-dialog {
  width: min(620px, 100%);
}

.authorization-preview,
.lead-auth-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.authorization-preview {
  margin-bottom: 2px;
}

.authorization-preview > div,
.lead-auth-summary > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e4d8c8;
  border-radius: 8px;
  background: linear-gradient(135deg, #fbfaf7 0%, #f4efe7 100%);
}

.authorization-preview span,
.lead-auth-summary span {
  color: #6a5b49;
  font-size: 11.5px;
  font-weight: 650;
}

.authorization-preview strong,
.lead-auth-summary strong {
  color: #172026;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.app-dialog-error {
  padding: 9px 10px;
  border: 1px solid #efc0c2;
  border-radius: 6px;
  background: #fff3f4;
  color: #9d2e32;
  font-size: 12.5px;
  font-weight: 750;
}

.app-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.error-recovery-focus {
  outline: 3px solid #b75b12 !important;
  outline-offset: 4px;
  scroll-margin-block: 100px;
}

.list {
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.row:first-child { border-top: 0; }

.row-main {
  min-width: 0;
  overflow: hidden;
}

.row-main strong,
.row-main small {
  overflow-wrap: anywhere;
}

.row-main strong { display: block; }
.row-main small { display: block; color: var(--muted); margin-top: 2px; }

.settings-user-row {
  align-items: flex-end;
  flex-wrap: wrap;
}

.settings-user-row .row-main {
  flex: 1 1 620px;
  overflow: visible;
}

.settings-user-row > label {
  flex: 0 1 150px;
}

.settings-user-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.settings-user-actions button {
  min-height: 38px;
}

.settings-user-actions .settings-user-delete {
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  padding: 0;
  border: 1px solid #df9ca0;
  background: #fff7f7;
  color: #a6252c;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}

.settings-user-actions .settings-user-delete:hover,
.settings-user-actions .settings-user-delete:focus-visible {
  border-color: #b83037;
  background: #b83037;
  color: #fff;
}

.settings-password-status {
  margin-top: 9px;
}

.temporary-credential-card {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #d9b75d;
  border-radius: 9px;
  background: #fffaf0;
  box-shadow: 0 5px 18px rgba(116, 85, 12, .08);
}

.temporary-credential-head,
.temporary-credential-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.temporary-credential-head strong {
  display: block;
  color: #5b4100;
}

.temporary-credential-card p {
  margin: 3px 0 0;
  color: #735e2b;
  font-size: 12.5px;
  line-height: 1.45;
}

.temporary-credential-value {
  padding: 11px 12px;
  border: 1px solid #e5cc8a;
  border-radius: 7px;
  background: #fff;
}

.temporary-credential-value code {
  color: #183b54;
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 800;
  letter-spacing: .8px;
  overflow-wrap: anywhere;
}

.mail-delivery-status {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f8e5e6;
  color: #9a3035;
  font-size: 11.5px;
  font-weight: 800;
}

.mail-delivery-status.sent {
  background: #e4f4eb;
  color: #17633f;
}

.mail-delivery-status.uncertain {
  background: #fff0cf;
  color: #8b5700;
}

.mail-delivery-status.skipped {
  background: #e5eff7;
  color: #194f73;
}

@media (max-width: 700px) {
  .dashboard-action-list { grid-template-columns: 1fr; }
  .password-policy-list {
    grid-template-columns: 1fr;
  }

  .temporary-credential-head,
  .temporary-credential-value {
    align-items: stretch;
    flex-direction: column;
  }

  .mail-delivery-status {
    align-self: flex-start;
  }

  .settings-user-actions {
    width: 100%;
  }

  .settings-user-actions button:not(.settings-user-delete) {
    flex: 1 1 100%;
    width: 100%;
  }

  .settings-user-actions .settings-user-delete {
    margin-left: auto;
  }
}

.settings-role-flags,
.settings-permission-flags {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.settings-role-flags .privacy-line,
.settings-permission-flags .privacy-line {
  min-width: 0;
  padding: 8px 10px;
}

.payment-allocation-inputs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 390px;
}

.payment-allocation-inputs label {
  display: grid;
  gap: 4px;
  min-width: 78px;
}

.payment-allocation-inputs small {
  color: var(--muted);
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf1f3;
  color: #25313a;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.public-site-card .chips {
  gap: 7px;
}

.public-site-card .chips .chip {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid #d7e2ea;
  background: #ffffff;
  color: #2d3c45;
  box-shadow: 0 1px 0 rgba(28, 82, 125, .03);
}

.public-site-card .chips .chip:has(input:checked) {
  border-color: var(--site-accent);
  background: var(--site-accent-soft);
  color: var(--site-accent-ink);
}

.site-environment-modal .chips {
  gap: 7px;
}

.site-environment-modal .chips .chip {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid #d7e2ea;
  background: #ffffff;
  color: #2d3c45;
}

.site-environment-modal .chips .chip:has(input:checked) {
  border-color: var(--brand-2);
  background: #e5eff7;
  color: var(--brand-2);
}

.chip.ok { background: #dff0e4; color: #19582c; }
.chip.warn { background: #fff1d8; color: #7c4900; }
.chip.danger { background: #fae5e6; color: #9d2e32; }
.chip.blue { background: #e5eff7; color: #1c527d; }
.chip.violet { background: #eee7fb; color: #563687; }
.chip.dark { background: #26343d; color: white; }

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

.public-page {
  width: min(100%, 1180px);
  margin: 0 auto;
}

.public-form-panel {
  border-top: 4px solid var(--brand-2);
  padding: 16px;
}

.public-lead-form {
  gap: 12px;
  align-items: start;
  font-size: 12.5px;
}

.form-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  color: var(--brand-2);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.public-lead-form .form-section-label:first-child {
  margin-top: 0;
}

.form-section-label span {
  white-space: nowrap;
}

.form-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.public-lead-form > label {
  align-self: start;
  gap: 5px;
  font-size: 12.5px;
}

.public-lead-form input,
.public-lead-form select {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 13px;
}

.public-lead-form input[type="checkbox"],
.public-lead-form input[type="radio"] {
  width: auto;
  min-height: 0;
}

.public-lead-form textarea {
  min-height: 82px;
  padding: 8px 9px;
  font-size: 13px;
}

.ateco-picker {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.public-lead-form .ateco-picker {
  padding: 12px;
  border-color: #c8d9e6;
  background: #f3f6f8;
  box-shadow: inset 4px 0 0 rgba(28, 82, 125, .16);
}

.ateco-picker-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.public-lead-form .ateco-picker-head {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.ateco-picker-head strong {
  color: var(--ink);
}

.ateco-picker-head small,
.ateco-summary,
.ateco-result-count,
.operational-activities-count {
  color: var(--muted);
  font-size: 12px;
}

.ateco-result-count,
.operational-activities-count {
  display: block;
  margin-top: 5px;
}

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

.manual-ateco-column {
  display: grid;
  gap: 8px;
  align-content: start;
}

.manual-ateco-column label {
  min-width: 0;
}

.manual-ateco-column [data-manual-ateco-search] {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 13px;
}

.manual-ateco-column [data-manual-ateco-results] {
  height: 132px;
  min-height: 0;
  padding: 5px 7px;
  font-size: 12.5px;
}

.manual-ateco-meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.manual-ateco-meta-row label {
  min-width: 0;
}

.manual-ateco-meta-row input {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 13px;
}

.manual-ateco-selection {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  height: 100%;
}

.manual-ateco-selection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.manual-ateco-selection-head label {
  min-width: 0;
}

.manual-ateco-clear {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.manual-ateco-clear:not(:disabled) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(201, 68, 72, .18);
}

.manual-ateco-clear:hover:not(:disabled) {
  background: #b83b3f;
  color: #fff;
}

.ateco-summary.manual-ateco-summary {
  display: grid;
  gap: 9px;
  margin-top: 22px;
  min-height: 174px;
  align-content: start;
  border: 1px solid #a8c6d8;
  border-left: 4px solid var(--brand-2);
  background: #f8fbfd;
  color: var(--ink);
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(28, 82, 125, .08);
}

.ateco-summary.manual-ateco-summary.is-empty {
  align-content: center;
  border-style: dashed;
  border-left-color: #a8c6d8;
  background: #f4f8fa;
  box-shadow: none;
}

.manual-ateco-summary strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.manual-ateco-summary small {
  color: var(--muted);
  font-size: 12px;
}

.manual-ateco-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.manual-ateco-summary-kicker {
  color: var(--brand-2);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.manual-ateco-summary-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 7px;
}

.manual-ateco-summary-meta span {
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #d6e4ec;
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.manual-ateco-summary-meta b {
  color: var(--ink);
}

.manual-ateco-summary-top .manual-ateco-clear {
  min-height: 28px;
  padding: 5px 10px;
  flex: 0 0 auto;
}

.public-lead-form .ateco-picker-grid {
  gap: 9px;
}

.public-lead-form [data-ateco-results] {
  height: 142px;
  min-height: 0;
  font-size: 12.5px;
}

.public-lead-form .ateco-picker-grid > label,
.public-lead-form .ateco-picker-grid > div:not(.actions) {
  min-width: 0;
  padding: 8px;
  border: 1px solid #dce5eb;
  border-radius: 8px;
  background: #fff;
}

.public-lead-form .ateco-picker-grid > .actions {
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: end;
}

.public-lead-form .ateco-add-actions button {
  width: 100%;
}

.ateco-picker select:disabled,
.ateco-picker input[readonly] {
  background: #edf2f4;
  color: #687983;
}

.ateco-disabled {
  opacity: .62;
}

.ateco-summary {
  padding: 8px 10px;
  border-radius: 6px;
  background: #eef6f8;
}

.ateco-add-actions {
  align-self: end;
}

.ateco-selected-list {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
}

.public-lead-form .ateco-selected-list {
  min-height: 168px;
  max-height: 168px;
  padding: 6px;
  border: 1px dashed #c8d9e6;
  border-radius: 8px;
  background: #f7f9fb;
}

.ateco-selected-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.ateco-selected-row .actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.ateco-primary-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ateco-selected-row .actions button {
  min-height: 26px;
  padding: 4px 7px;
  font-size: 11px;
}

.public-lead-form [data-operational-activities] {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #c8d9e6;
  border-radius: 8px;
  background: #f3f6f8;
}

.public-lead-form [data-operational-activities] > label {
  color: var(--ink);
  font-size: 12.5px;
}

.public-lead-form [data-operational-activities-list] {
  gap: 6px;
  max-height: 142px;
  overflow: auto;
  padding: 2px 4px 2px 2px;
}

.public-lead-form [data-operational-activities-list] .chip {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 650;
}

.chip input {
  flex: 0 0 auto;
  margin: 0 3px 0 0;
}

.privacy-line {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--ink);
}

.privacy-line span {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.4;
}

.privacy-line input {
  margin-top: 2px;
}

.site-setup-toggle {
  align-self: end;
  min-height: 36px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  border-color: #c7d8e4;
  background: #ffffff;
}

.site-setup-toggle span {
  align-items: center;
  line-height: 1.25;
  white-space: nowrap;
}

.site-setup-toggle input {
  margin-top: 0;
}

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

.public-lead-form > .actions {
  padding-top: 2px;
}

.public-lead-form > .actions button {
  min-width: 142px;
}

.public-result {
  margin-top: 14px;
}

.public-support-grid {
  margin-top: 16px;
  align-items: start;
}

.public-support-grid .panel {
  min-width: 0;
  overflow: hidden;
}

.public-support-grid h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.public-support-grid h2::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 20px;
  border-radius: 999px;
  background: var(--brand);
}

.public-matrix-panel .table-wrap {
  max-height: 430px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.public-matrix-panel th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.public-matrix-panel table {
  min-width: 680px;
  border: 0;
  border-radius: 0;
}

.public-matrix-panel th:first-child,
.public-matrix-panel td:first-child {
  position: sticky;
  left: 0;
}

.public-matrix-panel th:first-child {
  z-index: 3;
  background: var(--brand-2);
}

.public-matrix-panel td:first-child {
  z-index: 1;
  width: 92px;
  background: #ffffff;
  font-weight: 800;
  color: var(--brand-2);
}

.public-matrix-panel tbody tr:nth-child(even) td:first-child {
  background: #f8fbfd;
}

.public-matrix-panel tbody tr:hover td:first-child {
  background: #edf4f9;
}

.public-rules-panel .list,
.public-list-panel .list {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.public-rules-panel .row,
.public-list-panel .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.public-list-panel .row .actions {
  justify-content: flex-end;
}

.public-list-panel .row button {
  min-height: 32px;
  padding: 6px 10px;
}

.crm-panel {
  overflow: hidden;
  border-top: 4px solid var(--brand-2);
}

.crm-panel .section-title {
  position: sticky;
  top: 0;
  z-index: 4;
  padding-bottom: 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.crm-panel .section-title h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.crm-panel .section-title h2::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 20px;
  border-radius: 999px;
  background: var(--brand);
}

.crm-lead-search-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 680px) auto;
  align-items: end;
  justify-content: start;
  gap: 8px;
  padding: 12px 0 2px;
}

.crm-lead-search-toolbar label {
  min-width: 0;
  color: #536672;
  font-size: 11px;
  font-weight: 750;
}

.crm-lead-search-toolbar label span {
  display: block;
  margin-bottom: 5px;
}

.crm-lead-search-toolbar input {
  width: 100%;
  min-height: 42px;
}

.crm-lead-search-toolbar button {
  min-height: 42px;
  white-space: nowrap;
}

.crm-lead-search-toolbar small {
  grid-column: 1 / -1;
  min-height: 16px;
  color: #60727e;
}

.crm-panel [hidden] {
  display: none !important;
}

.crm-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: clamp(565px, calc(87vh - 220px), 980px);
  overflow: hidden;
  padding: 14px 2px 6px;
  align-items: start;
}

.crm-kanban:has(> .kanban-column:only-child) {
  grid-template-columns: minmax(0, 1fr);
}

.kanban-column {
  --stage-accent: #1c527d;
  --stage-bg: #f7f9fb;
  --stage-border: #d7e1e8;
  --stage-solid: #1c527d;
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  height: 100%;
  padding: 10px;
  border: 1px solid var(--stage-border);
  border-radius: 8px;
  background: var(--stage-bg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  overflow: hidden;
}

.kanban-column[data-kanban-stage="nuova_lead"] {
  --stage-accent: #1c527d;
  --stage-solid: #1c527d;
  --stage-bg: #f7f9fb;
  --stage-border: #d7e1e8;
}

.kanban-column[data-kanban-stage="lead_da_qualificare"] {
  --stage-accent: #1c527d;
  --stage-solid: #225f8a;
  --stage-bg: #f7f9fb;
  --stage-border: #d7e1e8;
}

.kanban-column[data-kanban-stage="preventivo_da_autorizzare"] {
  --stage-accent: #94621f;
  --stage-solid: #8a5b1f;
  --stage-bg: #f8f9fa;
  --stage-border: #d7e1e8;
}

.kanban-column[data-kanban-stage="attesa_accettazione_preventivo"] {
  --stage-accent: #1c527d;
  --stage-solid: #2b5f84;
  --stage-bg: #f7f9fb;
  --stage-border: #d7e1e8;
}

.kanban-column[data-kanban-stage="contratto_da_inviare"] {
  --stage-accent: #1c527d;
  --stage-solid: #2e6676;
  --stage-bg: #f7f9fb;
  --stage-border: #d7e1e8;
}

.kanban-column[data-kanban-stage="contratto_firmato_da_validare"] {
  --stage-accent: #50616d;
  --stage-solid: #50616d;
  --stage-bg: #f7f9fb;
  --stage-border: #d7e1e8;
}

.kanban-column[data-kanban-stage="cliente_acquisito"] {
  --stage-accent: #2d7d46;
  --stage-solid: #2d7d46;
  --stage-bg: #f7f9fb;
  --stage-border: #d7e1e8;
}

.kanban-column[data-kanban-stage="lead_persa"] {
  --stage-accent: #9f3d40;
  --stage-solid: #9f3d40;
  --stage-bg: #f7f9fb;
  --stage-border: #d7e1e8;
}

.kanban-stage {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 9px 12px 11px;
  border-color: color-mix(in srgb, var(--stage-solid) 28%, var(--stage-border));
  border-radius: 7px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--stage-solid) 94%, #ffffff) 0%, var(--stage-solid) 58%, color-mix(in srgb, var(--stage-solid) 84%, #000000) 100%);
  box-shadow: 0 2px 7px rgba(17, 26, 32, .08);
}

.kanban-stage.step.done {
  border-color: color-mix(in srgb, var(--stage-solid) 28%, var(--stage-border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--stage-solid) 94%, #ffffff) 0%, var(--stage-solid) 58%, color-mix(in srgb, var(--stage-solid) 84%, #000000) 100%);
  box-shadow: 0 2px 7px rgba(17, 26, 32, .08);
}

.kanban-stage b {
  display: block;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: .01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(17, 26, 32, .16);
}

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

.stage-copy span {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,.86);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-metric {
  min-width: 34px;
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,.24);
  text-align: right;
}

.stage-metric strong {
  display: block;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.stage-metric span {
  display: block;
  margin-top: 5px;
  color: rgba(255,255,255,.84);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}

.kanban-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
}

.kanban-head h3 {
  margin: 0;
  font-size: 15px;
}

.kanban-head small,
.kanban-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.kanban-count {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e5eff7;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
}

.kanban-stack {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 4px 2px 0;
  scrollbar-gutter: stable;
}

.kanban-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  padding: 8px;
  border: 2px solid rgba(28, 82, 125, .34);
  border-radius: 6px;
  background: white;
  box-shadow: 0 3px 8px rgba(28, 82, 125, .05);
}

.kanban-card:hover {
  border-color: rgba(201, 68, 72, .58);
  box-shadow: 0 5px 14px rgba(28, 82, 125, .08);
}

.kanban-card .chips {
  max-height: 48px;
  overflow: hidden;
  gap: 4px;
}

.lead-auth-summary {
  margin-top: 4px;
}

.kanban-card .lead-auth-summary {
  grid-template-columns: 1fr;
}

.kanban-card .lead-auth-summary > div {
  padding: 8px;
}

.kanban-card .chip {
  max-width: 100%;
  min-height: 22px;
  padding: 3px 6px;
  font-size: 11px;
  border-radius: 5px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.kanban-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
  padding-bottom: 5px;
  border-bottom: 1px solid #edf2f5;
  flex-wrap: wrap;
}

.kanban-card-title strong {
  flex: 1 1 118px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.kanban-card-title .chip {
  flex: 0 1 auto;
  max-width: 100%;
  white-space: normal;
  text-align: left;
  line-height: 1.15;
}

.kanban-meta,
.kanban-note {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-meta {
  -webkit-line-clamp: 1;
  line-clamp: 1;
  padding: 5px 7px;
  border-radius: 5px;
  background: #f5f7f9;
  color: #50616d;
}

.kanban-note {
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

.kanban-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  justify-content: stretch;
  gap: 5px;
  margin-top: -1px;
  padding: 5px;
  border: 1px solid #dce6ed;
  border-radius: 4px;
  background: #eef3f6;
}

.kanban-actions:has(> button:only-child) {
  grid-template-columns: 1fr;
}

.kanban-actions:has(> button:nth-child(3)) {
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
}

.kanban-actions button {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 5px 7px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: none;
}

.kanban-actions button[data-action="lead-request-auth"],
.kanban-actions button[data-action="lead-upload-contract"],
.kanban-actions button[data-action="lead-confirm-client"] {
  grid-column: 1 / -1;
}

.kanban-actions button.secondary {
  border-color: #d6e0e7;
  background: #fff;
  color: var(--brand-2);
}

.kanban-actions button:disabled {
  border-color: #d9e1e6;
  background: #e8eef2;
  color: #7d8b94;
  opacity: 1;
}

.kanban-empty {
  min-height: 78px;
  display: grid;
  place-items: center;
  background: #fff;
}

.lead-contact-form .lead-contact-conditional {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8e5ee;
  border-radius: 8px;
  background: #f8fbfd;
}

.lead-contact-form .lead-contact-conditional[hidden] {
  display: none;
}

.lead-contact-form .lead-contact-conditional > * {
  grid-column: span 6;
}

.lead-contact-form .lead-contact-conditional .section-title,
.lead-contact-form .lead-contact-conditional .notice,
.lead-contact-form .lead-contact-check {
  grid-column: span 12;
}

.lead-contact-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.calendar-top-actions,
.calendar-control-actions,
.calendar-filter-switch,
.calendar-view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.calendar-control-actions {
  justify-content: flex-end;
}

.calendar-filter-switch .active,
.calendar-view-switch .active {
  border-color: var(--brand-2);
  background: #e5eff7;
  color: var(--brand-2);
}

.calendar-control-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.calendar-control-panel h2 {
  margin-bottom: 4px;
}

.calendar-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(160px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.calendar-day-column {
  min-width: 160px;
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid #d8e5ee;
  border-radius: 8px;
  background: #fbfdfe;
}

.calendar-day-column.is-today {
  border-color: var(--brand-2);
  background: #f3f8fc;
}

.calendar-day-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-day-column header strong {
  color: var(--brand-2);
  font-size: 13px;
  text-transform: capitalize;
}

.calendar-day-column header span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e5eff7;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 850;
}

.calendar-day-stack,
.calendar-task-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.calendar-task {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d8e5ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(28, 82, 125, .05);
}

.calendar-day-column .calendar-task {
  grid-template-columns: 1fr;
  align-items: start;
}

.calendar-task.is-complete {
  opacity: .72;
}

.calendar-task.is-overdue {
  border-color: #eeb5ba;
  background: #fff7f7;
}

.calendar-task-time {
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.calendar-task.is-overdue .calendar-task-time {
  color: var(--danger);
}

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

.calendar-task-main strong,
.calendar-task-main small {
  overflow-wrap: anywhere;
}

.calendar-task-main strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.calendar-task-main small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.calendar-task-main .chips {
  margin-top: 6px;
}

.calendar-task-actions {
  justify-content: flex-end;
}

.calendar-day-column .calendar-task-actions {
  justify-content: stretch;
}

.calendar-day-column .calendar-task-actions button {
  flex: 1 1 80px;
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
  border-radius: 8px;
}

.admin-settings-grid .settings-values-panel {
  grid-column: span 12;
  overflow: visible;
}

.settings-role-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.settings-role-context .chips {
  margin: 0;
}

.settings-overview {
  display: grid;
  gap: 18px;
}

.settings-overview-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  border: 1px solid #c8dae6;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #edf5fa 100%);
  box-shadow: 0 10px 24px rgba(28, 82, 125, .07);
}

.settings-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #2b719f;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.settings-overview-intro h2,
.settings-detail-heading h2 {
  margin: 0;
  color: var(--brand-2);
}

.settings-overview-intro p,
.settings-detail-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.settings-overview-count {
  display: grid;
  flex: 0 0 112px;
  justify-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: #ffffff;
  color: var(--brand-2);
  box-shadow: 0 5px 16px rgba(28, 82, 125, .08);
}

.settings-overview-count strong {
  font-size: 25px;
  line-height: 1;
}

.settings-overview-count span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  text-align: center;
}

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

.settings-group-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d4dfe7;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 7px 20px rgba(25, 61, 86, .055);
}

.settings-group-card > header {
  display: flex;
  gap: 12px;
  padding: 18px 18px 15px;
  border-bottom: 1px solid #e2e9ee;
  background: #f9fbfc;
}

.settings-group-mark {
  flex: 0 0 5px;
  align-self: stretch;
  min-height: 38px;
  border-radius: 999px;
  background: var(--brand-2);
}

.settings-group-card h3 {
  margin: 0;
  color: var(--brand-2);
  font-size: 17px;
}

.settings-group-card header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.settings-group-links {
  display: grid;
  padding: 5px 12px 11px;
}

.settings-overview-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 12px 8px;
  border: 0;
  border-bottom: 1px solid #edf1f4;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  text-align: left;
}

.settings-overview-link:last-child {
  border-bottom: 0;
}

.settings-overview-link:hover:not(:disabled),
.settings-overview-link:focus-visible {
  padding-left: 12px;
  border-color: #dce8ef;
  background: #eff6fa;
  color: var(--brand-2);
  box-shadow: none;
}

.settings-overview-link strong,
.settings-overview-link small {
  display: block;
  overflow-wrap: anywhere;
}

.settings-overview-link strong {
  font-size: 13.5px;
}

.settings-overview-link small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 560;
  line-height: 1.35;
}

.settings-link-arrow {
  color: #5890b4;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}

.settings-detail-navigation {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-color: #c8dae6;
}

.settings-back-button {
  white-space: nowrap;
}

.settings-detail-heading {
  min-width: 0;
}

.settings-detail-heading h2 {
  font-size: 19px;
}

.settings-detail-heading p {
  font-size: 12.5px;
}

.settings-switcher {
  position: relative;
  justify-self: end;
}

.settings-switcher > summary {
  min-width: 142px;
  padding: 9px 12px;
  border: 1px solid #b9cedc;
  border-radius: 8px;
  background: #f5f9fb;
  color: var(--brand-2);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 800;
  list-style: none;
  text-align: center;
}

.settings-switcher > summary::-webkit-details-marker {
  display: none;
}

.settings-switcher > summary::after {
  content: " +";
}

.settings-switcher[open] > summary::after {
  content: " −";
}

.settings-switcher-groups {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: min(720px, calc(100vw - 72px));
  max-height: min(70vh, 620px);
  padding: 16px;
  overflow: auto;
  border: 1px solid #c8d8e3;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(25, 61, 86, .2);
}

.settings-switcher-group > strong {
  display: block;
  margin-bottom: 7px;
  color: #526a79;
  font-size: 11px;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.settings-switcher-group > div {
  display: grid;
  gap: 5px;
}

.settings-switcher .lead-work-tab-button {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  text-align: left;
}

@media (max-width: 850px) {
  .settings-overview-grid {
    grid-template-columns: 1fr;
  }

  .settings-detail-navigation {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .settings-switcher {
    grid-column: span 2;
    justify-self: stretch;
  }

  .settings-switcher > summary {
    width: 100%;
  }

  .settings-switcher-groups {
    right: auto;
    left: 0;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .settings-overview-intro {
    align-items: flex-start;
    padding: 20px;
  }

  .settings-overview-count {
    display: none;
  }

  .settings-detail-navigation {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .settings-back-button,
  .settings-switcher {
    grid-column: auto;
    width: 100%;
  }

  .settings-switcher-groups {
    position: static;
    grid-template-columns: 1fr;
    width: 100%;
    max-height: none;
    margin-top: 8px;
    box-shadow: none;
  }
}

.admin-settings-grid .settings-values-panel .table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 4px;
}

.admin-settings-grid .settings-values-panel table {
  width: max-content;
  min-width: 100%;
}

.admin-settings-grid .settings-values-panel th,
.admin-settings-grid .settings-values-panel td {
  min-width: 140px;
}

.admin-settings-grid .settings-values-panel input,
.admin-settings-grid .settings-values-panel select,
.admin-settings-grid .settings-values-panel textarea {
  width: 100%;
  min-width: 0;
}

.admin-settings-grid .settings-values-panel textarea {
  resize: vertical;
  min-height: 58px;
}

.admin-settings-grid .settings-values-panel td:last-child {
  width: 1%;
  min-width: 96px;
  white-space: nowrap;
}

.admin-email-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 14px;
  margin-top: 14px;
}

.admin-email-template-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}

.admin-email-template-card .section-title {
  align-items: flex-start;
  margin-bottom: 14px;
}

.admin-email-template-card .section-title h3 {
  margin: 0 0 4px;
}

.admin-email-fixed-block {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed #85aeca;
  border-radius: 8px;
  background: #edf6fc;
  color: #1c527d;
}

.admin-email-preview {
  display: grid;
  gap: 14px;
}

.admin-email-preview-subject,
.admin-email-preview-message {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.admin-email-preview-fixed {
  margin-bottom: 14px;
  padding: 12px;
  border-left: 4px solid #1c527d;
  border-radius: 7px;
  background: #edf6fc;
  color: #244d69;
}

.admin-email-preview-fixed p {
  margin: 7px 0 0;
}

.admin-email-preview-cta {
  display: inline-block;
  margin: 8px 0 14px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #1c527d;
  color: #fff;
  font-weight: 800;
}

.support-view {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.support-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 18px 28px;
  align-items: center;
  padding: 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, #143d5c 0%, #1c527d 58%, #2d6d9d 100%);
  color: #fff;
  box-shadow: 0 14px 36px rgba(28, 82, 125, .18);
}

.support-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: #cfe4f3;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.support-hero h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.08;
}

.support-hero p {
  max-width: 720px;
  margin: 9px 0 0;
  color: rgba(255,255,255,.86);
  font-size: 14px;
}

.support-search {
  color: #fff;
}

.support-search input {
  min-height: 48px;
  border-color: rgba(255,255,255,.4);
  box-shadow: 0 8px 22px rgba(8, 25, 38, .16);
}

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

.support-stats > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
}

.support-stats strong {
  font-size: 20px;
}

.support-stats span {
  color: rgba(255,255,255,.8);
  font-size: 12px;
}

.support-area-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr));
  gap: 9px;
  min-width: 0;
}

.support-area-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-areas: "symbol title" "symbol count";
  align-items: center;
  gap: 2px 9px;
  min-width: 0;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  white-space: normal;
  box-shadow: 0 5px 14px rgba(28, 82, 125, .06);
}

.support-area-button:hover:not(:disabled),
.support-area-button.active {
  border-color: #1c527d;
  background: #edf5fb;
  color: #143d5c;
  box-shadow: 0 7px 18px rgba(28, 82, 125, .12);
}

.support-area-button strong {
  grid-area: title;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.support-area-button small {
  grid-area: count;
  color: var(--muted);
  font-size: 10.5px;
}

.support-area-symbol {
  grid-area: symbol;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #1c527d;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .03em;
}

.support-area-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 7px;
  padding: 10px;
  border: 1px dashed #9cb8cb;
  border-radius: 9px;
  background: #f6fafc;
}

.support-area-admin-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 7px;
  background: #fff;
}

.support-area-admin-list span {
  min-width: 0;
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.support-area-admin-list button,
.support-item-actions button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 11px;
}

.support-infographics-section,
.support-faq-section {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.support-infographic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
}

.support-infographic-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.support-infographic-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 8.6;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background: #eaf1f6;
  color: var(--brand-2);
  box-shadow: none;
}

.support-infographic-preview:hover:not(:disabled) {
  background: #dfeaf2;
  box-shadow: none;
}

.support-infographic-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease;
}

.support-infographic-preview:hover img {
  transform: scale(1.015);
}

.support-infographic-copy {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 14px;
}

.support-infographic-copy h3,
.support-infographic-copy p {
  margin: 0;
}

.support-infographic-copy h3 {
  color: #143d5c;
  font-size: 16px;
  line-height: 1.25;
}

.support-infographic-copy p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.support-infographic-copy .actions {
  align-self: end;
  margin-top: 3px;
}

.support-infographic-copy .actions button {
  flex: 1 1 110px;
  min-width: 0;
  white-space: normal;
}

.support-faq-groups {
  display: grid;
  gap: 16px;
}

.support-faq-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d7e3eb;
  border-radius: 9px;
  background: #f8fbfd;
}

.support-group-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 11px;
}

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

.support-group-head h2 {
  color: #143d5c;
  font-size: 16px;
}

.support-group-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.support-faq-list {
  display: grid;
  gap: 7px;
}

.support-faq {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d8e1e8;
  border-radius: 8px;
  background: #fff;
}

.support-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  color: #172026;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}

.support-faq summary::-webkit-details-marker {
  display: none;
}

.support-faq summary::after {
  content: "+";
  flex: 0 0 auto;
  color: #1c527d;
  font-size: 20px;
  font-weight: 500;
}

.support-faq[open] summary {
  border-bottom: 1px solid #e2e9ee;
  background: #f1f7fb;
}

.support-faq[open] summary::after {
  content: "−";
}

.support-faq-answer {
  padding: 12px 14px 14px;
}

.support-faq-answer p {
  margin: 0;
  color: #485b68;
  font-size: 13px;
  line-height: 1.55;
}

.support-item-actions {
  justify-content: flex-end;
  margin-top: 11px;
}

.support-no-results {
  min-height: 100px;
}

.support-infographic-modal {
  width: min(1500px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}

.support-infographic-viewer {
  display: grid;
  gap: 12px;
}

.support-infographic-viewer img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

@media (min-width: 900px) {
  #lead-work-form .table-wrap {
    overflow-x: visible;
  }

  #lead-work-form table {
    min-width: 0;
    table-layout: fixed;
  }
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #ffffff;
  background: var(--brand-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

tbody tr:nth-child(even) td {
  background: #f8fbfd;
}

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

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr.questionnaire-shared-row > td,
tbody tr.questionnaire-shared-row:hover > td {
  background: #eef7fc;
  border-top: 2px solid #78aeca;
  border-bottom-color: #c7dce8;
}

tbody tr.questionnaire-shared-row > td:first-child small {
  color: var(--brand-2);
  font-weight: 800;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  gap: 8px;
}

.crm-workflow {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 7px;
}

.step {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
  min-height: 82px;
}

.crm-workflow .step {
  min-height: 72px;
  padding: 10px;
  border-radius: 7px;
}

.crm-workflow .step b {
  font-size: 12.5px;
  line-height: 1.18;
}

.crm-workflow .step span {
  font-size: 11.5px;
  line-height: 1.25;
}

.step.done {
  border-color: #cfe3f2;
  background: #f2f7fb;
}

.step.blocked {
  border-color: #efc0c2;
  background: #fff2f3;
}

.step b {
  display: block;
  font-size: 13px;
}

.step span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.kanban-stage .stage-copy span {
  margin-top: 6px;
  color: rgba(255,255,255,.9);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.2;
}

.kanban-stage .stage-metric span {
  margin-top: 5px;
  color: rgba(255,255,255,.86);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}

.notice {
  min-width: 0;
  max-width: 100%;
  border-left: 4px solid var(--brand-2);
  background: #f2f7fb;
  padding: 12px 14px;
  border-radius: 6px;
  color: #213241;
  overflow-wrap: anywhere;
}

.notice.warn { border-color: var(--warn); background: #fff8ec; }
.notice.danger { border-color: var(--danger); background: #fff3f4; }
.notice.ok { border-color: var(--ok); background: #eef8f1; }
.notice.violet { border-color: var(--violet); background: #f7f3fd; }

.contract-download-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.contract-download-panel span {
  flex: 1 1 320px;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
}

.selector {
  display: grid;
  gap: 8px;
}

.selector button {
  text-align: left;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.selector button:hover:not(:disabled) {
  background: #f3f7fa;
  color: var(--ink);
  box-shadow: none;
}

.selector button.active {
  border-color: var(--brand);
  box-shadow: inset 4px 0 0 var(--brand);
}

.client-shell .selector {
  align-self: start;
  position: sticky;
  top: 18px;
}

.client-list-panel {
  overflow: hidden;
}

.client-list {
  display: grid;
  gap: 10px;
}

.client-list-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(360px, 2fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.client-list-row.active {
  border-color: var(--brand);
  box-shadow: inset 4px 0 0 var(--brand);
}

.client-list-main {
  min-width: 0;
}

.client-list-main strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.client-list-main small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.client-list-main .chips {
  margin-top: 8px;
}

.client-list-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.client-list-details div,
.client-data-strip div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #d9e6ef;
  border-radius: 7px;
  background: #f8fbfd;
}

.client-list-details span,
.client-data-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.client-list-details strong,
.client-data-strip strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.client-data-strip small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.client-list-actions {
  display: flex;
  justify-content: flex-end;
}

.client-list-actions button {
  min-width: 118px;
  white-space: nowrap;
}

.client-list-row-simple {
  display: block;
  padding: 0;
}

.client-list-row-button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) minmax(180px, 1.2fr) minmax(150px, 1fr) repeat(3, minmax(88px, .7fr)) minmax(92px, auto);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 12px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.client-list-row-button:hover:not(:disabled),
.client-list-row-button:focus-visible {
  background: #f3f7fa;
  color: var(--ink);
  box-shadow: none;
}

.client-list-row-button strong,
.client-list-row-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-list-row-button strong {
  font-size: 14px;
}

.client-list-row-button span {
  color: var(--muted);
  font-size: 12px;
}

.client-list-row-button .chips {
  display: flex;
  justify-content: flex-end;
  overflow: visible;
}

.client-workspace {
  align-content: start;
}

.client-detail-head {
  border-top: 4px solid var(--brand);
}

.client-data-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.client-data-strip-wide {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.client-stat {
  min-width: 0;
  padding: 12px;
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  background: #f8fbfd;
}

.client-stat span,
.client-stat small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.client-stat strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--ink);
  font-size: 22px;
}

.client-stat.blue { border-color: #cfe3f1; background: #f4f9fd; }
.client-stat.violet { border-color: #ded8f3; background: #f8f6fe; }
.client-stat.ok { border-color: #cce8d4; background: #f4fbf6; }
.client-stat.warn { border-color: #f0dfb8; background: #fffaf0; }
.client-stat.danger { border-color: #f0c1c1; background: #fff5f5; }

.client-info-list {
  display: grid;
  gap: 9px;
}

.client-info-list div,
.client-checklist-summary div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #d9e6ef;
  border-radius: 7px;
  background: #f8fbfd;
}

.client-info-list span,
.client-checklist-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.client-info-list strong,
.client-checklist-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.client-missing-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-environment-grid {
  display: grid;
  gap: 9px;
}

.client-environment-group {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.client-environment-group summary,
.client-environment-single {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 11px 13px;
}

.client-environment-group summary {
  list-style: none;
  cursor: pointer;
}

.client-environment-group summary::-webkit-details-marker {
  display: none;
}

.client-environment-group summary::after {
  content: "⌄";
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.client-environment-group[open] summary::after {
  transform: rotate(180deg);
}

.client-environment-group summary:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

.client-environment-group strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.client-environment-group summary > span,
.client-environment-single > span {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.client-environment-group ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 11px 14px 13px 36px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.client-environment-group li {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.client-environment-group li small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.client-checklist-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.client-checklist-form {
  display: grid;
  gap: 14px;
}

.client-checklist-environment {
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.client-checklist-environment > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f5;
  background: #f8fbfd;
}

.client-checklist-environment header strong,
.client-checklist-environment header small {
  display: block;
  overflow-wrap: anywhere;
}

.client-checklist-environment header small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.client-lead-base {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px;
}

.client-lead-base span {
  min-width: 0;
  padding: 8px;
  border: 1px solid #edf2f5;
  border-radius: 7px;
  background: #fbfdff;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.client-checklist-environment textarea,
.client-checklist-environment select {
  width: 100%;
}

.client-checklist-actions {
  display: flex;
  justify-content: flex-end;
}

.client-area {
  border-top: 4px solid var(--brand);
}

.document-upload-receipt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--ok) 45%, white);
  border-left: 4px solid var(--ok);
  border-radius: 8px;
  background: #eef8f1;
}

.document-upload-receipt-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-weight: 800;
}

.document-upload-receipt-copy {
  min-width: 0;
}

.document-upload-receipt-copy > strong,
.document-upload-receipt-copy > span {
  display: block;
}

.document-upload-receipt-copy > span {
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.document-upload-receipt-copy dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px 14px;
  margin: 12px 0 8px;
}

.document-upload-receipt-copy dl div {
  min-width: 0;
}

.document-upload-receipt-copy dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.document-upload-receipt-copy dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 650;
}

.document-archive-path {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

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

.client-columns h3,
.client-subsection h3,
.client-area h3 {
  margin: 0 0 10px;
  color: var(--brand-2);
  font-size: 13px;
  text-transform: uppercase;
}

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

.client-site-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  background: #fff;
}

.client-card-head,
.client-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.client-card-foot {
  flex-wrap: wrap;
}

.client-card-foot button {
  flex: 1 1 138px;
  min-width: 0;
  white-space: normal;
}

.client-card-head strong {
  display: block;
  color: var(--ink);
  line-height: 1.25;
}

.client-card-head small,
.client-card-body span,
.client-card-foot span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.client-card-body {
  display: grid;
  gap: 5px;
  margin: 10px 0 12px;
}

.client-site-environments {
  display: grid;
  gap: 8px;
  margin-top: 5px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}

.client-site-environments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.client-site-environments-head strong {
  color: var(--ink);
  font-size: 12px;
}

.client-site-environments-head small {
  color: var(--muted);
  font-size: 11px;
}

.client-site-environment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.client-site-environment-list span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 7px 5px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.3;
}

.client-site-environment-list strong {
  flex: 0 0 auto;
  min-width: 19px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--status-neutral);
  color: var(--ink);
  font-size: 11px;
  text-align: center;
}

.client-card-foot .kpi-bar {
  flex: 1 1 auto;
  min-width: 100px;
}

.client-document-groups {
  display: grid;
  gap: 10px;
}

.client-document-groups details {
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.client-document-groups summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 11px 13px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}

.client-document-groups summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.client-document-groups .table-wrap {
  border: 0;
  border-top: 1px solid #edf2f5;
  border-radius: 0;
}

.client-mini-table table {
  font-size: 12px;
}

.client-mini-table th,
.client-mini-table td {
  padding: 8px 9px;
}

.client-compact-form {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  background: #f8fbfd;
}

.client-compact-form label {
  min-width: 0;
}

.client-compact-form input,
.client-compact-form select,
.client-compact-form textarea,
.client-area select {
  max-width: 100%;
}

.client-subsection {
  margin-top: 16px;
}

.client-portal-box {
  padding: 12px;
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  background: #f8fbfd;
}

.kpi-bar {
  height: 10px;
  background: #e6ebee;
  border-radius: 999px;
  overflow: hidden;
}

.kpi-fill {
  height: 100%;
  background: var(--brand);
}

.kpi-fill.warn { background: var(--warn); }
.kpi-fill.danger { background: var(--danger); }

.log {
  max-height: 280px;
  overflow: auto;
  background: #111a20;
  color: #d7e0e5;
  border-radius: 8px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.empty {
  color: var(--muted);
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fafbfb;
}

.kanban-select {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.kanban-select select {
  min-height: 34px;
}

.public-sites {
  display: grid;
  gap: 16px;
}

.public-site-card {
  --site-accent: var(--brand-2);
  --site-accent-soft: #f4f8fb;
  --site-accent-line: #b9d0df;
  --site-accent-ink: #164566;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  border: 2px solid var(--site-accent);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(135deg, #ffffff 0%, var(--site-accent-soft) 100%);
  box-shadow: 0 8px 18px rgba(28, 82, 125, .06);
}

.public-site-card > label,
.public-site-card .manual-ateco-column label,
.public-site-card .manual-ateco-meta-row label,
.site-interview > label {
  min-width: 0;
  gap: 6px;
  color: #344957;
  font-size: 12px;
  font-weight: 820;
}

.public-site-card input:not([type="checkbox"]):not([type="radio"]),
.public-site-card select,
.public-site-card textarea {
  border-color: #c7d8e4;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(28, 82, 125, .03);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.public-site-card input:not([type="checkbox"]):not([type="radio"]):hover,
.public-site-card select:hover,
.public-site-card textarea:hover {
  border-color: #aabfce;
  background: #fbfdfe;
}

.public-site-card input:not([type="checkbox"]):not([type="radio"]):focus,
.public-site-card select:focus,
.public-site-card textarea:focus {
  border-color: var(--site-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--site-accent) 18%, transparent);
}

.public-site-card .form-section-label {
  margin-top: 6px;
  color: var(--site-accent-ink);
}

.public-site-card .form-section-label span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid var(--site-accent-line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--site-accent-ink);
}

.public-site-card .form-section-label::after {
  background: var(--site-accent-line);
}

.lead-site-card-head {
  grid-column: span 12;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 8px;
  border-bottom: 2px solid var(--site-accent-line);
  background: transparent;
}

.lead-site-card-head > div {
  display: grid;
  gap: 3px;
  position: relative;
  padding-left: 12px;
}

.lead-site-card-head > div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 4px;
  border-radius: 999px;
  background: var(--site-accent);
}

.lead-site-card-head strong {
  color: var(--site-accent-ink);
  font-size: 22px;
  line-height: 1.05;
}

.lead-site-card-kicker {
  color: var(--site-accent-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lead-site-card-head [data-lead-site-role] {
  background: var(--site-accent);
  color: #fff;
  margin-bottom: 1px;
}

.lead-site-card-head [data-lead-site-role]:empty {
  display: none;
}

.public-site-card.lead-site-multisite-card {
  box-shadow: 0 10px 22px rgba(28, 82, 125, .08);
}

.public-site-card[data-site-index="1"] {
  --site-accent: #2f7d6b;
  --site-accent-soft: #eef8f5;
  --site-accent-line: #b7d8cf;
  --site-accent-ink: #246454;
}

.public-site-card[data-site-index="2"] {
  --site-accent: #6d4aa0;
  --site-accent-soft: #f4f0fb;
  --site-accent-line: #cbbce1;
  --site-accent-ink: #563687;
}

.public-site-card[data-site-index="3"] {
  --site-accent: #b46b00;
  --site-accent-soft: #fff6e7;
  --site-accent-line: #e4c996;
  --site-accent-ink: #7c4900;
}

.public-site-card[data-site-index="4"] {
  --site-accent: #8c4f5b;
  --site-accent-soft: #fbf1f3;
  --site-accent-line: #dfbcc4;
  --site-accent-ink: #703946;
}

.public-site-card[data-site-index="5"] {
  --site-accent: #4f6f91;
  --site-accent-soft: #f0f5fb;
  --site-accent-line: #bfcedf;
  --site-accent-ink: #36526f;
}

.public-site-card[data-site-index="6"],
.public-site-card[data-site-index="8"] {
  --site-accent: #3d7a45;
  --site-accent-soft: #eef8f1;
  --site-accent-line: #b9d8bd;
  --site-accent-ink: #2d6634;
}

.public-site-card[data-site-index="7"],
.public-site-card[data-site-index="9"] {
  --site-accent: #8a5d2f;
  --site-accent-soft: #f8f3ed;
  --site-accent-line: #d7c2a9;
  --site-accent-ink: #684620;
}

.public-site-card .form-section-label,
.public-site-card .ateco-picker,
.public-site-card [data-operational-activities],
.public-site-card [data-preliminary-interview],
.public-site-card [data-site-interview] {
  grid-column: span 12;
}

.preliminary-interview {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--site-accent-line, var(--line));
  border-radius: 8px;
  background: rgba(255,255,255,.76);
}

.preliminary-summary-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.preliminary-question-list {
  display: grid;
  gap: 10px;
}

.preliminary-question-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(120px, .6fr) minmax(92px, .42fr) minmax(92px, .42fr) minmax(130px, .55fr) minmax(180px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #dbe6ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(28, 82, 125, .04);
}

.site-question-row {
  grid-template-columns: minmax(240px, 1.7fr) minmax(120px, .55fr) minmax(130px, .55fr) minmax(180px, 1fr);
}

.preliminary-question-text {
  align-self: center;
  min-width: 0;
}

.preliminary-question-text strong {
  display: block;
  color: var(--site-accent-ink, var(--brand-2));
  overflow-wrap: anywhere;
}

.preliminary-question-text small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
}

.preliminary-question-row label {
  min-width: 0;
  font-size: 12px;
  color: #465966;
  font-weight: 800;
}

.preliminary-question-row input,
.preliminary-question-row select,
.preliminary-question-row textarea {
  margin-top: 4px;
}

.site-icp-summary {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--site-accent-line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, var(--site-accent-soft) 100%);
  min-width: 0;
  overflow: visible;
}

.site-icp-summary .preliminary-summary-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.site-icp-summary .chip {
  flex: 0 1 auto;
  min-height: 30px;
  padding: 6px 11px;
  font-size: 12px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  border: 1px solid rgba(23, 32, 38, .06);
}

.site-icp-summary .chip.violet {
  max-width: none;
  text-align: left;
}

.site-icp-breakdown-card {
  width: 100%;
  overflow: hidden;
  border: 1px solid #cbdde8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(22, 69, 96, .08);
}

.site-icp-breakdown-card.warn {
  border-color: #e7c36f;
}

.site-icp-breakdown-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: linear-gradient(135deg, #eff8fc 0%, #fff8ea 100%);
  border-bottom: 1px solid #dce8ee;
}

.site-icp-breakdown-head h4 {
  margin: 2px 0 0;
  color: #173f55;
  font-size: 16px;
}

.site-icp-breakdown-kicker {
  display: block;
  color: #547383;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.site-icp-breakdown-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px 8px;
}

.site-icp-breakdown-metrics > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #dfe9ee;
  border-radius: 8px;
  background: #f8fbfc;
}

.site-icp-breakdown-metrics small,
.site-icp-breakdown-metrics strong {
  display: block;
  overflow-wrap: anywhere;
}

.site-icp-breakdown-metrics small {
  margin-bottom: 4px;
  color: #607581;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.site-icp-breakdown-metrics strong {
  color: #163e54;
  font-size: 13px;
}

.site-icp-type-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 14px 10px;
}

.site-icp-type-totals .chip {
  white-space: normal;
}

.site-icp-breakdown-card details {
  border-top: 1px solid #e3ecef;
}

.site-icp-breakdown-card details > summary {
  padding: 12px 15px;
  color: #234d62;
  background: #f7fafb;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.site-icp-breakdown-table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.site-icp-breakdown-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 11px;
}

.site-icp-breakdown-table th,
.site-icp-breakdown-table td {
  padding: 8px 9px;
  border: 1px solid #e2eaee;
  text-align: left;
  vertical-align: top;
}

.site-icp-breakdown-table thead th,
.site-icp-breakdown-table tfoot th {
  color: #fff;
  background: #1c526d;
  font-size: 10px;
  letter-spacing: .02em;
}

.site-icp-breakdown-table td small {
  display: block;
  margin-top: 3px;
  color: #71828b;
  font-size: 10px;
}

.site-icp-breakdown-table tr.is-scoring td {
  background: #f3faf6;
}

.site-icp-breakdown-table tr.is-scoring td:last-child {
  color: #1d6b45;
  background: #e3f4e9;
}

.site-icp-breakdown-table tr.is-zero td {
  color: #667780;
}

.site-icp-breakdown-formula {
  padding: 11px 15px;
  border-top: 1px solid #e3ecef;
  color: #425b68;
  background: #fff9ed;
  font-size: 11.5px;
}

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

@media (max-width: 640px) {
  .site-icp-breakdown-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

.site-interview {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--site-accent-line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}

.site-interview > .notice {
  align-self: end;
  min-width: 0;
  min-height: 38px;
  padding: 9px 12px;
  border-color: var(--site-accent);
  line-height: 1.35;
}

.site-interview-area,
.site-environment-cards {
  grid-column: span 12;
}

.site-interview-area > label,
.site-environment-area > label {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-2);
  font-weight: 800;
  font-size: 13px;
}

.site-environment-search {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin: 8px 0 10px;
}

.site-environment-search-label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
}

.site-environment-search input,
.site-environment-search select {
  width: 100%;
  min-width: 0;
  height: 38px;
}

.site-environment-search button {
  min-height: 38px;
  white-space: nowrap;
}

.site-environment-cards {
  display: grid;
  gap: 12px;
}

.site-environment-catalog {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.site-environment-open-card {
  min-width: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  white-space: normal;
  padding: 11px 12px;
  border: 1px solid #c7d8e4;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(28, 82, 125, .04);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.site-environment-open-card:hover:not(:disabled) {
  border-color: var(--site-accent-line);
  background: #fbfdfe;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(28, 82, 125, .08);
}

.site-environment-open-card.is-active {
  border-color: var(--site-accent);
  background: var(--site-accent-soft);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--site-accent) 18%, transparent);
}

.site-environment-open-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.site-environment-open-button {
  min-height: 30px;
  padding: 6px 11px;
  border-color: var(--site-accent-line);
  background: #ffffff;
  color: var(--site-accent-ink);
  font-size: 12px;
  box-shadow: none;
}

.site-environment-open-button:hover:not(:disabled) {
  border-color: var(--site-accent);
  background: var(--site-accent-soft);
  color: var(--site-accent-ink);
}

.site-environment-open-card strong,
.site-environment-open-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.site-environment-open-card small {
  color: #667783;
  font-weight: 800;
}

.site-environment-card {
  border-top: 1px solid var(--site-accent-line, var(--line));
  padding-top: 12px;
}

.site-environment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dbe6ee;
}

.site-environment-head strong {
  color: var(--site-accent-ink, var(--brand-2));
  font-size: 18px;
  line-height: 1.15;
}

.site-environment-head small {
  color: var(--muted);
  font-weight: 700;
}

.site-environment-flow-title {
  margin: 10px 0 8px;
  color: var(--site-accent-ink, var(--brand-2));
  font-size: 13px;
  font-weight: 850;
}

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

.site-environment-area {
  min-width: 0;
}

.site-environment-hint {
  width: 100%;
  margin: 0;
  padding: 9px 10px;
  text-align: left;
}

.site-environment-modal {
  width: min(980px, calc(100vw - 40px));
  max-height: min(780px, calc(100vh - 40px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-color: #c7d8e4;
  background: #f7fafc;
}

.site-environment-modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom-color: #d8e5ee;
  background: #ffffff;
}

.site-environment-modal-body {
  padding: 16px;
}

.site-environment-modal .site-environment-card {
  border-top: 0;
  padding-top: 0;
  display: grid;
  gap: 10px;
}

.site-environment-modal-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #d8e5ee;
  background: #fff;
}

.site-environment-modal-actions .secondary {
  border-color: #c7d8e4;
  background: #ffffff;
  color: #344957;
}

.site-environment-modal-actions button:not(.secondary) {
  min-width: 88px;
}

/* Visual refresh for operative site cards: stronger template without changing markup or logic. */
.public-site-card {
  position: relative;
  overflow: hidden;
  gap: 16px;
  padding: 18px;
  border: 2px solid var(--site-accent);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94) 0%, rgba(255,255,255,.98) 38%, #ffffff 100%),
    linear-gradient(135deg, var(--site-accent-soft) 0%, #ffffff 62%);
  box-shadow: 0 18px 42px rgba(28, 82, 125, .12);
}

.public-site-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: var(--site-accent);
}

.lead-site-card-head {
  margin: -2px -2px 4px;
  padding: 18px 2px 14px;
  border-bottom: 0;
}

.lead-site-card-head > div {
  gap: 5px;
  padding-left: 16px;
}

.lead-site-card-head > div::before {
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--site-accent);
  box-shadow: 0 0 0 4px var(--site-accent-soft);
}

.lead-site-card-head strong {
  font-size: 28px;
  font-weight: 850;
  letter-spacing: 0;
}

.lead-site-card-kicker {
  font-size: 11px;
  color: #526775;
}

.lead-site-card-head [data-lead-site-role] {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--site-accent) 22%, transparent);
}

.public-site-card .form-section-label {
  margin: 8px 0 -2px;
}

.public-site-card .form-section-label span {
  min-height: 30px;
  padding: 6px 11px;
  border: 0;
  border-radius: 7px;
  background: var(--site-accent);
  color: #ffffff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--site-accent) 18%, transparent);
}

.public-site-card .form-section-label::after {
  height: 2px;
  background: linear-gradient(90deg, var(--site-accent-line), transparent);
}

.public-site-card > label:not(.privacy-line),
.site-interview > label,
.public-site-card .manual-ateco-column label,
.public-site-card .manual-ateco-meta-row label {
  padding: 10px;
  border: 1px solid #d9e5ed;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(28, 82, 125, .05);
}

.public-site-card > label:not(.privacy-line):focus-within,
.site-interview > label:focus-within,
.public-site-card .manual-ateco-column label:focus-within,
.public-site-card .manual-ateco-meta-row label:focus-within {
  border-color: var(--site-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--site-accent) 16%, transparent), 0 8px 18px rgba(28, 82, 125, .08);
}

.public-site-card input:not([type="checkbox"]):not([type="radio"]),
.public-site-card select,
.public-site-card textarea {
  min-height: 40px;
  border-color: #d5e2eb;
  background: #f9fcfd;
}

.public-site-card > label:not(.privacy-line) input:not([type="checkbox"]):not([type="radio"]),
.public-site-card > label:not(.privacy-line) select,
.public-site-card > label:not(.privacy-line) textarea,
.site-interview > label input:not([type="checkbox"]):not([type="radio"]) {
  margin-top: 2px;
}

.site-setup-toggle {
  border-radius: 9px;
  box-shadow: 0 6px 14px rgba(28, 82, 125, .05);
}

.site-interview {
  padding: 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--site-accent-soft) 0%, #ffffff 76%);
  box-shadow: inset 0 0 0 1px var(--site-accent-line);
}

.site-interview > .form-section-label {
  margin-top: 0;
}

.site-interview > .notice {
  border-left-width: 5px;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(28, 82, 125, .05);
}

.site-step-card {
  grid-column: span 12;
  border: 1px solid #d9e5ed;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(28, 82, 125, .06);
}

.site-step-head {
  grid-column: span 12;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #d9e5ed;
}

.site-step-head strong {
  display: block;
  color: #15344f;
  font-size: 14px;
  line-height: 1.2;
}

.site-step-head small {
  display: block;
  margin-top: 2px;
  color: #60707d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.site-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.site-step-count {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef5fa;
  color: #1c527d !important;
  white-space: nowrap;
}

.site-step-card-profile {
  border-color: #c9ddec;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fc 100%);
}

.site-step-card-profile .site-step-index {
  background: #1c527d;
}

.site-step-card-environments {
  border-color: #dfd2b7;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf1 100%);
}

.site-step-card-environments .site-step-head {
  border-bottom-color: #eadfc9;
}

.site-step-card-environments .site-step-index {
  background: #9b640f;
}

.site-step-card-environments .site-step-head strong {
  color: #5e3d0b;
}

.site-environment-discovery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  padding: 0 12px 12px;
}

.site-environment-discovery > .site-step-head,
.site-environment-discovery > .notice,
.site-discovery-question {
  grid-column: span 12;
}

.site-environment-discovery > .notice {
  margin: 0;
  padding: 10px 12px;
  border-color: #9fc0d8;
  background: var(--site-accent-soft);
}

.site-discovery-question {
  padding: 12px;
  border: 1px solid #e0ebf2;
  border-radius: 8px;
  background: rgba(255,255,255,.82);
}

.site-discovery-question > label {
  display: block;
  margin-bottom: 8px;
  color: var(--site-accent-ink);
  font-size: 13px;
  font-weight: 800;
}

.site-discovery-question .chips {
  gap: 8px;
}

.site-interview-area {
  padding: 0 12px 12px;
}

.site-interview-area-label,
.site-environment-area > label {
  display: block;
  margin: 12px 0 8px;
  color: var(--site-accent-ink);
}

.site-step-card-environments .chips[data-site-interview-options],
.site-environment-source-list {
  padding: 10px;
  border: 1px solid #eadfc9;
  border-radius: 8px;
  background: #ffffff;
}

.site-environment-source-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.site-environment-source {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid #d9e5ed;
  border-radius: 8px;
  background: #fbfdfe;
  cursor: grab;
}

.site-environment-source:active {
  cursor: grabbing;
}

.site-environment-source span,
.site-environment-source small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.site-environment-source span {
  color: #172026;
  font-size: 12.5px;
  font-weight: 850;
}

.site-environment-source small {
  color: #637483;
  font-size: 11px;
}

.site-environment-source button {
  grid-row: span 2;
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11.5px;
}

.site-environment-search {
  padding: 10px;
  border: 1px solid #eadfc9;
  border-radius: 8px;
  background: #fffdf8;
}

.site-environment-search-label {
  color: #5e3d0b;
}

.site-icp-summary {
  border: 1px solid var(--site-accent-line);
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff 0%, var(--site-accent-soft) 100%);
  box-shadow: 0 8px 18px rgba(28, 82, 125, .07);
}

.site-icp-summary .chip {
  border: 1px solid rgba(28, 82, 125, .08);
  box-shadow: none;
}

.site-icp-summary .chip.dark {
  background: var(--site-accent);
  color: #ffffff;
}

.site-environment-catalog {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  align-items: stretch;
  gap: 14px;
}

.site-environment-local-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.site-environment-local-head strong {
  color: var(--site-accent-ink);
  font-size: 14px;
}

.site-environment-local-head small {
  color: #637483;
  font-size: 12px;
  font-weight: 750;
}

.site-environment-dropzone {
  min-height: 140px;
  padding: 12px;
  border: 1px dashed #b6cad8;
  border-radius: 10px;
  background: #f7fafc;
}

.site-environment-dropzone.empty {
  display: grid;
  place-items: center;
  color: #637483;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.site-environment-open-card {
  min-width: 0;
  min-height: 192px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d9e5ed;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(28, 82, 125, .07);
}

.site-environment-open-card.is-active {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px var(--site-accent), 0 10px 22px rgba(28, 82, 125, .10);
}

.site-environment-open-card.has-answers {
  border-color: color-mix(in srgb, var(--site-accent) 48%, #d9e5ed);
  background: linear-gradient(180deg, #ffffff 0%, var(--site-accent-soft) 100%);
}

.site-environment-open-top {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.site-environment-open-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.site-environment-open-card strong {
  color: #172026;
  font-size: 14px;
  line-height: 1.2;
}

.site-environment-open-meta {
  display: grid;
  gap: 3px;
  align-items: start;
}

.site-environment-quantity-note {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-weight: 650 !important;
}

.site-environment-open-card small {
  font-size: 11.5px;
}

.site-local-name-label {
  min-width: 0;
  display: grid;
  gap: 5px;
  margin-top: 2px;
  color: #5c6d78;
  font-size: 11px;
  font-weight: 800;
}

.site-local-name-label input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 7px 10px;
  border: 1px solid #d7e2ea;
  border-radius: 7px;
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.site-environment-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 6px;
  margin-top: auto;
}

.site-environment-card-actions button {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.site-environment-card-actions .danger {
  border-color: #e4b8b8;
  background: #fff8f8;
  color: #8b2f2f;
  box-shadow: none;
}

.site-environment-open-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 7px;
  border: 1px solid #d7e2ea;
  border-radius: 999px;
  background: #f6f9fb;
  color: #637483;
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.site-environment-open-status.is-done {
  border-color: color-mix(in srgb, var(--site-accent) 32%, #d7e2ea);
  background: #e8f4ed;
  color: #1e6b3a;
}

.site-environment-open-button {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  background: var(--site-accent);
  color: #ffffff;
  box-shadow: 0 7px 14px color-mix(in srgb, var(--site-accent) 18%, transparent);
}

.site-environment-open-button:hover:not(:disabled) {
  background: var(--site-accent-ink);
  color: #ffffff;
}

.site-environment-quantity-fields {
  display: grid;
  grid-template-columns: minmax(180px, .65fr) minmax(0, 1.35fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--site-accent-line);
  border-radius: 9px;
  background: var(--site-accent-soft);
}

.site-environment-quantity-fields label {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  color: var(--site-accent-ink);
  font-size: 12px;
  font-weight: 850;
}

.site-environment-quantity-fields input,
.site-environment-quantity-fields textarea {
  width: 100%;
  min-width: 0;
  margin: 0;
  background: #ffffff;
}

.site-environment-shared-questionnaire-note {
  margin: 0;
}

.preliminary-question-row {
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(28, 82, 125, .06);
}

.site-question-row.is-answered {
  border-color: color-mix(in srgb, var(--site-accent) 38%, #d7e2ea);
  background: linear-gradient(90deg, var(--site-accent-soft) 0%, #ffffff 68%);
  box-shadow: inset 3px 0 0 var(--site-accent), 0 8px 18px rgba(28, 82, 125, .06);
}

.site-environment-modal {
  border-radius: 10px;
  background: #eef4f8;
}

.site-environment-modal-head {
  padding: 18px;
  background: #172026;
  border-bottom: 0;
}

.site-environment-modal-head h2 {
  color: #ffffff;
  font-size: 22px;
}

.site-environment-modal-head p {
  color: rgba(255,255,255,.72);
}

.site-environment-modal-head .modal-close {
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: #ffffff;
}

.site-environment-modal-body {
  padding: 18px;
}

.site-environment-modal .site-environment-card {
  padding: 16px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(28, 82, 125, .10);
}

.site-environment-modal-actions {
  padding: 14px 18px;
}

/* Lead detail workbench refresh: clearer tabs, panels, forms, estimate and history areas. */
.panel:has(#lead-work-form) {
  padding: 0;
  overflow: hidden;
  border-color: #c7d8e4;
  background: #f4f8fb;
}

#lead-work-form {
  gap: 0;
  padding: 0;
  background: #f4f8fb;
}

#lead-work-form .lead-work-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  padding: 10px;
  border-bottom: 1px solid #c7d8e4;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(28, 82, 125, .08);
}

#lead-work-form .lead-work-tab-button {
  min-width: 0;
  min-height: 42px;
  padding: 9px 10px;
  border: 0;
  border-right: 1px solid #d8e5ee;
  border-radius: 0;
  background: #ffffff;
  color: #49606f;
  font-size: 12.5px;
  font-weight: 820;
  box-shadow: none;
}

#lead-work-form .lead-work-tab-button:first-child {
  border-radius: 8px 0 0 8px;
}

#lead-work-form .lead-work-tab-button:last-child {
  border-right: 0;
  border-radius: 0 8px 8px 0;
}

#lead-work-form .lead-work-tab-button:hover:not(:disabled) {
  background: #edf5fa;
  color: var(--brand-2);
  box-shadow: none;
}

#lead-work-form .lead-work-tab-button.active,
#lead-work-form .lead-work-tab-button.active:hover:not(:disabled),
#lead-work-form .lead-work-tab-button.active:focus:not(:disabled) {
  background: var(--brand-2);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(28, 82, 125, .18);
}

#lead-work-form .lead-work-tab-panel {
  gap: 16px;
  padding: 18px;
  background: #f4f8fb;
}

#lead-work-form .lead-work-tab-panel > label,
#lead-work-form .lead-work-tab-panel > .span-12:not(.form-section-label):not(.public-sites):not(.actions),
#lead-work-form .lead-estimate-payment {
  min-width: 0;
  padding: 12px;
  border: 1px solid #d6e3ec;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(28, 82, 125, .06);
}

.requested-services-fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #c9dbe7;
  border-radius: 10px;
  background: #f7fbfd;
}

.requested-services-fieldset legend {
  padding: 0 7px;
  color: var(--brand-2);
  font-size: 13px;
  font-weight: 850;
}

.requested-services-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.requested-service-option {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  min-height: 94px;
  padding: 11px;
  border: 1px solid #d7e3eb;
  border-radius: 9px;
  background: #ffffff;
  cursor: pointer;
}

.requested-service-option.is-selected {
  border-color: var(--brand-2);
  background: #eaf4fa;
  box-shadow: inset 0 0 0 1px rgba(28, 82, 125, .16);
}

.requested-service-option > span {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.requested-service-option input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.requested-service-option small,
.requested-services-summary {
  color: #526575;
  line-height: 1.35;
}

.requested-services-summary {
  display: block;
  margin-top: 9px;
}

#lead-work-form .lead-catalog-search,
#lead-work-form .lead-cart {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #c9dbe7;
  border-radius: 10px;
  background: #f7fbfd;
}

#lead-work-form .lead-cart-saved-summary {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #b9d9c2;
  border-radius: 10px;
  background: #f2fbf4;
}

#lead-work-form .lead-cart-saved-summary > small {
  color: #526575;
}

#lead-work-form .lead-cart-saved-summary ul {
  display: grid;
  gap: 5px;
  margin: 2px 0;
  padding: 0;
  list-style: none;
}

#lead-work-form .lead-cart-saved-summary li,
#lead-work-form .lead-cart-saved-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

#lead-work-form .lead-cart-saved-summary > div {
  padding-top: 7px;
  border-top: 1px solid #cfe5d5;
}

#lead-work-form .lead-catalog-search-controls {
  display: grid;
  grid-template-columns: minmax(190px, .42fr) minmax(260px, 1fr);
  gap: 10px;
}

#lead-work-form .lead-catalog-search-results {
  display: grid;
  gap: 8px;
}

#lead-work-form .lead-catalog-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px;
  border: 1px solid #d7e3eb;
  border-radius: 9px;
  background: #ffffff;
}

#lead-work-form .lead-catalog-result small,
#lead-work-form .lead-catalog-result p,
#lead-work-form .lead-cart-head small {
  display: block;
  margin: 3px 0 0;
  color: #526575;
  line-height: 1.35;
}

#lead-work-form .lead-catalog-result-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

#lead-work-form .lead-cart {
  background: #ffffff;
}

#lead-work-form .lead-cart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

#lead-work-form .lead-cart-head > strong {
  color: var(--brand-2);
  font-size: 17px;
}

#lead-work-form .lead-work-tab-panel > label {
  display: grid;
  gap: 7px;
  color: #344957;
  font-size: 12px;
  font-weight: 820;
}

#lead-work-form .lead-work-tab-panel input:not([type="checkbox"]):not([type="radio"]),
#lead-work-form .lead-work-tab-panel select,
#lead-work-form .lead-work-tab-panel textarea {
  min-height: 40px;
  border-color: #c7d8e4;
  border-radius: 7px;
  background: #fbfdfe;
}

#lead-work-form .lead-work-tab-panel input:not([type="checkbox"]):not([type="radio"]):focus,
#lead-work-form .lead-work-tab-panel select:focus,
#lead-work-form .lead-work-tab-panel textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(28, 82, 125, .14);
}

#lead-work-form .lead-work-tab-panel .form-section-label {
  margin: 2px 0 -4px;
}

#lead-work-form .lead-work-tab-panel .form-section-label span {
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 7px;
  background: var(--brand-2);
  color: #ffffff;
}

#lead-work-form .lead-work-tab-panel .form-section-label::after {
  height: 2px;
  background: linear-gradient(90deg, #b9d0df, transparent);
}

#lead-work-form .lead-work-tab-panel .table-wrap {
  border: 1px solid #d6e3ec;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(28, 82, 125, .06);
}

#lead-work-form .lead-work-tab-panel table th {
  background: #eef5f9;
  color: #1c527d;
  font-size: 11.5px;
  letter-spacing: 0;
}

#lead-work-form .lead-work-tab-panel table td {
  background: #ffffff;
}

#lead-work-form .lead-work-tab-panel tbody tr:hover td {
  background: #f7fbfd;
}

#lead-work-form .lead-estimate-payment {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

#lead-work-form .lead-sales-category-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

#lead-work-form .lead-sales-category {
  display: grid;
  gap: 8px;
}

#lead-work-form .lead-sales-category-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
  border-left: 4px solid var(--brand-2);
  border-radius: 8px;
  background: #f7fbfd;
}

#lead-work-form .lead-sales-category-toggle {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid #c7d8e4;
  border-radius: 7px;
  background: #ffffff;
  color: var(--brand-2);
}

#lead-work-form .lead-sales-category-arrow {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .18s ease;
}

#lead-work-form .lead-sales-category.is-collapsed .lead-sales-category-arrow {
  transform: translateX(-1px) rotate(-45deg);
}

#lead-work-form .lead-sales-category.is-collapsed .lead-sales-category-body {
  display: none;
}

#lead-work-form .lead-sales-category-formazione .lead-sales-category-head {
  border-left-color: var(--ok);
}

#lead-work-form .lead-sales-category-documentazione .lead-sales-category-head {
  border-left-color: var(--violet);
}

#lead-work-form .lead-sales-category-head strong {
  display: block;
  color: #172026;
  font-size: 14px;
}

#lead-work-form .lead-sales-category-head small {
  display: block;
  margin-top: 3px;
  color: #526575;
  line-height: 1.35;
}

#lead-work-form .lead-sales-category-head .chips {
  justify-content: flex-end;
  margin: 0;
}

.annual-maintenance-grid {
  margin: 14px 0 18px;
}

#lead-work-form .lead-site-cost-perimeters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

#lead-work-form .lead-site-cost-perimeters > .form-section-label,
#lead-work-form .lead-site-cost-perimeter-intro {
  grid-column: 1 / -1;
}

#lead-work-form .lead-site-cost-perimeter-intro {
  margin: -2px 0 2px;
  padding: 9px 12px;
  border: 1px solid #cfe0eb;
  border-radius: 8px;
  background: #f7fbfe;
  color: #425563;
  line-height: 1.35;
}

#lead-work-form .lead-site-cost-perimeter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d6e3ec;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(28, 82, 125, .05);
}

#lead-work-form .lead-site-cost-perimeter header {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

#lead-work-form .lead-site-cost-perimeter header strong {
  color: var(--brand-2);
}

#lead-work-form .lead-site-cost-perimeter li {
  color: #425563;
  line-height: 1.35;
}

#lead-work-form .lead-site-cost-perimeter-calculation {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#lead-work-form .lead-site-cost-perimeter-calculation li {
  padding: 7px 8px;
  border-radius: 8px;
  background: #eef6fb;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 700;
}

#lead-work-form .lead-site-cost-perimeter b {
  display: block;
  margin-bottom: 5px;
  color: #172026;
  font-size: 12px;
  text-transform: uppercase;
}

#lead-work-form .lead-site-cost-perimeter ul {
  margin: 0;
  padding-left: 18px;
}

#lead-work-form .lead-site-cost-perimeter-calculation {
  padding-left: 0;
}

#lead-work-form .lead-estimate-payment label {
  padding: 0;
  border: 0;
  box-shadow: none;
}

#lead-work-form .lead-estimate-payment > small {
  padding: 9px 10px;
  border-left: 4px solid var(--brand-2);
  border-radius: 7px;
  background: #eef5f9;
  color: #425563;
}

#lead-work-form .lead-estimate-footer {
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d6e3ec;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(28, 82, 125, .06);
}

#lead-work-form .lead-estimate-footer .secondary {
  min-height: 40px;
  border-color: var(--brand-2);
  background: var(--brand-2);
  color: #ffffff;
}

#lead-work-form .lead-work-tab-panel .notice {
  border: 1px solid #d6e3ec;
  border-left: 4px solid var(--brand-2);
  border-radius: 9px;
  background: #f7fbfd;
  box-shadow: 0 6px 14px rgba(28, 82, 125, .04);
}

#lead-work-form .lead-work-tab-panel .notice.warn {
  border-color: #ead1a8;
  border-left-color: var(--warn);
  background: #fffaf1;
}

#lead-work-form .lead-work-tab-panel .notice.ok {
  border-color: #bedfc7;
  border-left-color: var(--ok);
  background: #f4fbf6;
}

#lead-work-form .lead-work-tab-panel .notice.danger {
  border-color: #edc8ca;
  border-left-color: var(--danger);
  background: #fff6f7;
}

#lead-work-form .lead-work-tab-panel .ateco-picker {
  padding: 14px;
  border-color: #d6e3ec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(28, 82, 125, .06);
}

#lead-work-form .lead-work-tab-panel .ateco-picker-head {
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #d6e3ec;
  border-radius: 9px;
  background: #eef5f9;
}

#lead-work-form .lead-work-tab-panel .ateco-picker-head strong {
  color: #143d5c;
  font-size: 14px;
}

#lead-work-form .lead-work-tab-panel .ateco-picker-grid > label,
#lead-work-form .lead-work-tab-panel .ateco-picker-grid > div:not(.actions) {
  border-color: #d6e3ec;
  border-radius: 9px;
  background: #fbfdfe;
}

#lead-work-form .lead-work-tab-panel .ateco-selected-list {
  border-style: solid;
  background: #ffffff;
}

#lead-work-form .lead-work-tab-panel .ateco-selected-row {
  border-color: #d6e3ec;
  border-radius: 8px;
  box-shadow: 0 5px 12px rgba(28, 82, 125, .04);
}

#lead-work-form .lead-work-tab-panel .province-combobox-button {
  min-height: 40px;
  border-color: #c7d8e4;
  border-radius: 7px;
  background: #fbfdfe;
  font-weight: 650;
}

#lead-work-form .lead-work-tab-panel .province-combobox-panel {
  border-radius: 10px;
  box-shadow: 0 18px 34px rgba(28, 82, 125, .18);
}

#lead-work-form .lead-work-tab-panel > .actions {
  padding: 12px;
  border: 1px solid #d6e3ec;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(28, 82, 125, .05);
}

#lead-work-form .lead-work-tab-panel button:not(.secondary):not(.warn):not(.danger):not(.province-combobox-button):not(.province-option),
#lead-work-form .lead-work-tab-panel .button-link {
  border-color: var(--brand-2);
  background: var(--brand-2);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(28, 82, 125, .14);
}

#lead-work-form .lead-work-tab-panel button:not(.secondary):not(.warn):not(.danger):not(.province-combobox-button):not(.province-option):hover:not(:disabled),
#lead-work-form .lead-work-tab-panel .button-link:hover {
  background: #164566;
  color: #ffffff;
}

#lead-work-form .lead-work-tab-panel button.secondary,
#lead-work-form .lead-work-tab-panel .button-link.secondary {
  border-color: #bfd3e1;
  background: #ffffff;
  color: var(--brand-2);
  box-shadow: none;
}

#lead-work-form .lead-work-tab-panel .lead-estimate-footer .secondary {
  border-color: var(--brand-2);
  background: var(--brand-2);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(28, 82, 125, .14);
}

#lead-work-form .lead-work-tab-panel .chip.dark {
  background: #e7eef4;
  color: #143d5c;
}

#lead-work-form .lead-work-tab-panel .list {
  gap: 8px;
}

#lead-work-form .lead-work-tab-panel .list .row {
  padding: 12px;
  border: 1px solid #d6e3ec;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(28, 82, 125, .05);
}

#lead-work-form .lead-work-tab-panel .workflow,
#lead-work-form .lead-work-tab-panel .crm-workflow {
  padding: 12px;
  border: 1px solid #d6e3ec;
  border-radius: 10px;
  background: #ffffff;
}

#lead-work-form .lead-work-tab-panel .step {
  border-radius: 8px;
  box-shadow: none;
}

#lead-work-form .lead-work-actions {
  justify-content: flex-end;
  margin-top: 0;
  padding: 14px 18px;
  border-top: 1px solid #c7d8e4;
  background: rgba(255,255,255,.96);
  box-shadow: 0 -8px 18px rgba(28, 82, 125, .06);
}

#lead-work-form .lead-work-actions button[type="submit"] {
  min-height: 42px;
  padding-inline: 18px;
}

#lead-work-form .lead-work-actions .secondary {
  min-height: 42px;
}

#lead-work-form .lead-work-actions .lead-work-delete-action {
  margin-right: auto;
  min-height: 42px;
}

#lead-work-form .lead-work-save-status {
  margin-right: auto;
  max-width: min(520px, 48vw);
  color: #516474;
  font-size: 13px;
  line-height: 1.35;
}

#lead-work-form .lead-work-save-status[data-status="dirty"] { color: #8a5a00; }
#lead-work-form .lead-work-save-status[data-status="saving"] { color: #1c527d; }
#lead-work-form .lead-work-save-status[data-status="saved"] { color: #207044; }
#lead-work-form .lead-work-save-status[data-status="error"] { color: #a32323; }

.admin-lead-deletion-panel .notice {
  margin-bottom: 12px;
}

.admin-lead-delete-row {
  align-items: flex-start;
}

.admin-lead-delete-row .actions {
  justify-content: flex-end;
}

.quote-registry {
  display: grid;
  gap: 16px;
}

.quote-registry-filters {
  border-color: #d6e3ec;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbfd 100%);
}

.quote-registry-filters .section-title {
  align-items: center;
}

.quote-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.quote-filter-grid > label {
  min-width: 0;
  color: #425563;
  font-size: 12px;
  font-weight: 750;
}

.quote-filter-grid input,
.quote-filter-grid select {
  width: 100%;
  margin-top: 5px;
}

.quote-filter-grid .quote-filter-search {
  grid-column: span 2;
}

.quote-filter-result {
  min-height: 62px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #d6e3ec;
  border-radius: 8px;
  background: #eef5f9;
  color: var(--brand-2);
}

.quote-filter-result strong {
  font-size: 22px;
  line-height: 1;
}

.quote-filter-result span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.quote-registry-dashboard {
  display: grid;
  gap: 16px;
}

.quote-registry-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quote-registry-kpis .metric {
  position: relative;
  min-height: 128px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(28, 82, 125, .08);
}

.quote-registry-kpis .metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--brand-2);
}

.quote-registry-kpis .metric-violet::before { background: var(--violet); }
.quote-registry-kpis .metric-warn::before { background: var(--warn); }
.quote-registry-kpis .metric-danger::before { background: var(--danger); }

.quote-registry-kpis .metric b {
  margin: 10px 0 8px;
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1.05;
}

.quote-registry-kpis .metric small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.quote-registry-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.quote-registry-insights .panel {
  min-height: 210px;
}

.quote-distribution-row {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(80px, 1fr) 30px;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  font-size: 12px;
}

.quote-distribution-row > span {
  overflow: hidden;
  color: #425563;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-distribution-row > div {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f5;
}

.quote-distribution-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-2);
}

.quote-distribution-row i.violet { background: var(--violet); }
.quote-distribution-row i.warn { background: var(--warn); }
.quote-distribution-row i.danger { background: var(--danger); }

.quote-registry-list .section-title {
  align-items: center;
}

.quote-registry-table table {
  width: max-content;
  min-width: 100%;
}

.quote-registry-table th,
.quote-registry-table td {
  min-width: 135px;
  vertical-align: top;
}

.quote-registry-table th:first-child,
.quote-registry-table td:first-child {
  min-width: 210px;
}

.quote-registry-table th:nth-child(4),
.quote-registry-table td:nth-child(4) {
  min-width: 205px;
}

.quote-company {
  display: inline-block;
  margin: 4px 0 2px;
  color: var(--brand-2);
  font-weight: 750;
}

.quote-state-detail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-top: 8px;
}

.quote-timeline {
  display: grid;
  gap: 5px;
  color: #536672;
  font-size: 11px;
}

.quote-timeline span b {
  color: #263944;
}

.quote-timeline .chip {
  justify-self: start;
  margin-top: 3px;
}

.quote-registry-actions {
  min-width: 150px;
  flex-direction: column;
  align-items: stretch;
}

.quote-registry-actions button {
  width: 100%;
}

.quote-registry-toolbar {
  padding: 0;
  overflow: hidden;
  border-color: #d6e3ec;
}

.quote-status-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid #d6e3ec;
  background: #f5f8fa;
}

.quote-status-tab {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 14px;
  border: 0;
  border-right: 1px solid #dbe5eb;
  border-radius: 0;
  background: transparent;
  color: #536672;
  box-shadow: none;
  font-size: 13px;
  font-weight: 750;
}

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

.quote-status-tab:hover:not(:disabled) {
  background: #edf4f8;
  color: var(--brand-2);
}

.quote-status-tab.active {
  position: relative;
  background: #ffffff;
  color: var(--brand-2);
}

.quote-status-tab.active::after {
  content: "";
  position: absolute;
  inset: auto 12px -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--brand-2);
}

.quote-status-tab b {
  min-width: 25px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #e4edf2;
  color: #425563;
  font-size: 11px;
  line-height: 1;
  text-align: center;
}

.quote-status-tab.active b {
  background: #dcecf6;
  color: var(--brand-2);
}

.quote-quick-filters {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto auto auto 76px;
  gap: 10px;
  align-items: end;
  padding: 14px;
  background: #ffffff;
}

.quote-quick-filters > label,
.quote-advanced-filters > label {
  min-width: 0;
  color: #536672;
  font-size: 11px;
  font-weight: 750;
}

.quote-quick-filters select,
.quote-advanced-filters input,
.quote-advanced-filters select {
  width: 100%;
  margin-top: 5px;
}

.quote-search-control {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.quote-search-control input {
  width: 100%;
}

.quote-search-control button,
.quote-toolbar-button,
.quote-filter-clear {
  min-height: 42px;
  white-space: nowrap;
}

.quote-toolbar-button.active {
  border-color: var(--brand-2);
  background: #eaf3f8;
  color: var(--brand-2);
}

.quote-quick-filters .quote-filter-result {
  min-height: 42px;
  padding: 6px 10px;
}

.quote-quick-filters .quote-filter-result strong {
  font-size: 18px;
}

.quote-advanced-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  border-top: 1px solid #dbe5eb;
  background: #f7fafc;
}

.quote-analysis-panel {
  padding: 18px;
  border: 1px solid #d6e3ec;
  border-radius: 8px;
  background: #eef5f9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.quote-analysis-panel > .section-title {
  align-items: center;
}

.quote-analysis-panel .quote-registry-insights .panel {
  box-shadow: none;
}

.quote-card-list {
  display: grid;
  gap: 10px;
}

.quote-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #d8e3ea;
  border-left: 4px solid #9eb5c4;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(28, 82, 125, .06);
}

.quote-card.status-sent { border-left-color: var(--brand-2); }
.quote-card.status-accepted { border-left-color: var(--ok); }
.quote-card.status-expired,
.quote-card.status-rejected { border-left-color: var(--danger); }
.quote-card.status-review { border-left-color: var(--warn); }
.quote-card.needs-attention { box-shadow: 0 8px 20px rgba(201, 68, 72, .10); }

.quote-card-main {
  display: grid;
  grid-template-columns: minmax(250px, 2fr) minmax(135px, .8fr) minmax(140px, .9fr) minmax(160px, 1fr) minmax(220px, 1.15fr);
  grid-template-areas: "identity value timing owner actions";
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.quote-card-identity { grid-area: identity; min-width: 0; }
.quote-card-value { grid-area: value; }
.quote-card-timing { grid-area: timing; }
.quote-card-owner { grid-area: owner; min-width: 0; }
.quote-card-primary-actions { grid-area: actions; }

.quote-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.quote-card-heading > div {
  min-width: 0;
}

.quote-card-heading small {
  display: block;
  overflow: hidden;
  color: #71818c;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-card-heading h3 {
  margin: 4px 0 0;
  overflow: hidden;
  color: #172c39;
  font-size: 17px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  color: #60727e;
  font-size: 11px;
}

.quote-card-tags > span:not(.chip) {
  padding-left: 7px;
  border-left: 1px solid #d7e1e7;
}

.quote-card-value,
.quote-card-owner {
  display: grid;
  gap: 3px;
}

.quote-card-value > span,
.quote-card-owner > span {
  color: #71818c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.quote-card-value strong {
  color: #172c39;
  font-size: 20px;
  line-height: 1.1;
}

.quote-card-value small,
.quote-card-owner small {
  overflow: hidden;
  color: #71818c;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-card-owner strong {
  overflow: hidden;
  color: #334b59;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-card-timing {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border-radius: 8px;
  background: #edf4f8;
  color: var(--brand-2);
}

.quote-card-timing.ok { background: #edf8f0; color: #25623a; }
.quote-card-timing.warn { background: #fff5e2; color: #865300; }
.quote-card-timing.danger { background: #fff0f1; color: #9d2e32; }

.quote-card-timing span {
  font-size: 12px;
  font-weight: 800;
}

.quote-card-timing small {
  font-size: 10px;
  line-height: 1.3;
}

.quote-card-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.quote-card-primary-actions button {
  min-width: 0;
  min-height: 36px;
  padding: 8px 9px;
  font-size: 11px;
  white-space: nowrap;
}

.quote-detail-toggle {
  grid-column: span 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-color: #d7e2e9;
  background: #f5f8fa;
  color: #425563;
}

.quote-detail-toggle:hover:not(:disabled) {
  border-color: var(--brand-2);
  background: #eaf3f8;
  color: var(--brand-2);
}

.quote-detail-toggle span {
  font-size: 16px;
  line-height: 1;
}

.quote-card-details {
  display: grid;
  grid-template-columns: .85fr 1.2fr 1fr;
  gap: 0;
  border-top: 1px solid #dbe5eb;
  background: #f8fafb;
}

.quote-card-details > section {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid #dbe5eb;
}

.quote-card-details > section:last-child {
  border-right: 0;
}

.quote-card-details h4 {
  margin: 0 0 11px;
  color: #294554;
  font-size: 12px;
  text-transform: uppercase;
}

.quote-detail-sites {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.quote-detail-sites > span {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid #d7e2e9;
  border-radius: 7px;
  background: #ffffff;
  color: #425563;
  font-size: 10px;
}

.quote-contract-summary,
.quote-contract-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #dbe5eb;
  font-size: 11px;
}

.quote-contract-row small {
  grid-column: 1 / -1;
  color: #71818c;
}

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

.quote-detail-data > div {
  min-width: 0;
  padding: 8px;
  border-radius: 7px;
  background: #ffffff;
}

.quote-detail-data dt {
  color: #71818c;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.quote-detail-data dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: #334b59;
  font-size: 11px;
  font-weight: 700;
}

.quote-card-secondary-actions {
  margin-top: 12px;
}

.quote-registry-empty {
  display: grid;
  gap: 5px;
  padding: 34px 16px;
}

.quote-registry-empty span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1280px) {
  .quote-registry-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quote-registry-insights { grid-template-columns: 1fr; }
  .quote-quick-filters { grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(140px, 1fr)) repeat(3, auto) 72px; }
  .quote-card-main {
    grid-template-columns: minmax(0, 1.6fr) minmax(130px, .7fr) minmax(140px, .8fr);
    grid-template-areas: "identity value timing" "owner actions actions";
  }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    height: auto;
    padding: 10px 12px;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(8, 25, 38, .18);
  }
  .brand {
    grid-template-columns: 74px minmax(0, 1fr) 34px;
    gap: 8px;
    margin: 0;
    padding: 7px;
  }
  .mark {
    grid-column: auto;
    height: 46px;
  }
  .nav {
    display: flex;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    padding: 2px 2px 4px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .nav button {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    scroll-snap-align: start;
  }
  .nav-icon { width: 20px; height: 20px; }
  .content { padding: 18px; }
  .crm-panel .section-title { position: static; }
  .crm-lead-search-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .crm-kanban {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
    overflow: clip;
    scrollbar-gutter: auto;
  }
  .kanban-column {
    min-width: 0;
    height: auto;
    min-height: 220px;
    overflow: visible;
  }
  .kanban-stage { position: static; }
  .kanban-stage b,
  .stage-copy span { white-space: normal; }
  .kanban-stack {
    max-height: none;
    overflow: visible;
    padding-right: 0;
    scrollbar-gutter: auto;
  }
  #lead-work-form .lead-work-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #lead-work-form .lead-work-tab-button,
  #lead-work-form .lead-work-tab-button:first-child,
  #lead-work-form .lead-work-tab-button:last-child {
    border-radius: 7px;
    border-right: 0;
  }
  .login-screen { align-items: start; padding: 0; }
  .login-hero { min-height: 100vh; border-radius: 0; }
  .login-hero-copy {
    grid-template-columns: 1fr;
    grid-template-areas: "brand" "copy" "form";
    min-height: 100vh;
    padding: 30px 28px;
    gap: 24px;
  }
  .login-copy-main { transform: none; }
  .login-form { align-self: start; }
  .login-form-logo { width: min(230px, 68%); }
  .login-hero h1 { font-size: 34px; line-height: 1.08; }
  .login-form { max-width: 560px; }
  .guide-box { display: block; }
  .guide-steps { justify-content: flex-start; max-width: none; margin-top: 10px; }
  .span-1, .span-2, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-10, .span-11 { grid-column: span 12; }
  .preliminary-question-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preliminary-question-text { grid-column: span 2; }
  .site-environment-search { grid-template-columns: 1fr auto; }
  .site-environment-search-label { grid-column: span 2; }
  .site-environment-source-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-environment-catalog { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
  .site-environment-card-actions { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .site-environment-grid { grid-template-columns: 1fr; }
  .dashboard-kpis .span-3 { grid-column: span 6; }
  .dashboard-bar-row { grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) 34px; }
  .dashboard-view .crm-workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-view .crm-workflow .step::after { display: none; }
  .workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .client-shell .selector { position: static; }
  .client-list-row { grid-template-columns: 1fr; align-items: stretch; }
  .client-list-row-button { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(90px, .8fr)); }
  .client-list-row-button span:nth-of-type(2),
  .client-list-row-button span:nth-of-type(5),
  .client-list-row-button .chips { display: none; }
  .client-list-details,
  .client-data-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-list-actions { justify-content: flex-start; }
  .client-stats,
  .client-columns,
  .client-checklist-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-lead-base { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) and (max-width: 1280px) {
  .crm-kanban { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .quote-status-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .quote-status-tab {
    flex: 0 0 auto;
    min-width: 145px;
  }
  .quote-quick-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quote-search-control { grid-column: span 2; }
  .quote-advanced-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-quick-filters .quote-filter-result { min-height: 42px; }
  .quote-card-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "identity identity" "value timing" "owner owner" "actions actions";
  }
  .quote-card-details { grid-template-columns: 1fr; }
  .quote-card-details > section {
    border-right: 0;
    border-bottom: 1px solid #dbe5eb;
  }
  .quote-card-details > section:last-child { border-bottom: 0; }
}

@media (max-width: 640px) {
  .crm-lead-search-toolbar { grid-template-columns: 1fr; }
  .crm-lead-search-toolbar button { width: 100%; }
  .quote-registry-kpis,
  .quote-filter-grid,
  .quote-registry-insights { grid-template-columns: 1fr; }
  .quote-quick-filters,
  .quote-advanced-filters { grid-template-columns: 1fr; }
  .quote-search-control { grid-column: auto; }
  .quote-card-main {
    grid-template-columns: 1fr;
    grid-template-areas: "identity" "value" "timing" "owner" "actions";
    gap: 12px;
  }
  .quote-card-primary-actions { grid-template-columns: 1fr; }
  .quote-detail-toggle { grid-column: auto; }
  .quote-filter-grid .quote-filter-search { grid-column: auto; }
  .quote-registry-filters .section-title,
  .quote-registry-list .section-title { align-items: flex-start; }
  .quote-distribution-row { grid-template-columns: minmax(90px, 130px) minmax(60px, 1fr) 28px; }
  .content { padding: 14px; }
  .topbar { display: block; }
  .shell { display: block; }
  .sidebar {
    display: block;
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    padding: 8px;
    overflow: visible;
    box-shadow: 0 10px 22px rgba(8, 25, 38, .18);
  }
  .brand {
    grid-template-columns: 78px minmax(0, 1fr) 34px;
    gap: 8px;
    align-items: center;
    padding: 7px;
    margin-bottom: 8px;
    border-radius: 9px;
  }
  .mark {
    grid-column: auto;
    height: 46px;
  }
  .mark img {
    width: 100%;
    height: 100%;
  }
  .brand-user-name { font-size: 12px; }
  .brand-user-role { font-size: 10px; }
  .logout-icon {
    width: 32px;
    min-height: 32px;
  }
  .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 0 2px 3px;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }
  .client-stats,
  .client-columns,
  .client-list-details,
  .client-data-strip { grid-template-columns: 1fr; }
  .client-list-row { padding: 12px; }
  .client-list-actions button { width: 100%; }
  .nav button {
    flex: 0 0 auto;
    width: auto;
    min-height: 34px;
    padding: 7px 10px;
    gap: 6px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    font-size: 12px;
    scroll-snap-align: start;
  }
  .nav-icon {
    width: 18px;
    height: 18px;
  }
  .crm-kanban {
    grid-template-columns: 1fr;
    height: auto;
    overflow: clip;
    padding: 10px 0 0;
  }
  .kanban-column {
    min-width: 0;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .kanban-stage {
    position: static;
    min-height: 52px;
  }
  .kanban-stage b,
  .stage-copy span {
    white-space: normal;
  }
  .kanban-stack {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .content table.responsive-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
  }
  .content .admin-settings-grid .settings-values-panel table.responsive-table {
    width: 100%;
    max-width: 100%;
  }
  .content .admin-settings-grid .settings-values-panel th,
  .content .admin-settings-grid .settings-values-panel td {
    min-width: 0;
  }
  .content table.responsive-table thead {
    display: none;
  }
  .content table.responsive-table tbody,
  .content table.responsive-table tr,
  .content table.responsive-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .content table.responsive-table tr {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #d6e3ec;
    border-radius: 9px;
    background: #ffffff;
    box-shadow: 0 6px 14px rgba(28, 82, 125, .04);
  }
  .content table.responsive-table td {
    display: grid;
    grid-template-columns: minmax(96px, 36%) minmax(0, 1fr);
    gap: 8px;
    padding: 7px 0;
    border: 0;
    background: transparent;
  }
  .content table.responsive-table td::before {
    content: attr(data-label);
    color: #1c527d;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
  }
  .content table.responsive-table td:empty {
    display: none;
  }
  .content table.responsive-table td.actions {
    display: flex;
    align-items: stretch;
    gap: 7px;
    flex-wrap: wrap;
  }
  .content table.responsive-table td.actions::before {
    flex: 0 0 100%;
  }
  .content table.responsive-table td.actions button,
  .content table.responsive-table td.actions .button-link {
    flex: 1 1 118px;
  }
  #lead-work-form .lead-work-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #lead-work-form .lead-work-tab-panel { padding: 12px; }
  #lead-work-form [data-lead-work-panel="classificazione"] .table-wrap,
  #lead-work-form [data-lead-work-panel="stima"] .table-wrap,
  #lead-work-form [data-lead-work-panel="crm"] .table-wrap {
    overflow: visible;
  }
  #lead-work-form [data-lead-work-panel="stima"] table,
  #lead-work-form [data-lead-work-panel="stima"] thead,
  #lead-work-form [data-lead-work-panel="stima"] tbody,
  #lead-work-form [data-lead-work-panel="stima"] tr,
  #lead-work-form [data-lead-work-panel="stima"] td,
  #lead-work-form [data-lead-work-panel="classificazione"] table,
  #lead-work-form [data-lead-work-panel="classificazione"] tbody,
  #lead-work-form [data-lead-work-panel="classificazione"] tr,
  #lead-work-form [data-lead-work-panel="classificazione"] th,
  #lead-work-form [data-lead-work-panel="classificazione"] td,
  #lead-work-form [data-lead-work-panel="crm"] table,
  #lead-work-form [data-lead-work-panel="crm"] tbody,
  #lead-work-form [data-lead-work-panel="crm"] tr,
  #lead-work-form [data-lead-work-panel="crm"] th,
  #lead-work-form [data-lead-work-panel="crm"] td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  #lead-work-form [data-lead-work-panel="stima"] thead {
    display: none;
  }
  #lead-work-form [data-lead-work-panel="stima"] table,
  #lead-work-form [data-lead-work-panel="classificazione"] table,
  #lead-work-form [data-lead-work-panel="crm"] table {
    border: 0;
    background: transparent;
  }
  #lead-work-form [data-lead-work-panel="stima"] tr,
  #lead-work-form [data-lead-work-panel="classificazione"] tr,
  #lead-work-form [data-lead-work-panel="crm"] tr {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #d6e3ec;
    border-radius: 9px;
    background: #ffffff;
  }
  #lead-work-form [data-lead-work-panel="stima"] td,
  #lead-work-form [data-lead-work-panel="classificazione"] th,
  #lead-work-form [data-lead-work-panel="crm"] th {
    padding: 0;
    border: 0;
    background: transparent;
  }
  #lead-work-form [data-lead-work-panel="classificazione"] td,
  #lead-work-form [data-lead-work-panel="crm"] td {
    padding: 4px 0 10px;
    border: 0;
  }
  #lead-work-form [data-lead-work-panel="stima"] td {
    padding: 4px 0 10px;
  }
  #lead-work-form [data-lead-work-panel="stima"] td::before {
    display: block;
    margin-bottom: 3px;
    color: #1c527d;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
  }
  #lead-work-form [data-lead-work-panel="stima"] td:nth-child(1)::before { content: "Voce"; }
  #lead-work-form [data-lead-work-panel="stima"] td:nth-child(2)::before { content: "Rischio / quantità"; }
  #lead-work-form [data-lead-work-panel="stima"] td:nth-child(3)::before { content: "Dettagli"; }
  #lead-work-form [data-lead-work-panel="stima"] td:nth-child(4)::before { content: "Primo anno"; }
  #lead-work-form [data-lead-work-panel="stima"] td:nth-child(5)::before { content: "Anni successivi"; }
  #lead-work-form [data-lead-work-panel="stima"] .lead-sales-category-table td:nth-child(1)::before { content: "Voce listino"; }
  #lead-work-form [data-lead-work-panel="stima"] .lead-sales-category-table td:nth-child(2)::before { content: "Quantità"; }
  #lead-work-form [data-lead-work-panel="stima"] .lead-sales-category-table td:nth-child(3)::before { content: "Prezzo primo anno"; }
  #lead-work-form [data-lead-work-panel="stima"] .lead-sales-category-table td:nth-child(4)::before { content: "Prezzo anni successivi"; }
  #lead-work-form [data-lead-work-panel="stima"] .lead-sales-category-table td:nth-child(5)::before { content: "Totale"; }
  #lead-work-form [data-lead-work-panel="stima"] .lead-sales-category-table-no-following td:nth-child(4)::before { content: "Totale"; }
  #lead-work-form [data-lead-work-panel="stima"] .lead-sales-category-table-no-following td:nth-child(3)::before { content: "Prezzo unitario"; }
  #lead-work-form [data-lead-work-panel="stima"] .lead-sales-category-table-no-following td:nth-child(5)::before { content: "Azione"; }
  #lead-work-form .lead-sales-category-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }
  #lead-work-form .lead-sales-category-head .chips {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  #lead-work-form .lead-work-actions { justify-content: stretch; }
  #lead-work-form .lead-work-save-status { width: 100%; max-width: none; text-align: center; }
  #lead-work-form .lead-work-actions button { width: 100%; }
  #lead-work-form .lead-site-cost-perimeters { grid-template-columns: 1fr; }
  #lead-work-form .lead-site-cost-perimeter { grid-template-columns: 1fr; }
  #lead-work-form .lead-site-cost-perimeter-calculation { grid-template-columns: 1fr; }
  .login-screen { padding: 0; align-items: start; }
  .login-hero { min-height: 100vh; border-radius: 0; }
  .login-hero { gap: 0; }
  .login-hero-copy { padding: 22px 18px; gap: 18px; }
  .login-copy-main { transform: none; }
  .login-form-logo { width: min(205px, 72%); }
  .login-hero h1 { font-size: 29px; line-height: 1.08; }
  .login-hero p { font-size: 14px; color: rgba(255,255,255,.86); }
  .login-points span { flex: 1 1 calc(50% - 8px); justify-content: center; text-align: center; }
  .login-form { max-width: none; margin-top: 0; padding: 16px; }
  .login-form-head { display: block; }
  .toolbar { justify-content: flex-start; margin-top: 12px; }
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }
  .section-title > .actions,
  .client-detail-head .section-title > .actions {
    width: 100%;
    justify-content: stretch;
  }
  .section-title > .actions button,
  .section-title > .actions .button-link,
  .client-detail-head .section-title > .actions button {
    flex: 1 1 130px;
    min-width: 0;
    white-space: normal;
  }
  .panel,
  .card { max-width: 100%; }
  .panel { padding: 14px; }
  .card { padding: 13px; }
  .chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .actions button,
  .actions .button-link { max-width: 100%; white-space: normal; }
  .nav { grid-template-columns: none; }
  .preliminary-question-row { grid-template-columns: 1fr; }
  .preliminary-question-text { grid-column: auto; }
  .site-environment-search { grid-template-columns: 1fr; }
  .site-environment-search-label { grid-column: auto; }
  .site-environment-search button { width: 100%; }
  .site-environment-source-list { grid-template-columns: 1fr; }
  .site-environment-catalog { grid-template-columns: 1fr; }
  .site-environment-source { grid-template-columns: minmax(0, 1fr); }
  .site-environment-card-actions { grid-template-columns: 1fr; }
  .site-environment-quantity-fields { grid-template-columns: 1fr; }
  .site-environment-source button,
  .site-environment-card-actions button { width: 100%; }
  .calendar-control-panel,
  .calendar-task {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .calendar-control-actions {
    justify-content: stretch;
  }
  .calendar-control-panel {
    display: grid;
  }
  .calendar-top-actions button,
  .calendar-filter-switch button,
  .calendar-view-switch button,
  .calendar-task-actions button {
    flex: 1 1 100%;
    width: 100%;
  }
  .lead-contact-form .lead-contact-conditional > * {
    grid-column: span 12;
  }
  .dashboard-kpis .span-3 { grid-column: span 12; }
  .dashboard-kpis .metric { min-height: 112px; }
  .dashboard-metric-foot { align-items: flex-start; flex-direction: column; }
  .dashboard-money-grid,
  .dashboard-mini-stats { grid-template-columns: 1fr; }
  .authorization-preview,
  .lead-auth-summary { grid-template-columns: 1fr; }
  .dashboard-quote-bars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-ring { width: 138px; height: 138px; }
  .dashboard-ring-inner { width: 84px; height: 84px; }
  .dashboard-bar-row { grid-template-columns: 1fr 42px; gap: 6px; }
  .dashboard-bar-row span { grid-column: span 2; }
  .dashboard-view .crm-workflow { grid-template-columns: 1fr; }
  .client-list-row,
  .client-list-row-button,
  .client-list-details,
  .client-data-strip,
  .client-data-strip-wide,
  .client-stats,
  .client-columns,
  .client-site-grid,
  .client-checklist-summary,
  .client-lead-base {
    grid-template-columns: 1fr;
  }
  .client-list-row-button span { display: block; }
  .client-list-row-button .chips { display: flex; }
  .client-list-row-button .chips { justify-content: flex-start; }
  .client-card-head,
  .client-card-foot {
    align-items: flex-start;
    flex-direction: column;
  }
  .workflow { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 10px; }
  .modal-head { display: block; }
  .modal-close { margin-top: 10px; width: 100%; }
  .modal-row { grid-template-columns: 1fr; }
  .form-grid > * { grid-column: span 12 !important; }
  .public-rules-panel .row,
  .public-list-panel .row { grid-template-columns: 1fr; }
  .public-list-panel .row .actions { justify-content: flex-start; }
  .ateco-selected-row { grid-template-columns: 1fr; }
  .ateco-selected-row .actions { justify-content: flex-start; }
  .requested-services-grid { grid-template-columns: 1fr; }
  .requested-service-option { min-height: 0; }
  #lead-work-form .lead-catalog-search-controls,
  #lead-work-form .lead-catalog-result { grid-template-columns: 1fr; }
  #lead-work-form .lead-catalog-result-action { justify-content: space-between; }
  #lead-work-form .lead-cart-head { align-items: stretch; flex-direction: column; }
}

.perimeter-settings-grid,
.technical-perimeter-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.perimeter-settings-card {
  border: 1px solid #d8e1e8;
  border-radius: 12px;
  background: #fbfcfd;
  overflow: hidden;
}

.perimeter-settings-card > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 15px 18px;
}

.perimeter-settings-card > summary span {
  color: #60707d;
  font-size: 12px;
  font-weight: 700;
}

.perimeter-settings-card[open] > summary {
  background: #eaf2f8;
  border-bottom: 1px solid #d8e1e8;
  color: #1c527d;
}

.perimeter-settings-content {
  padding: 18px;
}

.perimeter-row-editor {
  display: grid;
  gap: 9px;
}

.perimeter-row-card {
  align-items: end;
  background: #fff;
  border: 1px solid #d8e1e8;
  border-radius: 9px;
  display: grid;
  gap: 9px;
  grid-template-columns: 76px 76px minmax(180px, .8fr) minmax(260px, 1.5fr) auto;
  padding: 10px;
}

.perimeter-row-card label {
  margin: 0;
}

.perimeter-row-card .perimeter-row-active {
  align-self: center;
  white-space: nowrap;
}

.perimeter-row-card textarea {
  min-height: 58px;
}

.danger-text {
  color: #a82e34;
}

.quote-perimeter-block {
  border-left: 4px solid #1c527d;
  margin: 12px 0;
  padding: 2px 0 2px 14px;
}

.quote-perimeter-technical,
.quote-perimeter-conditions {
  border-left-color: #c94448;
}

.quote-perimeter-block h4 {
  color: #1c527d;
  margin: 5px 0 8px;
}

@media (max-width: 1100px) {
  .perimeter-row-card {
    grid-template-columns: 86px 86px 1fr;
  }
  .perimeter-row-description {
    grid-column: 1 / -1;
  }
}

@media (max-width: 800px) {
  .perimeter-row-card {
    grid-template-columns: 1fr;
  }
  .perimeter-row-description {
    grid-column: auto;
  }
  .support-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .support-stats {
    grid-template-columns: 1fr;
  }

  .support-group-head {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .support-group-head > button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .support-area-nav,
  .support-infographic-grid {
    grid-template-columns: 1fr;
  }

  .support-infographics-section,
  .support-faq-section,
  .support-faq-group {
    padding: 12px;
  }

  .support-area-admin-list > div {
    align-items: stretch;
    flex-direction: column;
  }
}

.audit-v31-site-fields {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #c8d3df;
  border-radius: 12px;
  background: #f9fbfd;
}

.audit-v31-site-fields[hidden],
.audit-v31-site-fields [hidden] {
  display: none !important;
}

.audit-v31-confirmation {
  align-self: center;
  min-height: 72px;
}

.audit-v31-preview {
  font-family: "Times New Roman", Times, serif;
}

.audit-v31-preview .quote-document-cover {
  text-align: center;
}

.audit-v31-preview-section h3 {
  color: #1f3864;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.05rem;
  letter-spacing: .01em;
}

.audit-v31-preview-field {
  margin: 8px 0 14px;
}

.audit-v31-preview-field > div {
  min-height: 42px;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid #bfbfbf;
  white-space: pre-wrap;
}

.audit-v31-preview-version {
  margin-top: 28px;
  color: #646464;
  font-size: .8rem;
  font-style: italic;
  text-align: center;
}

.training-v11-section-label {
  margin-top: 14px;
}

.training-v11-referent-details[hidden],
.training-v11-derogation[hidden] {
  display: none !important;
}

#lead-work-form .training-v11-course-row > td {
  min-width: 150px;
  vertical-align: top;
}

#lead-work-form .training-v11-course-row > td:nth-child(2) {
  min-width: 245px;
}

#lead-work-form .training-v11-course-row label,
#lead-work-form .training-v11-derogation {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  color: #344957;
  font-size: 11px;
  font-weight: 780;
}

#lead-work-form .training-v11-course-row input,
#lead-work-form .training-v11-course-row select,
#lead-work-form .training-v11-course-row textarea {
  width: 100%;
  min-width: 0;
}

#lead-work-form .training-v11-derogation {
  margin-top: 10px;
  padding: 9px;
  border: 1px solid #e4b35e;
  border-radius: 8px;
  background: #fff8e8;
}

.training-v11-preview {
  font-family: "Times New Roman", Times, serif;
}

.training-v11-preview-course {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #bfbfbf;
  break-inside: avoid;
}

.training-v11-preview-course h4 {
  margin: 0 0 10px;
  color: #1f3864;
}

/* Keep CRM stages reachable and cards readable on tablets and narrow desktops. */
.crm-board-hint { display: none; }

.panel.quote-registry-toolbar { padding: 0; }

button.dashboard-panel-button { white-space: normal; }
.dashboard-panel-button .section-title > span:first-child,
.dashboard-panel-button .dashboard-panel-content,
.dashboard-panel-button .dashboard-record-preview,
.dashboard-panel-button .dashboard-record-preview > * { min-width: 0; }
.dashboard-panel-button .dashboard-panel-title,
.dashboard-panel-button .dashboard-record-preview > *,
.dashboard-panel-button .log { overflow-wrap: anywhere; }
.dashboard-panel-button .log { display: block; white-space: normal; }

@media (min-width: 901px) and (max-width: 1600px) {
  .quote-quick-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quote-search-control { grid-column: span 2; }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .quote-quick-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar .brand-user-name { white-space: normal; text-overflow: clip; }
}

@media (max-width: 1850px) {
  .crm-board-hint {
    display: block;
    margin: 12px 0 0;
    color: #536672;
    font-size: 12px;
    font-weight: 650;
  }

  .crm-kanban {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: clamp(300px, calc((100% - 24px) / 3), 360px);
    height: clamp(520px, calc(100dvh - 390px), 800px);
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }

  .crm-kanban:has(> .kanban-column:only-child) {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-columns: auto;
  }

  .crm-kanban .kanban-column {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    scroll-snap-align: start;
  }

  .crm-kanban .kanban-stage { position: sticky; }
  .crm-kanban .stage-copy span { white-space: normal; text-overflow: clip; }

  .crm-kanban .kanban-stack {
    max-height: none;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-gutter: stable;
  }
}

@media (min-width: 641px) and (max-width: 1100px) {
  .crm-kanban {
    grid-auto-columns: clamp(300px, calc((100% - 12px) / 2), 360px);
  }
}

@media (max-width: 640px) {
  .crm-kanban {
    grid-auto-columns: min(300px, calc(100vw - 62px));
    height: clamp(480px, calc(100dvh - 390px), 640px);
  }
}

/* Content density and navigation reviewed across desktop, tablet and phone. */
.support-area-nav {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.support-area-mobile { display: none; }

.support-faq-group > .support-group-head {
  cursor: pointer;
  list-style: none;
  margin-bottom: 0;
}

.support-faq-group > .support-group-head::-webkit-details-marker { display: none; }
.support-faq-group[open] > .support-group-head { margin-bottom: 11px; }
.support-faq-group > .support-group-head:hover h2 { text-decoration: underline; }
.support-faq-group > .support-group-head:focus-visible { outline: 3px solid #d99032; outline-offset: 3px; }

.support-group-count {
  color: #1c527d;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
}

.support-group-count::after { content: " +"; font-size: 18px; font-weight: 500; }
.support-faq-group[open] .support-group-count::after { content: " −"; }

.quote-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 12px 0;
  padding: 10px 0;
  border-top: 1px solid #dce7ee;
  color: #425563;
  font-size: 13px;
}

.quote-pagination > div { display: flex; align-items: center; gap: 10px; }
.quote-pagination button { min-height: 40px; }
.quote-registry-list { scroll-margin-top: 16px; }

@media (max-width: 640px) {
  .support-area-nav { display: none; }
  .support-area-mobile { display: grid; gap: 6px; font-weight: 750; }
  .support-area-mobile select { width: 100%; min-height: 44px; }
  .support-faq-group > .support-group-head { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .support-group-count { grid-column: 3; }
  .quote-registry-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-pagination > div { width: 100%; justify-content: space-between; gap: 6px; }
  .quote-pagination button { padding: 9px; }
}

@media (max-width: 360px) {
  .quote-registry-kpis { grid-template-columns: 1fr; }
}

.support-infographic-card[hidden] { display: none !important; }
.support-guides-toggle { display: block; min-height: 44px; margin: 16px auto 0; }
.support-guides-toggle[hidden] { display: none !important; }
.support-infographics-section { scroll-margin-top: 16px; }

.privacy-overview .privacy-controls .list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.privacy-overview .privacy-controls .row {
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid #dce6e6;
  border-radius: 8px;
}

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

@media (max-width: 640px) {
  .privacy-overview .privacy-controls .list { grid-template-columns: 1fr; }
  .privacy-overview .privacy-controls .row { min-height: 0; }
}
.docrepo-filters{display:flex;flex-wrap:wrap;gap:.75rem;align-items:end;margin:1rem 0}.docrepo-filters label{display:grid;gap:.3rem;min-width:10rem}.docrepo-counts{display:flex;flex-wrap:wrap;gap:.45rem;margin:.75rem 0}.docrepo-dialog{width:min(980px,calc(100vw - 2rem));max-height:calc(100vh - 2rem);border:0;border-radius:18px;padding:1.25rem;overflow:auto;box-shadow:0 24px 80px rgba(10,24,48,.28)}.docrepo-dialog::backdrop{background:rgba(8,18,34,.55)}.docrepo-validation{margin:.4rem 0 0;padding-left:1.2rem;font-size:.85rem}.docrepo-validation .ok{color:#216e45}.docrepo-validation .ko{color:#a32727}.dashboard-record-preview[data-docrepo-open]{width:100%;text-align:left;border:0;background:transparent;cursor:pointer}.dashboard-record-preview[data-docrepo-open]:hover,.dashboard-record-preview[data-docrepo-open]:focus-visible{background:rgba(59,96,166,.08)}
