/*
 * NAVONAX CRM — client-reference typography and Proposal Sent fit layer.
 * Reference: CRM 2.0 Active Leads at a 1363px viewport.
 *
 * Site Visit Control is intentionally excluded and remains unchanged.
 * Projects receives the Inter family only; its protected register sizing and
 * layout are intentionally not overridden.
 */

@font-face {
  font-family: "Inter NVX";
  src: url("/assets/fonts/inter-latin-variable-v20.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --nvx-client-font: "Inter NVX", Inter, ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* The native CRM lives under #root; standalone Site Visit Control does not. */
#root,
#root * {
  font-family: var(--nvx-client-font) !important;
}

html,
body,
#root,
.crm-app {
  font-family: var(--nvx-client-font) !important;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Keep the standalone Site Visit Control exactly as it is today. */
.nvx-leadops-layer {
  font-size: 15px;
  line-height: 1.5;
}

.crm-app {
  font-size: 16px !important;
  line-height: normal !important;
  font-synthesis: none;
}

#root button,
#root input,
#root select,
#root textarea,
#root optgroup,
#root h1,
#root h2,
#root h3,
#root h4,
#root h5,
#root h6,
#root .page-heading b,
#root .module-heading h2,
#root .register-heading h2,
#root table th,
#root table td {
  font-family: var(--nvx-client-font) !important;
}

#root button,
#root input,
#root select,
#root textarea {
  font-synthesis: none;
}

/* CRM 2.0 shell scale. */
#root .sidebar-nav button {
  font-size: 0.85rem !important;
  font-weight: 580 !important;
  line-height: normal !important;
  letter-spacing: normal !important;
}

#root .nav-group {
  font-size: 0.71rem !important;
  font-weight: 800 !important;
  line-height: normal !important;
  letter-spacing: 0.13em !important;
}

#root .page-heading span {
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  letter-spacing: 0.13em !important;
}

#root .page-heading b {
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: -0.02em !important;
}

#root .topbar-profile b {
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: normal !important;
}

#root .topbar-profile small {
  font-size: 0.68rem !important;
  line-height: 1.35 !important;
  letter-spacing: normal !important;
}

/* CRM 2.0 workspace heading: 31.349px at the audited 1363px viewport. */
#root .crm-app .module-hero .eyebrow,
#root .crm-app .welcome-band .eyebrow {
  margin-bottom: 4px !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  line-height: normal !important;
  letter-spacing: 0.13em !important;
}

#root .crm-app .module-hero h1,
#root .crm-app .welcome-band h1 {
  margin: 0 !important;
  font-size: clamp(1.65rem, 2.3vw, 2.35rem) !important;
  font-weight: 700 !important;
  line-height: 1.08 !important;
  letter-spacing: -0.035em !important;
  text-wrap: balance;
}

#root .crm-app .module-hero .eyebrow + h1 + p,
#root .crm-app .welcome-band > div:first-child > p:last-of-type {
  margin-top: 5px !important;
  font-size: 0.86rem !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  letter-spacing: normal !important;
}

#root .primary-button,
#root .secondary-button,
#root .module-actions button,
#root .register-search button {
  font-size: 0.79rem !important;
  font-weight: 700 !important;
  letter-spacing: normal !important;
}

#root .register-search input {
  font-size: 0.94rem !important;
  font-weight: 400 !important;
  line-height: normal !important;
  letter-spacing: normal !important;
}

/* Reference table scale. Projects keeps its approved original measurements. */
#root .module-register-workspace:not([data-module="projects"])
  .register-table th {
  font-size: 0.69rem !important;
  font-weight: 800 !important;
  line-height: 1.45 !important;
  letter-spacing: 0.075em !important;
}

#root .module-register-workspace:not([data-module="projects"])
  .register-table td {
  font-size: 0.8rem !important;
  line-height: 1.45 !important;
  letter-spacing: normal !important;
}

/* The screenshot uses 12.64px action labels at this viewport. */
#root .module-register-workspace:not([data-module="projects"])
  .row-actions > .row-action {
  min-height: 38px !important;
  padding: 0 10px !important;
  font-size: 0.79rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: normal !important;
  white-space: nowrap !important;
}

/* Proposal Sent gets the same compact desktop shell as the other registers. */
@media (min-width: 861px) {
  #root .crm-app:has(
      .module-register-workspace[data-module="proposal-sent"]
    ) .topbar {
    height: 60px !important;
    min-height: 60px !important;
    padding-inline: 24px !important;
  }

  #root .crm-app:has(
      .module-register-workspace[data-module="proposal-sent"]
    ) .workspace-scroll {
    height: calc(100dvh - 60px) !important;
    padding-top: 18px !important;
  }
}

#root section.module-workspace.module-register-workspace[data-module="proposal-sent"] {
  gap: 12px !important;
}

#root section.module-workspace.module-register-workspace[data-module="proposal-sent"]
  .module-hero {
  gap: 24px !important;
  padding: 0 2px !important;
  align-items: flex-start !important;
}

#root section.module-workspace.module-register-workspace[data-module="proposal-sent"]
  .register-toolbar {
  min-height: 0 !important;
  gap: 8px !important;
  padding: 9px 11px !important;
}

#root section.module-workspace.module-register-workspace[data-module="proposal-sent"]
  #nvx-scale-pages {
  gap: 5px !important;
  margin-right: 0 !important;
  font-size: 0.68rem !important;
  line-height: 1.35 !important;
}

#root section.module-workspace.module-register-workspace[data-module="proposal-sent"]
  #nvx-scale-pages button {
  height: 36px !important;
  padding-inline: 8px !important;
  border-radius: 9px !important;
  font-size: 0.68rem !important;
}

#root section.module-workspace.module-register-workspace[data-module="proposal-sent"]
  #nvx-scale-pages input {
  width: 48px !important;
  height: 36px !important;
  font-size: 0.72rem !important;
}

#root section.module-workspace.module-register-workspace[data-module="proposal-sent"]
  .record-count {
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
}

/*
 * Proposal rows use eight information columns. Actions remain on their own
 * compact line, so every action stays readable without making the window wide.
 */
@media (min-width: 761px) {
  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .register-table-wrap {
    overflow-x: hidden !important;
    overscroll-behavior-x: contain;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .register-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: auto !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .register-table thead tr,
  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .register-table tbody tr {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    grid-template-columns:
      36px
      minmax(72px, 0.8fr)
      minmax(120px, 1.5fr)
      minmax(70px, 0.75fr)
      minmax(94px, 1.05fr)
      minmax(105px, 1.15fr)
      minmax(88px, 0.9fr)
      minmax(112px, 1.2fr) !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .register-table thead th {
    padding: 10px 7px !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .register-table tbody tr {
    height: auto !important;
    min-height: 0 !important;
    grid-template-rows:
      minmax(68px, auto)
      minmax(50px, auto)
      1px !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .register-table tbody td:not([data-label="Action"]) {
    min-height: 68px !important;
    padding: 9px 7px !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .proposal-stacked-cell {
    gap: 3px !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .proposal-stacked-cell > strong {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .proposal-stacked-cell > small {
    font-size: 0.66rem !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .proposal-timeline-cell {
    gap: 3px !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .proposal-timeline-cell > span {
    gap: 0 !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .proposal-timeline-cell small {
    font-size: 0.58rem !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .proposal-timeline-cell strong {
    font-size: 0.68rem !important;
    line-height: 1.35 !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .proposal-file-link {
    gap: 5px !important;
    padding: 5px 6px !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .proposal-file-icon {
    height: 26px !important;
    flex-basis: 26px !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .proposal-file-copy strong {
    font-size: 0.66rem !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .proposal-amount {
    font-size: 0.72rem !important;
    white-space: nowrap !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .register-table tbody td[data-label="Action"] {
    grid-row: 2 !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 50px !important;
    padding: 6px 8px 6px 82px !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .register-table tbody td[data-label="Action"]::before {
    left: 13px !important;
    font-size: 0.62rem !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .register-table tbody td[data-label="Action"] .row-actions {
    width: 100% !important;
    min-width: 0 !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }
}

/* Narrow desktop: keep any necessary horizontal movement inside the table. */
@media (min-width: 761px) and (max-width: 1100px) {
  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .register-table-wrap {
    overflow-x: auto !important;
  }

  body.nvx-proposal-sent-active #root
    section.module-workspace.module-register-workspace[data-module="proposal-sent"]
    .register-table {
    min-width: 900px !important;
  }
}

@media (max-width: 760px) {
  #root .crm-app {
    font-size: 16px !important;
  }

  #root .crm-app .module-hero h1,
  #root .crm-app .welcome-band h1 {
    font-size: 1.55rem !important;
  }

  #root .module-register-workspace:not([data-module="projects"])
    .row-actions > .row-action {
    flex: 1 1 calc(50% - 6px) !important;
    white-space: normal !important;
  }
}

/* Future Leads desktop register parity ----------------------------------
 * Keep every information column in one continuous table and place Actions
 * on the same full-width second row used by Active Leads. This deliberately
 * leaves the standalone Site Visit Control unchanged.
 */
@media (min-width: 1101px) {
  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table-wrap {
    overflow-x: hidden !important;
  }

  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table,
  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table thead,
  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table tbody {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table {
    table-layout: auto !important;
  }

  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table thead tr,
  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table tbody tr {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    grid-template-columns:
      44px
      minmax(84px, 0.75fr)
      minmax(140px, 1.35fr)
      minmax(105px, 0.95fr)
      minmax(100px, 0.9fr)
      minmax(115px, 1.08fr)
      minmax(105px, 0.95fr)
      minmax(125px, 1.17fr) !important;
  }

  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table thead tr {
    min-height: 58px !important;
    grid-template-rows: 58px !important;
  }

  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table tbody tr {
    min-height: 0 !important;
    grid-template-rows: minmax(64px, auto) auto !important;
    border-bottom: 1px solid #e1ebf2;
  }

  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table th,
  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table td {
    position: static !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    box-shadow: none !important;
  }

  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table th {
    display: flex !important;
    align-items: center;
  }

  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table th:last-child {
    display: none !important;
  }

  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table tbody td:not([data-label="Action"]) {
    display: flex !important;
    align-items: center;
    height: auto !important;
    min-height: 64px !important;
    overflow: hidden !important;
  }

  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table tbody td > * {
    min-width: 0;
  }

  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table td[data-label="Action"] {
    grid-column: 1 / -1 !important;
    display: flex !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    align-items: center;
    gap: 10px;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 48px !important;
    height: auto !important;
    padding: 8px 10px 9px !important;
    overflow: hidden !important;
    border-top: 1px solid #e6eef4;
    background: #fbfdff !important;
    box-shadow: none !important;
  }

  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .register-table td[data-label="Action"]::before {
    content: "Actions" !important;
    flex: 0 0 58px;
    color: #5f7588;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  body #root
    section.module-workspace.module-register-workspace[data-module="future-leads"]
    .row-actions {
    display: flex !important;
    flex: 1 1 auto;
    flex-flow: row nowrap !important;
    justify-content: flex-start;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: auto hidden !important;
    overscroll-behavior-x: contain;
  }
}
