:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #30352d;
  background: #f5f6f2;
  font-size: 14px;
  font-synthesis: none;
  --form-row-gap: 16px;
  --blue: #557826;
  --kpi-blue: #628de6;
  --kpi-planned: #b6cdf5;
  --kpi-estimated: #f4d978;
  --muted: #6b7264;
  --border: #e2e6dd;
  --forecast-invoiced: #d8f2e2;
  --forecast-pending: #f0f2f5;
  --forecast-estimated: #fff1b8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button {
  cursor: pointer;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  padding: 10px 15px;
  color: inherit;
  font-weight: 600;
}
button:hover {
  background: #edf2fc;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.primary:hover {
  background: #204dc1;
}
.quiet {
  background: transparent;
  border-color: transparent;
}
.danger {
  color: #b43434;
}
.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #14233a;
  color: #c4d0e1;
  padding: 30px 16px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  padding: 1px 14px 34px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: white;
}
.brand small {
  display: block;
  font-size: 12px;
  letter-spacing: .1px;
  margin-top: 5px;
  color: #a6b5cb;
  font-weight: 400;
}
.sidebar nav {
  display: grid;
  gap: 4px;
}
.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.sidebar .nav-link:hover {
  background: #223855;
  color: white;
}
.sidebar .nav-link.current {
  background: #315482;
  color: white;
  font-weight: 650;
}
.sidebar .nav-link:focus-visible,
.sidebar .logout:focus-visible {
  outline: 2px solid #a9c9ff;
  outline-offset: 2px;
}
.nav-icon {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
}
.nav-separator {
  display: block;
  height: 1px;
  margin: 12px 12px 8px;
  background: #354861;
}
.sidebar footer {
  margin-top: auto;
  border-top: 1px solid #354861;
  padding: 16px 12px 0;
}
.user-name {
  display: block;
  color: white;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.sidebar .logout {
  padding: 6px 0 0;
  color: #a6b5cb;
  font-size: 12px;
  font-weight: 500;
}
.sidebar .logout:hover {
  background: transparent;
  color: white;
}
.workspace {
  min-width: 0;
}

.env {
  border-radius: 20px;
  background: #eef4ff;
  color: #315ba2;
  padding: 7px 12px;
}
.main {
  padding: 32px 36px 50px;
  max-width: 1680px;
  margin: auto;
}
h1 {
  font-size: 29px;
  letter-spacing: -0.7px;
  margin: 0 0 10px;
}
h2 {
  font-size: 19px;
  margin: 0 0 10px;
}
h3 {
  font-size: 15px;
  margin: 0 0 12px;
}
p {
  line-height: 1.55;
}
a {
  color: var(--blue);
}
.muted {
  color: var(--muted);
}
.heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
}
.heading p {
  margin: 0;
  color: var(--muted);
  max-width: 750px;
}
.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow: auto;
}
.tabs button {
  white-space: nowrap;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  border-radius: 0;
  color: var(--muted);
  padding: 13px 16px;
}
.tabs button.current {
  color: var(--blue);
  border-color: var(--blue);
}
.agenda-overdue { color: #b42318; }
.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.list-pagination > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.list-pagination button {
  padding: 6px 10px;
  font-size: 12px;
}
.panel-head {
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  gap: 14px;
}
.panel-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  background: #f9fafc;
  white-space: nowrap;
}
th,
td {
  padding: 12px 18px;
  border-bottom: 1px solid #eef1f6;
  vertical-align: middle;
}
tbody tr:hover {
  background: #f9fbff;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.quote-probability {
  display: inline-grid;
  width: 64px;
  gap: 4px;
  text-align: right;
  white-space: nowrap;
}
.quote-probability-track {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: 64px;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e7edf0;
}
.quote-probability-track::-webkit-progress-bar {
  background: #e7edf0;
  border-radius: 999px;
}
.quote-probability-track::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #46c989, #168451);
}
.quote-probability-track::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #46c989, #168451);
}
.name {
  font-weight: 650;
}
.sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  max-width: 270px;
  line-height: 1.5;
}
.badge {
  display: inline-block;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: #eef2f7;
  color: #526176;
}
.badge.green {
  background: #e7f5ef;
  color: #237151;
}
.badge.blue {
  background: #eaf0ff;
  color: #315ec0;
}
.badge.amber {
  background: #fff3d8;
  color: #8a6215;
}
.badge.red {
  background: #fceded;
  color: #a64545;
}
.commission-table .badge.red {
  background: #ffe1e1;
  color: #a91f27;
  box-shadow: inset 0 0 0 1px #f4aaaa;
  font-weight: 700;
}
.tag {
  display: inline-block;
  font-size: 11px;
  border: 1px solid #e0e7f1;
  border-radius: 5px;
  padding: 3px 6px;
  margin: 2px;
  color: #576982;
}
.pillrow {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.quote-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(132px, .45fr);
}
.quote-kpis .stat {
  min-width: 0;
}
.stat {
  padding: 16px 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  flex: 1;
  min-width: 160px;
}
.stat small {
  color: var(--muted);
}
.stat strong {
  display: block;
  font-size: 23px;
  margin-top: 7px;
}
.forecast-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.35fr);
}
.forecast-kpis .stat {
  min-width: 0;
}
.forecast-kpis .target-percentage {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  vertical-align: baseline;
  margin-left: 4px;
}
.forecast-kpis .stat-detail {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.forecast-kpis .stat-detail b {
  color: #334155;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.filters {
  padding: 18px 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 18px;
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.filters label {
  flex: 1;
  min-width: 130px;
}
.filters .search {
  flex: 2;
  min-width: 200px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #526176;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd8e5;
  border-radius: 7px;
  background: white;
  color: #24334a;
  padding: 10px 11px;
  margin-top: 7px;
  min-height: 40px;
}
textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}
input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: var(--blue);
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  cursor: pointer;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--form-row-gap);
}
.quote-company-field input[type="hidden"] {
  display: none;
}
.fixed-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #526176;
}
.fixed-field-value {
  min-height: 40px;
  margin-top: 7px;
  padding: 9px 11px;
  border: 1px solid #dce5cf;
  border-radius: 7px;
  background: #eef3e6;
  color: #334b23;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.fixed-field-value strong { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
input[readonly] {
  background: #eef3e6;
  border-color: #dce5cf;
  color: #334b23;
  cursor: default;
}
.quote-client-hint {
  display: block;
  margin-top: 5px;
  font-weight: 400;
}
.wide {
  grid-column: 1/-1;
}
.help {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 8px 0 0;
}
.notice {
  padding: 14px 16px;
  background: #f0f5ff;
  border: 1px solid #dce7fd;
  border-radius: 8px;
  color: #465e89;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.notice.warn {
  background: #fff8e9;
  border-color: #f3e4bd;
  color: #856523;
}
.partner-payment-note {
  background: #eef9f4;
  border-color: #aedbc3;
  border-left: 4px solid #29845c;
  color: #234d3b;
}
.partner-payment-note > strong {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}
.partner-payment-note .help {
  color: #4d705f;
}
.empty {
  padding: 48px;
  text-align: center;
  color: var(--muted);
}
.content-pad {
  padding: 24px;
  max-width: 860px;
}
.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}
.section {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.section:first-child {
  padding-top: 0;
}
.section:last-child {
  border-bottom: 0;
}
.section-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: -4px;
  margin-bottom: 18px;
}
.dialog-foot button.primary:disabled,
.record-notes button.primary:disabled {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #64748b;
  opacity: 1;
  cursor: default;
}
#quote-form .section,
#forecast-form .section,
#demo-form .section,
#edit-form .company-billing-phase {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
#quote-form .quote-acceptance-phase,
#forecast-form .forecast-invoice-phase,
#edit-form .company-billing-phase {
  background: #f0f9f4;
  border-color: #b7d9c5;
  border-left: 4px solid #258054;
}
#quote-form .quote-acceptance-phase h3,
#forecast-form .forecast-invoice-phase h3,
#edit-form .company-billing-phase h3 {
  color: #216343;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  width: min(850px, calc(100% - 30px));
  max-height: 93vh;
  box-shadow: 0 28px 100px #14213a44;
  color: inherit;
}
dialog::backdrop {
  background: #15223a77;
  backdrop-filter: blur(2px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: white;
  z-index: 2;
}
.dialog-head h2 {
  margin: 0;
}
.dialog-body {
  padding: 24px 28px;
}
.dialog-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: #fff;
  z-index: 2;
}
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.error {
  color: #a92525;
  background: #fff0f0;
  padding: 12px;
  border-radius: 6px;
  white-space: pre-wrap;
  font-size: 13px;
}
.error:empty {
  display: none;
}
.modules {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.timeline {
  border-left: 2px solid #dce5f6;
  margin-left: 6px;
  padding-left: 20px;
}
.event {
  margin: 0 0 20px;
}
.event p {
  white-space: pre-wrap;
  margin: 6px 0;
}
.event small {
  color: var(--muted);
}
details {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 12px;
  margin-top: 10px;
}
summary {
  cursor: pointer;
  font-weight: 600;
}
.auth {
  max-width: 440px;
  margin: 9vh auto;
  padding: 34px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.auth .brand {
  color: #253b65;
  padding: 0 0 28px;
}
.auth label {
  margin: 18px 0;
}
.auth button {
  width: 100%;
  margin-top: 10px;
}
.auth h1 {
  font-size: 23px;
}
.loading {
  text-align: center;
  padding: 70px;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #20324f;
  color: white;
  padding: 13px 22px;
  border-radius: 9px;
  box-shadow: 0 8px 30px #15223a33;
  z-index: 99;
  display: none;
  max-width: 85vw;
}
.pending {
  color: #976819;
}
.line-clamp {
  white-space: pre-wrap;
  max-width: 420px;
  overflow-wrap: anywhere;
}
.nowrap {
  white-space: nowrap;
}
.smallbutton {
  font-size: 12px;
  padding: 7px 10px;
}
.linkbutton {
  border: 0;
  background: none;
  color: var(--blue);
  padding: 0;
  text-align: left;
  font-weight: 650;
  font-size: 13px;
}
.inlinefields {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
}
@media (max-width: 1050px) {
  .quote-kpis,
  .forecast-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 950px) {
  .shell {
    grid-template-columns: 224px minmax(0, 1fr);
  }
  .sidebar {
    padding: 24px 10px 18px;
  }
  .main {
    padding: 25px 20px;
  }

  .grid {
    gap: var(--form-row-gap);
  }
  th,
  td {
    padding: 11px 12px;
  }
  .tabs button {
    padding: 12px 10px;
  }
}
@media (max-width: 650px) {
  .quote-kpis,
  .forecast-kpis {
    grid-template-columns: 1fr;
  }
  .shell {
    display: block;
  }
  .sidebar {
    height: auto;
    position: static;
    padding: 14px;
  }
  .brand {
    padding: 0 0 12px;
    font-size: 20px;
  }
  .brand small {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .sidebar .nav-link {
    width: auto;
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 10px;
  }
  .nav-separator {
    width: 1px;
    height: 26px;
    flex: 0 0 1px;
    margin: 7px 5px;
  }
  .sidebar footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding: 8px 2px 0;
  }
  .sidebar .logout {
    padding: 0;
  }
  .main {
    padding: 22px 14px;
  }

  .grid {
    grid-template-columns: 1fr;
  }
  .prospect-grid-spacer { display: none; }
  .wide {
    grid-column: auto;
  }
  .heading {
    align-items: start;
  }
  .heading h1 {
    font-size: 24px;
  }
  .heading .primary {
    white-space: nowrap;
  }
  .dialog-body {
    padding: 18px;
  }
  .dialog-head,
  .dialog-foot {
    padding: 16px 18px;
  }
  .filters label {
    min-width: calc(50% - 12px);
  }
  .stat {
    min-width: 140px;
  }
  .auth {
    margin: 30px 14px;
  }
  .panel-head {
    padding: 16px;
  }
  .tabs {
    margin-bottom: 18px;
  }
}
.forecast-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 22px;
}
.forecast-toolbar input {
  max-width: 100px;
}
.forecast-toolbar .actions {
  align-items: end;
}
.forecast-number-search {
  width: min(100%, 300px);
}
.forecast-toolbar .forecast-number-search input {
  max-width: none;
  width: 100%;
}
.forecast-search-result {
  margin-bottom: 20px;
}
.forecast-matrix {
  min-width: 1380px;
}
.forecast-matrix th,
.forecast-matrix td {
  padding: 7px 10px;
}
.forecast-matrix td:first-child,
.forecast-matrix th:first-child {
  position: sticky;
  left: 0;
  min-width: 170px;
  background: white;
  z-index: 1;
}
.matrix-value {
  border: 0;
  background: none;
  padding: 4px;
  color: #315ec0;
  font-size: 12px;
  white-space: nowrap;
}
.matrix-total {
  font-weight: 700;
  background: #edf3ff;
}
.billing-notice {
  margin-top: 18px;
  margin-bottom: 0;
}
.upcoming-panel {
  margin-bottom: 18px;
}
.upcoming-panel h3 {
  text-transform: capitalize;
  margin: 0;
}
[hidden] {
  display: none !important;
}

.record-notes .note-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.record-notes .event {
  padding: 16px;
  border: 1px solid #dde3ef;
  border-radius: 8px;
  margin: 12px 0;
}
.record-notes textarea {
  margin: 8px 0;
}
.record-notes .note-detail:empty {
  display: none;
}
.link-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.link-field a {
  font-size: 13px;
  width: fit-content;
}
.link-field a[aria-disabled="true"] {
  color: #697386;
  pointer-events: none;
  text-decoration: none;
}
.required-help {
  border-left: 3px solid #365acb;
  padding: 10px 14px;
  background: #f2f5ff;
}

.record-notes .event > small {
  display: block;
  margin-bottom: 4px;
}

.deletion-controls {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
}
.danger-button {
  color: #b42318;
  border-color: #f2b8b5;
  background: #fff;
}
.danger-button:hover {
  background: #fff1f0;
}
.deletion-info:empty {
  display: none;
}

.commission-table .sub {
  display: block;
}
.commission-table th,
.commission-table td {
  padding: 12px 10px;
}

/* Shared editor for observations, billing instructions and dated notes. */
.rich-editor { position:relative; border:1px solid #bdc9c4; border-radius:8px; background:white; margin:6px 0 16px; overflow:hidden; grid-column:1 / -1; }
.rich-toolbar { display:flex; flex-wrap:wrap; gap:4px; padding:7px; border-bottom:1px solid #dce3df; background:#f5f8f6; }
.rich-toolbar button { padding:5px 9px; font-size:13px; min-height:30px; }
.rich-toolbar .rich-link-button { display:grid; place-items:center; margin-left:2px; min-width:30px; padding:5px 8px; line-height:1; }
.rich-toolbar .rich-link-button svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.rich-input { padding:12px; min-height:110px; max-height:400px; overflow:auto; outline:none; font-weight:400; }
.rich-input:focus { box-shadow:inset 0 0 0 2px #34735c; }
.rich-input[contenteditable=false] { background:#f5f6f5; }
.rich-content { white-space:pre-wrap; overflow-wrap:anywhere; }
.rich-content p, .rich-content div { margin:0 0 6px; }
.rich-content ul, .rich-content ol { padding-left:26px; margin:8px 0; white-space:normal; }
.rich-content a { color:#176447; text-decoration:underline; }
.rich-link-popover { position:absolute; z-index:4; top:46px; right:8px; display:flex; align-items:center; gap:5px; padding:7px; border:1px solid #b7cabe; border-radius:8px; background:#fff; box-shadow:0 8px 20px rgba(25,61,46,.16); }
.rich-link-popover input { width:min(300px, calc(100vw - 190px)); min-height:32px; margin:0; }
.rich-link-popover button { min-width:32px; min-height:32px; padding:4px 7px; }
.rich-link-popover [data-link-save] { color:#fff; border-color:#34735c; background:#34735c; }
.rich-link-popover [data-link-remove] { color:#9d3434; }
.rich-link-popover[hidden], textarea[hidden] { display:none !important; }
.rich-editor > .error:not(:empty) { padding:8px 12px; }

/* Forecast status in the annual matrix; readable without relying on colour alone. */
.forecast-matrix .matrix-value { display:inline-block; border-radius:6px; padding:5px 8px; font-weight:700; color:#203047; }
.forecast-matrix button.matrix-value:hover { outline:2px solid #315ec0; outline-offset:1px; }
.forecast-matrix .matrix-invoiced, .matrix-legend .matrix-invoiced { background:#d8f2e2; }
.forecast-matrix .matrix-mixed, .matrix-legend .matrix-mixed { background:#dbeafd; }
.forecast-matrix .matrix-estimated, .matrix-legend .matrix-estimated { background:#fff1b8; }
.forecast-matrix .matrix-pending, .matrix-legend .matrix-pending { background:#f0f2f5; }
.forecast-matrix .matrix-none { background:transparent; }
.forecast-matrix .matrix-readonly { white-space:nowrap; }
.matrix-estimate-marker { display:inline-block; margin-left:5px; padding:1px 4px; border-radius:4px; background:#fff1b8; font-size:10px; color:#574600; }
.matrix-legend { display:flex; flex-wrap:wrap; gap:12px; margin-top:8px; color:#3c4959; font-size:12px; }
.matrix-legend span { display:inline-flex; align-items:center; gap:5px; white-space:nowrap; }
.matrix-legend i { display:inline-block; width:13px; height:13px; border:1px solid #b5c0cb; border-radius:3px; }

.overdue-label { display:inline-block; margin-left:5px; padding:2px 6px; border-radius:5px; background:#fff1d5; color:#76510d; font-size:11px; font-weight:700; }

.partner-tabs .tab-count {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff1d6;
  color: #775000;
  font-size: 12px;
  font-weight: 700;
}
.partner-agreements {
  margin-top: 18px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
}

.demo-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
@media (max-width: 700px) { .demo-kpis { grid-template-columns: 1fr; } }

#demo-filters { max-width: none; margin-bottom: 20px; }
/* KPIs: filtros comunes y seis gráficos con detalle accesible. */
.kpi-filters {padding:20px;overflow:visible;}
.kpi-filter-row {display:flex;align-items:end;gap:18px;flex-wrap:wrap;}
.kpi-filter-row label {min-width:140px;}
.kpi-filter-row input[type=number] {width:100px;}
.kpi-label {display:block;font-size:12px;font-weight:600;color:#50617c;margin-bottom:8px;}
.kpi-periods {display:flex;gap:6px;flex-wrap:wrap;}
.kpi-periods button {padding:10px 12px;}
.kpi-periods button[aria-pressed=true] {background:#e8efff;border-color:#9bb6f5;color:#214ab6;}
.kpi-states {position:relative;min-width:175px;}
.kpi-states summary {cursor:pointer;padding:11px;border:1px solid var(--border);border-radius:8px;}
.kpi-states>div {position:absolute;z-index:5;top:48px;background:white;box-shadow:0 8px 30px #22304720;border:1px solid var(--border);border-radius:10px;min-width:230px;padding:14px;}
.kpi-states .check {margin:8px 0;}
.kpi-custom {display:flex;align-items:end;gap:15px;margin-top:16px;}
.kpi-custom[hidden] {display:none;}
.kpi-filter-footer {display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap;border-top:1px solid var(--border);padding-top:12px;margin-top:16px;}
.kpi-filter-footer .check {margin:0;}
.kpi-charts {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-bottom:20px;}
.kpi-card {min-width:0;}
.kpi-card header {display:flex;justify-content:space-between;gap:12px;padding:20px 20px 12px;}
.kpi-card h2 {font-size:17px;margin:0 0 6px;}
.kpi-card header p {font-size:12px;color:var(--muted);margin:0;}
.kpi-card header strong {font-size:21px;white-space:nowrap;text-align:right;}
.kpi-card header small {display:block;font-size:11px;font-weight:400;color:var(--muted);margin-top:5px;}
.kpi-plot {margin:5px 12px 0;min-height:240px;}
.kpi-plot svg {display:block;width:100%;height:auto;}
.kpi-gridline {stroke:#e8edf4;stroke-width:1;}
.kpi-axis {fill:var(--muted);font-size:11px;}
.kpi-value {fill:#334155;font-size:11px;font-weight:600;}
.kpi-bar {stroke:none;transition:filter .15s ease;}
.kpi-bar:hover {filter:brightness(.94);}
.kpi-volume {fill:var(--kpi-blue);}
.kpi-facturado {fill:var(--kpi-blue);background:var(--kpi-blue);stroke:none;}
.kpi-previsto {fill:var(--kpi-planned);background:var(--kpi-planned);stroke:none;}
.kpi-estimado {fill:var(--kpi-estimated);background:var(--kpi-estimated);stroke:none;}
.kpi-legend {display:flex;gap:16px;padding:0 20px;font-size:12px;color:var(--muted);}
.kpi-legend span {display:flex;gap:6px;align-items:center;}
.kpi-legend i {width:12px;height:12px;border-radius:3px;border:1px solid #0001;}
.kpi-data {border-top:1px solid var(--border);margin-top:8px;}
.kpi-data summary {padding:12px 20px;cursor:pointer;color:var(--muted);font-size:12px;}
.kpi-data td,.kpi-data th {font-size:12px;padding:12px;}
.kpi-description {margin:10px 0 0;padding:0 20px;}
.kpi-warning {padding:0 20px;}
.kpi-loading {opacity:.45;}
#kpi-error:not(:empty) {color:#b43434;padding:12px 0;}
@media(max-width:1000px) {.kpi-charts {grid-template-columns:1fr;}.kpi-custom {flex-wrap:wrap;}}
.kpi-filter-row>label,.kpi-custom>label {display:flex;flex-direction:column;align-items:stretch;font-size:12px;font-weight:600;}
.kpi-filter-row>label:first-child {min-width:100px;}
.kpi-states {margin:0;padding:0;border:0;background:transparent;}
.kpi-states summary {font-size:13px;}
.kpi-states .check {font-size:13px;}
.kpi-data {padding:0;background:transparent;border-radius:0;border-right:0;border-left:0;border-bottom:0;}
.kpi-detail-row {cursor:pointer;}
.kpi-detail-row:hover,.kpi-detail-row:focus-within {background:#f0f5ff;}
.kpi-detail-row .linkbutton {white-space:nowrap;}
.smart-buttons{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 20px;padding:12px;border:1px solid #d8e3f6;border-radius:10px;background:#f4f7fd}
.smart-button{display:flex;align-items:center;gap:10px;background:#fff;color:#294870;border-color:#d8e3f6;padding:9px 12px;font-size:12px}
.smart-button strong{font-size:15px;color:#2759d8}
.note-context-filters{display:flex;gap:12px;flex-wrap:wrap;margin:12px 0}
.note-context-filters label{flex:1;min-width:130px}
.note-origin{color:#315f9e;font-weight:600}

/* Companies share a compact prospecting and customer workspace. */
.company-tags { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.company-tag { display:inline-flex; align-items:center; gap:5px; padding:5px 9px; }
.company-tag button { border:0; background:transparent; padding:0 2px; color:inherit; }
.tag-entry { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.tag-entry input { flex:1; min-width:0; }
.demo-note-heading { padding:10px 12px; background:#edf4ff; border-left:3px solid #648bd3; border-radius:5px; }
.history-old { color:var(--muted); }

/* Keep month labels aligned with the horizontally scrolling annual table. */
.matrix-pinned-header {
  position: fixed;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
  background: #f9fafc;
  box-shadow: 0 2px 5px #14233a1c;
}
.matrix-pinned-header table { table-layout: fixed; }
.matrix-pinned-header th { background: #f9fafc; }
.matrix-pinned-header th:first-child { z-index: 2; background: #f9fafc; }

/* Identidad SMEL aprobada: marca y acciones, conservando colores de estado. */
button:hover { background: #f1f5eb; }
.primary { background: #557826; border-color: #557826; }
.primary:hover { background: #436221; border-color: #436221; }
.sidebar { background: #fff; color: #61675b; border-right: 1px solid var(--border); }
.brand { font-size: 0; letter-spacing: 0; color: #30352d; }
.brand::before { content: ""; display: block; width: 133px; height: 63px; background: url('/smel-logo.png') left center / contain no-repeat; }
.brand small { color: var(--muted); margin-top: 12px; }
.sidebar .nav-link:hover { background: #f5f7f0; color: #436221; }
.sidebar .nav-link.current { background: #eef4e4; color: #436221; box-shadow: inset 3px 0 #85b342; }
.sidebar .nav-link:focus-visible, .sidebar .logout:focus-visible { outline-color: #557826; }
.nav-separator { background: var(--border); }
.sidebar footer { border-color: var(--border); }
.user-name { color: #30352d; }
.sidebar .logout { color: var(--muted); }
.sidebar .logout:hover { color: #436221; }
.env { background: #f0f5e9; color: #557826; }
.panel, .stat { box-shadow: 0 2px 3px #28302003; }
th, .matrix-pinned-header th, .matrix-pinned-header th:first-child { background: #f7f8f4; }
tbody tr:hover { background: #fafbf7; }
.forecast-kpis .stat-detail b { color: #4d5843; }
.tabs button.active, .tabs button[aria-selected="true"] { color: #557826; border-bottom-color: #85b342; }
.smart-buttons { background: #f4f7ee; border-color: #dce5cf; }
.smart-button { color: #436221; border-color: #dce5cf; }
.smart-button strong { color: #557826; }
.notice:not(.warn):not(.success):not(.danger) { background: #f3f7ee; border-color: #dce5cf; color: #4d6240; }
.auth .brand { color: #30352d; }
.auth { box-shadow: 0 8px 28px #28302008; }
.tabs button.current { border-bottom-color: #85b342; }
#quote-form .section, #forecast-form .section { background: #f8f9f5; }
#quote-form .quote-acceptance-phase, #forecast-form .forecast-invoice-phase { background: #f0f9f4; }
input:focus, select:focus, textarea:focus { outline-color: #557826; }
@media (max-width: 700px) { .brand::before { width: 105px; height: 50px; } }

.filters label.demo-filter-check { flex: 0 0 auto; min-width: 0; display: flex; flex-direction: row; align-items: center; align-self: flex-end; gap: 7px; height: 40px; white-space: nowrap; }
 .drive-folder-link { display: inline-flex; align-items: center; gap: 7px; }
 .drive-folder-link svg { flex: 0 0 16px; width: 16px; height: 16px; }
 .drive-edit-icon { display: inline-flex; align-items: center; justify-content: center; padding: 6px; border: 0; background: transparent; color: #78816f; border-radius: 4px; }
 .drive-edit-icon:hover { background: #eef3e7; color: #48651c; }
 .drive-edit-icon svg { width: 15px; height: 15px; }

/* Compact, keyboard-accessible sorting controls in table headings. */
th .table-sort{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:inherit;box-shadow:none;cursor:pointer;white-space:normal;text-align:inherit;}
th .table-sort:hover{color:var(--primary,#4c751c);background:transparent;}
th .table-sort:focus-visible{outline:2px solid #729d3c;outline-offset:4px;border-radius:3px;}
.sort-marker{font-size:12px;opacity:.4;min-width:12px;}
th[aria-sort] .sort-marker{opacity:1;color:#4c751c;}
.list-pagination[hidden],tbody tr[hidden]{display:none!important;}
.matrix-pinned-header .table-sort{pointer-events:auto;}

.company-autocomplete { position: relative; }
.company-suggestions { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid #d9e1d1; border-radius: 8px; box-shadow: 0 8px 20px #26351c20; }
.company-suggestions[hidden] { display: none; }
.company-suggestions [role="option"] { padding: 10px 12px; cursor: pointer; font-weight: normal; }
.company-suggestions [role="option"]:hover, .company-suggestions [aria-selected="true"] { background: #eef4e5; color: #456b18; }

.rich-content blockquote { margin: 12px 0; padding: 10px 14px; border-left: 3px solid #85b342; background: #f3f6ee; color: #526047; border-radius: 0 5px 5px 0; }
.rich-content blockquote > :first-child { margin-top: 0; }
.rich-content blockquote > :last-child { margin-bottom: 0; }

.billing-goal {padding:20px;margin-bottom:20px;}
.billing-goal header {display:flex;justify-content:space-between;align-items:start;gap:18px;margin-bottom:30px;flex-wrap:wrap;}
.billing-goal h2 {margin:0;}
.billing-goal-target {text-align:right;color:#626b59;}
.billing-goal-target strong {display:block;font-size:23px;color:#30372b;}
.billing-goal-position {position:relative;margin:0 0 22px;}
.billing-goal-marker {position:absolute;top:-23px;transform:translateX(-50%);color:#242a21;font-size:16px;}
.billing-goal-track {display:flex;height:44px;overflow:hidden;border-radius:8px;background:#edf0e8;}
.billing-goal-track .billing-goal-segment {padding:0;border:0;border-radius:0;min-width:0;font-size:14px;font-weight:600;color:#233020;white-space:nowrap;}
.billing-goal .done {background:#238451;color:white;}
.billing-goal .planned {background:#b8dfc5;}
.billing-goal .sales {background:#f2d366;}
.billing-goal .gap {background:#ef9a96;}
.billing-goal-legend {display:grid;grid-template-columns:repeat(4,1fr);gap:16px;}
.billing-goal-legend>div {display:flex;gap:9px;align-items:start;}
.billing-goal-swatch {width:12px;height:12px;flex:0 0 12px;border-radius:3px;margin-top:4px;}
.billing-goal-legend strong {display:block;margin-top:5px;}
.billing-goal-summary {display:grid;grid-template-columns:1fr 1fr;gap:20px;border-top:1px solid #dfe4d7;margin-top:22px;padding-top:18px;}
.billing-goal-summary>div>strong {display:block;margin:5px 0;}
.billing-goal-summary>div>span {color:#626b59;}
@media(max-width:600px){.billing-goal-legend,.billing-goal-summary{grid-template-columns:1fr 1fr}.billing-goal{padding:16px}.billing-goal-track .billing-goal-segment{font-size:11px}}
@media(max-width:400px){.billing-goal-summary{grid-template-columns:1fr}}
.billing-goal-track .billing-goal-segment {cursor:default;}
.billing-goal-tooltip {position:absolute;bottom:calc(100% + 8px);z-index:5;padding:7px 10px;border-radius:6px;background:#30372b;color:#fff;font-size:13px;max-width:100%;width:max-content;box-shadow:0 3px 10px #0002;pointer-events:none;}
.billing-goal-tooltip[hidden] {display:none;}
.tabs a {display:inline-block;text-decoration:none;padding:12px 16px;color:inherit;font-weight:600;border-bottom:3px solid transparent;}
.tabs a.current {color:#507a19;border-bottom-color:#85b342;}
.nnr-quarters {display:flex;gap:16px;align-items:center;flex-wrap:wrap;}
.nnr-quarters {display:inline-flex;gap:0;width:max-content;max-width:100%;border:1px solid #dfe4d7;border-radius:7px;overflow:hidden;}
.nnr-quarters label.check {margin:0;padding:8px 11px;gap:5px;border-right:1px solid #dfe4d7;}
.nnr-quarters label.check:last-child {border-right:0;}
.nnr-quarters label.check:has(input:checked) {background:#edf4e4;}
.filters .nnr-quarters {flex:0 0 auto;flex-wrap:nowrap;width:max-content;gap:0;}
.filters .nnr-quarters label.check {flex:0 0 auto;min-width:0;width:auto;display:inline-flex;white-space:nowrap;padding:7px 8px;gap:4px;}
.filters .nnr-quarters input[type="checkbox"] {width:13px;height:13px;min-width:0;margin:0;flex:0 0 13px;}
.module-allocation-row {display:grid;grid-template-columns:minmax(100px,2fr) minmax(85px,1fr) auto auto;gap:12px;align-items:end;margin-top:12px;}
.module-allocation-row [data-share] {padding-bottom:10px;white-space:nowrap;}
.module-kpi {grid-column:1 / -1;}
.module-kpi-bar {display:flex;height:14px;min-width:120px;overflow:hidden;border-radius:4px;}
.module-kpi-bar span {display:block;height:100%;}
@media(max-width:500px){.module-allocation-row{grid-template-columns:1fr 1fr;}}
.module-share-bar {background:#539c2d;border-radius:4px;}
.module-years {position:relative;}
.module-years-chart {display:grid;grid-template-columns:36px repeat(5,minmax(0,1fr));gap:12px;margin:38px 0 18px;}
.module-year-column {display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0;}
.module-year-total {font-size:12px;white-space:nowrap;}
.module-year-stack {height:230px;width:75%;max-width:80px;background:#eef1e9;display:flex;flex-direction:column;justify-content:end;border-radius:6px 6px 0 0;}
.module-year-stack .module-year-segment {border:0;padding:0;min-height:0;flex-shrink:0;border-radius:0;color:white;font-size:12px;font-weight:600;width:100%;text-shadow:0 1px 2px #0008;}
.module-year-stack .module-year-segment:first-child {border-radius:6px 6px 0 0;}
.module-years-axis {display:flex;flex-direction:column;justify-content:space-between;height:230px;margin-top:26px;font-size:12px;color:#626b59;}
.module-year-tip {display:none;position:absolute;left:20px;top:58px;z-index:3;background:#30372b;color:white;padding:7px 10px;border-radius:6px;font-size:13px;font-weight:400;text-shadow:none;pointer-events:none;max-width:calc(100% - 40px);}
.module-year-segment:hover .module-year-tip,.module-year-segment:focus .module-year-tip {display:block;}
.module-years-legend {display:flex;gap:12px 18px;flex-wrap:wrap;margin-bottom:16px;}
.module-years-legend>span {display:flex;align-items:center;gap:6px;font-size:12px;}
.module-years-legend i {width:12px;height:12px;border-radius:3px;}
@media(max-width:500px){.module-years-chart{gap:5px;grid-template-columns:28px repeat(5,minmax(0,1fr))}.module-year-total{font-size:10px}.module-year-stack{width:90%}.module-year-stack .module-year-segment{font-size:10px}}
.module-year-stack [data-module-color="#a9afa4"] {color:#30372b;text-shadow:none;}
.filters .nnr-quarters {border:0;gap:5px;overflow:visible;}
.filters .nnr-quarters label.check {border:1px solid #dfe4d7;border-radius:7px;padding:9px 11px;position:relative;}
.filters .nnr-quarters label.check:last-child {border-right:1px solid #dfe4d7;}
.filters .nnr-quarters label.check:has(input:checked) {background:#e9efff;border-color:#a3b7ff;color:#2455e8;}
.filters .nnr-quarters input[type="checkbox"] {position:absolute;opacity:0;width:1px;height:1px;}
.filters .nnr-quarters label.check:has(input:focus-visible) {outline:2px solid #2455e8;outline-offset:2px;}
.module-year-stack [data-module-color="#F2A000"],.module-year-stack [data-module-color="#EE771B"],.module-year-stack [data-module-color="#43A8A5"] {color:#202820;text-shadow:none;}
.module-year-stack [data-module-color="#F2D34F"] {color:#202820;text-shadow:none;}
input[type="color"] {width:64px;height:38px;padding:3px;cursor:pointer;}
.module-color-preview {display:inline-flex;align-items:center;gap:8px;white-space:nowrap;}
.module-color-preview i {display:inline-block;width:20px;height:20px;border-radius:4px;box-shadow:inset 0 0 0 1px #0001;}
.external-cost-row {display:grid;grid-template-columns:2fr 1fr auto;gap:12px;align-items:end;margin:12px 0;}
@media(max-width:500px){.external-cost-row{grid-template-columns:1fr;}}

/* Filtros compactos del listado de previsiones. */
#forecast-list-filter { display:grid; grid-template-columns:110px minmax(140px,1.2fr) minmax(120px,1fr) 105px minmax(120px,.8fr) auto auto; gap:12px; align-items:end; }
#forecast-list-filter > label { min-width:0; }
#forecast-list-filter .module-filter-check { display:flex; flex-direction:row; align-items:center; gap:6px; height:40px; white-space:nowrap; }
#forecast-list-filter .module-filter-check input { width:16px; min-width:16px; margin:0; }
@media(max-width:1050px) { #forecast-list-filter {display:flex;flex-wrap:wrap;} #forecast-list-filter > label {flex:1 1 130px;} #forecast-list-filter .module-filter-check {flex:0 0 auto;} }

.module-allocation-incomplete > summary { color:#b42318; }

.client-dashboard {grid-column:1/-1;position:relative;min-width:0;display:grid;gap:20px}
.client-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.client-stat{padding:18px;position:relative}
.client-stat summary{list-style:none;display:grid;gap:7px}
.client-stat summary::-webkit-details-marker{display:none}
.client-stat summary>strong{font-size:26px}
.client-stat small{color:var(--muted)}
.client-popover{display:none;position:absolute;top:100%;left:0;z-index:20;background:var(--surface,#fff);border:1px solid var(--border);border-radius:9px;padding:14px;width:340px;max-width:80vw;max-height:300px;overflow:auto;box-shadow:0 8px 24px #0002}
.client-stat:last-child .client-popover{left:auto;right:0}
.client-stat:hover .client-popover,.client-stat:focus-within .client-popover,.client-stat[open] .client-popover{display:block}
.client-pop-row{display:flex;justify-content:space-between;gap:16px;padding:8px 0;border-bottom:1px solid var(--border)}
.client-pop-row strong{white-space:nowrap}
.client-pair{display:grid;grid-template-columns:1.4fr 1fr;gap:16px}
.client-rank,.client-concentration{display:grid;width:100%;border:0;background:none;align-items:center;gap:9px;padding:9px 0;text-align:left;font-size:12px}
.client-rank{grid-template-columns:125px 1fr 90px 55px}
.client-concentration{grid-template-columns:90px 1fr 65px}
.client-track{display:flex;height:22px;background:#eef1e9;border-radius:5px;overflow:hidden}
.client-track i{height:100%;display:block;flex-shrink:0}
.client-float{position:absolute;z-index:30;background:#263320;color:#fff;border-radius:7px;max-width:330px;padding:10px 12px;pointer-events:none;font-size:12px}
.client-line-legend{display:flex;gap:20px;flex-wrap:wrap;font-size:12px;margin:16px 0}
[data-client-history] svg text{font-size:12px;fill:currentColor}
.client-gridline{stroke:#dfe4d7}
.client-line{stroke-width:2.5}
.client-line-0{stroke:#537f24}.client-line-1{stroke:#719466;stroke-dasharray:7 4}.client-line-2{stroke:#687363;stroke-dasharray:2 4}
.client-point-0{fill:#537f24}.client-point-1{fill:#719466}.client-point-2{fill:#687363}
@media(max-width:1100px){.client-pair{grid-template-columns:1fr}}
@media(max-width:700px){.client-stats{grid-template-columns:1fr}.client-rank{grid-template-columns:100px 1fr 85px}.client-rank>span:last-child{display:none}}
.client-stat{overflow:visible}
.client-stat:hover,.client-stat:focus-within,.client-stat[open]{z-index:21}

.client-line-legend>span{display:inline-flex;align-items:center;gap:7px}
.client-line-legend svg{overflow:visible;flex-shrink:0}


/* Shared note composer and progressively disclosed history. */
.record-notes .note-composer {
  margin: 12px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dfe4da;
}
.record-notes .note-composer .help { margin-bottom: 0; }
.record-notes .note-recent { margin: 0; }
.record-notes .note-older { margin-top: 16px; }
.record-notes .note-older > summary {
  padding: 10px 0;
  font-weight: 600;
  cursor: pointer;
}
.record-notes .note-older-item {
  padding: 8px 0;
  border-top: 1px solid #e5e8e1;
}
.record-notes .note-older-item > summary { cursor: pointer; }
.record-notes .note-summary-meta { font-size: 12px; color: #65705d; }
.record-notes .note-summary-preview {
  display: block;
  margin: 3px 0 0 16px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.record-notes .note-older-item .event { margin-bottom: 0; }

/* Commercial context: compact quote summaries and secondary creation actions. */
.prospect-quote-card {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--border);}
.prospect-quote-card:last-child {border-bottom:0;}
.prospect-quote-main {min-width:0;flex:1;}
.prospect-quote-meta {display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;margin-top:5px;font-size:12px;color:var(--muted);}
.prospect-quote-tools {display:flex;flex-wrap:wrap;gap:6px;}
.prospect-quote-tools .smallbutton {font-size:12px;padding:6px 9px;}
#prospect-quote-actions.quote-actions-disclosure {margin:8px 0 0;padding:0;border:0;border-radius:0;background:transparent;}
#prospect-quote-actions > summary {font-size:12px;font-weight:500;color:var(--muted);padding:4px 0;}
#prospect-quote-actions[open] > summary {margin-bottom:10px;}
#prospect-quote-actions .section {margin:12px 0 0;padding:12px 0 0;}
#prospect-quote-actions h4 {margin:0 0 8px;}
.quote-head {gap:12px;}
.quote-head h2 {flex:1;min-width:0;}
.quote-note-shortcut {flex-shrink:0;}
dialog.context-editor {width:min(660px,calc(100vw - 32px));max-height:90vh;}
dialog.context-editor .dialog-body {padding:18px 24px;}
dialog.context-editor .dialog-foot {padding:14px 24px;}
@media(max-width:650px){.prospect-quote-card{align-items:flex-start;flex-direction:column;}}

/* Acceso principal al presupuesto desde la prospección. */
.prospect-quote-open {display:inline-flex;align-items:center;text-align:left;max-width:100%;padding:8px 12px;border:1px solid #b7c99d;border-radius:7px;background:#edf4e5;color:#416919;line-height:1.35;}
.prospect-quote-open:hover {background:#dfeccd;border-color:#739b43;}
.prospect-quote-open:focus-visible {outline:2px solid #527b25;outline-offset:2px;}

.record-notes .note-actions {margin-top:14px;padding-top:10px;border-top:1px solid var(--border);gap:6px;flex-wrap:wrap;}
.record-notes .note-actions button {font-size:12px;font-weight:500;padding:5px 8px;border:1px solid transparent;background:transparent;color:var(--muted);border-radius:5px;}
.record-notes .note-actions button:hover {background:#edf3e6;color:#416919;border-color:#d4e1c4;}
.record-notes .note-actions button:focus-visible {outline:2px solid #527b25;outline-offset:2px;}
@media(max-width:650px){.quote-head{flex-wrap:wrap;}.quote-head h2{flex-basis:calc(100% - 55px);}.quote-head .quote-note-shortcut{order:3;}}

/* One rhythm between form rows, including fields inside lightweight wrappers.
   Grid/flex children already get their spacing from the parent's gap. */
:is(.dialog-body, .content-pad form)
  :where(.grid, label:not(.check), .fixed-field,
    div:not(.section):has(> .grid), div:not(.section):has(> label:not(.check)),
    div:has(> .fixed-field))
  + :where(.grid, label:not(.check), .fixed-field,
    div:not(.section):has(> .grid), div:not(.section):has(> label:not(.check)),
    div:has(> .fixed-field)) {
  margin-block-start: var(--form-row-gap);
}
:is(.dialog-body, .content-pad form) details > summary
  + :where(label:not(.check), .grid, .fixed-field, div:has(> label:not(.check)), div:has(> .grid)) {
  margin-block-start: var(--form-row-gap);
}
:is(.dialog-body, .content-pad form) :is(.grid, .filters, .actions) > :where(label, div, .fixed-field, .grid) {
  margin-block-start: 0;
}
.auth label { margin-block: var(--form-row-gap); }

.dialog-foot > .form-validation-message {color:#9a3412;max-width:52ch;overflow-wrap:anywhere;}

/* The forecast summary stays with the existing sticky record header. */
.dialog-head.forecast-summary-head { flex-wrap: wrap; gap: 16px; }
.forecast-summary { width: 100%; display: grid; grid-template-columns: 1fr 1.2fr 1.2fr; gap: 20px; padding: 16px 18px; background: #f6f8f4; border: 1px solid var(--border); border-radius: 10px; }
.forecast-summary > div { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; }
.forecast-summary-label { color: #596352; font-size: 12px; font-weight: 600; }
.forecast-summary-state { padding: 7px 12px; border-radius: 7px; background: #f4cd52; color: #4a3508; font-size: 14px; }
.forecast-summary-state[data-state="invoiced"] { background-color: #187347; color: #fff; }
.forecast-summary-state[data-state="cancelled"] { background-color: #b42332; color: #fff; }
.forecast-summary-amount { font-size: 25px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.forecast-summary-date { font-size: 18px; line-height: 1.6; }
@media (max-width: 560px) {
  .forecast-summary { grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; }
  .forecast-summary > div:last-child { grid-column: 1 / -1; }
  .forecast-summary-amount { font-size: 22px; }
  .dialog-head.forecast-summary-head { padding: 14px 18px; gap: 10px; }
}

.forecast-summary-status { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; margin: 0; color: #596352; font-size: 12px; font-weight: 600; }
.forecast-summary-status select { margin: 0; width: auto; min-width: 132px; max-width: 100%; border: 0; padding: 8px 32px 8px 12px; color: #fff; font-weight: 700; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4 3 3 3-3' fill='none' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.forecast-summary-state option { color: #243024; background: #fff; }
.forecast-client-link { border: 0; background: none; color: var(--primary, #486b21); font: inherit; padding: 0; text-align: left; }
.forecast-client-link:hover { text-decoration: underline; background: none; }
.forecast-next-links { display: flex; flex-wrap: wrap; gap: 6px 18px; width: 100%; padding: 0 2px; }
.forecast-next-links .linkbutton { padding: 0; font-size: 13px; }
.forecast-renewal-actions, .forecast-amount-actions { margin-top: 16px; flex-wrap: wrap; }
#invoice-fields.forecast-invoice-details { grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; margin: 0; padding: 16px 28px; border-bottom: 1px solid var(--border); background: #f6f8f4; }
#invoice-fields.forecast-invoice-details label { margin: 0; }
.forecast-invoice-phase[hidden] { display: none; }
@media (max-width: 560px) {
  #invoice-fields.forecast-invoice-details { grid-template-columns: 1fr 1fr; padding: 12px 18px; }
  #invoice-fields.forecast-invoice-details label:first-child { grid-column: 1 / -1; }
}

.forecast-original-plan[hidden] { display: none; }
.forecast-original-plan > .grid { margin-top: 16px; }

.forecast-summary-period { font-size: 11px; line-height: 1.4; color: #596352; }

.forecast-annual-panel { margin-bottom: 18px; }
.forecast-matrix-note { margin: 0; padding: 12px 20px; }
.forecast-undated-panel { margin-top: 0; }

.activity-panel { padding: 0; overflow: hidden; }
.activity-panel > .help { padding: 0 20px; }
.activity-panel .panel-head { gap: 16px; flex-wrap: wrap; }
.activity-panel .panel-head p { margin: 0; }
.activity-frame { display: block; width: 100%; height: 1960px; border: 0; background: #fff; }
@media (max-width: 720px) { .activity-frame { height: 2700px; } }

/* Documentación uses the full workspace. */
.documentation-layout { height: 100dvh; min-height: 0; }
.documentation-layout .workspace { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.documentation-layout .main { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; max-width: none; padding: 0; margin: 0; overflow: hidden; }
.documentation-layout .documentation-panel { display: flex; flex: 1; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.documentation-panel iframe { display: block; flex: 1; width: 100%; height: 100%; min-height: 0; border: 0; }
@media (max-width: 720px) {
  .shell.documentation-layout { display: flex; flex-direction: column; }
  .documentation-layout .sidebar { flex-shrink: 0; }
  .documentation-layout .workspace { flex: 1; }
}

/* Client-module operations and cross-selling share existing record/dialog spacing. */
.cm-module-chip{display:inline-flex;align-items:center;margin:3px 4px 3px 0;padding:4px 8px;border:0;border-radius:5px;font-size:12px;white-space:nowrap}.cm-chips{min-width:155px}.cm-summary{max-width:340px;white-space:normal;overflow-wrap:anywhere}.cm-status{white-space:normal}.cm-filters{flex-wrap:wrap}.cm-filters .error:empty{display:none}

/* Environment identity is driven by /api/session, never by the selected page. */
html[data-development="true"] {--environment-banner-height:32px;}
html[data-development="true"] body {padding-top:var(--environment-banner-height);}
html[data-development="true"] body::before {content:"ENTORNO DE DESARROLLO";position:fixed;inset:0 0 auto;height:var(--environment-banner-height);display:flex;align-items:center;justify-content:center;background:#F5B529;color:#392300;font-size:13px;font-weight:800;letter-spacing:1px;z-index:10000;pointer-events:none;border-bottom:2px solid #BA7500;}
html[data-development="true"] .shell {min-height:calc(100vh - var(--environment-banner-height));}
html[data-development="true"] .sidebar {background:#FFF3D2;border-left:6px solid #D58A13;top:var(--environment-banner-height);height:calc(100vh - var(--environment-banner-height));}
html[data-development="true"] .shell.documentation-layout {height:calc(100dvh - var(--environment-banner-height));min-height:0;}
html[data-development="true"] dialog {border:2px solid #CE8A17;border-top-width:6px;max-height:calc(100dvh - 52px);}
html[data-development="true"] .dialog-head {background:#FFE2A0;border-bottom-color:#D7A244;}
.environment-badge {display:inline-flex;align-items:center;padding:5px 10px;border:1px solid #8D4600;border-radius:5px;background:#AA4B00;color:#FFF;font-size:13px;font-weight:800;letter-spacing:.5px;vertical-align:middle;white-space:nowrap;}
.brand > .environment-badge {margin-top:10px;}
.dialog-head h2 > .environment-badge {margin-left:10px;}
@media(max-width:700px){html[data-development="true"] .sidebar{height:auto;}}
@media print {.environment-badge,html[data-development="true"] body::before {display:none;}html[data-development="true"]{--environment-banner-height:0px;}}

/* Compact document controls; no duplicated title or page header. */
.documentation-panel { position:relative;flex-direction:column; }
.documentation-tools { display:flex;align-items:center;justify-content:flex-end;gap:6px;padding:6px 10px;border-bottom:1px solid var(--line,#dfe3db);background:#fff;flex-shrink:0;flex-wrap:wrap; }
.documentation-tools .smallbutton { margin:0;white-space:nowrap;text-decoration:none; }
.documentation-tools a[aria-disabled="true"] { opacity:.5;pointer-events:none; }
.documentation-status { margin-right:auto;font-size:.8rem;color:#66705f; }
.documentation-development { display:none; }
html[data-development="true"] .documentation-development { display:inline-block;background:#a84b00;color:#fff;padding:3px 7px;border-radius:4px;font-size:.7rem;font-weight:800; }
.documentation-feedback { padding:6px 12px;flex-shrink:0; }
.documentation-feedback input { width:100%; }
.documentation-expanded { position:fixed!important;inset:var(--environment-banner-height,0px) 0 0;z-index:1200;background:#fff; }
.documentation-panel:fullscreen { display:flex;width:100%;height:100%;background:#fff; }
.documentation-panel iframe { flex:1;min-height:0; }
@media(max-width:600px){.documentation-tools{gap:4px;padding:5px}.documentation-status{flex-basis:100%}.documentation-tools .smallbutton{font-size:.75rem;padding:6px 8px}}

/* Immediate, keyboard/touch accessible client list for module percentages. */
.module-clients {display:inline-block;text-align:left;}
.module-clients > summary {cursor:pointer;color:var(--primary,#537f24);font-weight:700;list-style:none;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:3px;}
.module-clients > summary::-webkit-details-marker {display:none;}
.module-clients-panel {position:fixed;z-index:1100;width:300px;max-width:calc(100vw - 16px);max-height:min(280px,70vh);overflow:auto;white-space:normal;padding:14px 16px;background:#fff;color:#30372b;border:1px solid #dce1d6;border-radius:8px;box-shadow:0 6px 24px #0002;font-size:13px;font-weight:400;}
.module-clients-panel ul {margin:8px 0 0;padding-left:18px;}
.module-clients-panel li+li {margin-top:5px;}

/* Current customer/module overview: action first, context below. */
.cmh-dashboard {margin-top:20px;}
.cmh-filters {display:flex;gap:14px;align-items:end;flex-wrap:wrap;padding:18px 20px;}
.cmh-filters label {flex:1 1 150px;min-width:130px;margin:0;}
.cmh-filters label:first-child {flex-grow:2;}
.cmh-filters button {min-height:40px;}
.cmh-cards {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin:8px 0 24px;}
.cmh-card {display:block;text-align:left;padding:22px 24px;border-top:4px solid #72826a;cursor:pointer;transition:box-shadow .15s;}
.cmh-card:hover,.cmh-card:focus-visible {box-shadow:0 3px 14px #30372b16;}
.cmh-card[aria-pressed="true"] {outline:2px solid #557826;outline-offset:2px;}
.cmh-card > span {display:block;color:var(--muted);font-size:12px;font-weight:500;}
.cmh-card h2 {font-size:16px;margin:7px 0 15px;}
.cmh-card > strong {font-size:34px;line-height:1.1;}
.cmh-card > strong small {font-size:14px;font-weight:500;color:var(--muted);}
.cmh-card p {margin:10px 0 0;font-weight:400;color:var(--muted);}
.cmh-card p span {float:right;}
.cmh-review {border-top-color:#B74D3E;}
.cmh-commercial {border-top-color:#AF790E;}
.cmh-unrated {border-top-color:#3469C6;}
.cmh-map {margin-bottom:28px;overflow:hidden;}
.cmh-map header {display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 24px 18px;flex-wrap:wrap;}
.cmh-map header h2 {margin:0 0 7px;}
.cmh-map header p {margin:0;}
.cmh-map header label {font-size:13px;white-space:nowrap;}
.cmh-matrix-scroll {overflow:auto;max-height:640px;border-top:1px solid var(--border);}
.cmh-matrix-scroll table {border-collapse:separate;border-spacing:0;min-width:850px;width:100%;}
.cmh-matrix-scroll thead th {position:sticky;top:0;background:#f5f7f1;z-index:2;padding:14px 18px;min-width:140px;}
.cmh-matrix-scroll thead th:first-child {left:0;z-index:3;min-width:190px;}
.cmh-matrix-scroll tbody th {position:sticky;left:0;z-index:1;background:#fff;min-width:190px;padding:15px 18px;border-bottom:1px solid var(--border);text-align:left;}
.cmh-matrix-scroll tbody th a {text-decoration:none;color:#30372b;}
.cmh-matrix-scroll tbody th a:hover {text-decoration:underline;}
.cmh-matrix-scroll td {padding:12px 16px;vertical-align:middle;}
.cmh-cell {display:flex;position:relative;flex-direction:column;align-items:flex-start;gap:5px;border:0;background:transparent;padding:4px 0;min-width:125px;text-align:left;}
.cmh-cell:hover .cmh-pill {box-shadow:0 0 0 2px #30372b25;}
.cmh-cell small {font-size:11px;color:var(--muted);font-weight:400;}
.cmh-pill {display:inline-block;border-radius:5px;padding:5px 8px;font-size:12px;font-weight:600;line-height:1.3;white-space:normal;}
.cmh-attention {position:absolute;right:-1px;bottom:2px;border-radius:50%;width:17px;height:17px;line-height:17px;background:#fff0cd;color:#805900;text-align:center;font-size:12px;font-weight:700;}
.cmh-relevance {font-size:12px;color:var(--muted);}
.cmh-rel-3,.cmh-rel-4 {font-weight:700;color:#74476e;}
.cmh-out {color:#9b9f96;}
.cmh-highlight {background:#f0f5e8;box-shadow:inset 0 -2px #83ac4f;}
.cmh-selection {padding:12px 24px;background:#f0f5e8;display:flex;gap:16px;align-items:center;flex-wrap:wrap;border-top:1px solid var(--border);}
.cmh-selection span {color:var(--muted);}
.cmh-selection button {margin-left:auto;}
.cmh-map footer {display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 24px;font-size:12px;color:var(--muted);}
.cmh-map footer div {display:flex;align-items:center;gap:10px;}
.cmh-charts {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;}
.cmh-chart > h2 {margin-top:0;font-size:18px;}
.cmh-chart-row {margin:24px 0 28px;}
.cmh-chart-row:last-child {margin-bottom:4px;}
.cmh-chart-label {display:flex;justify-content:space-between;gap:10px;margin-bottom:9px;}
.cmh-chart-label > span {color:var(--muted);font-size:12px;}
.cmh-stack {display:flex;height:34px;background:#eef0e9;border-radius:6px;overflow:hidden;}
.cmh-stack button {border:0;border-radius:0;min-width:0;padding:0;font-size:12px;font-weight:700;flex-shrink:0;}
.cmh-stack button+button {border-left:1px solid #ffffff80;}
.cmh-stack button:hover,.cmh-stack button:focus-visible {filter:brightness(.9);outline-offset:-3px;}
.cmh-stack > span {padding:8px 10px;}
.cmh-chart-legend {display:flex;flex-wrap:wrap;gap:8px 14px;margin-top:9px;font-size:11px;color:var(--muted);}
.cmh-chart-legend > span {display:inline-flex;align-items:center;gap:5px;}
.cmh-chart-legend i {width:9px;height:9px;border-radius:2px;display:inline-block;}
.cmh-float {position:fixed;z-index:1200;width:340px;max-width:calc(100vw - 16px);max-height:min(380px,70vh);overflow:auto;padding:16px 18px;border:1px solid var(--border);border-radius:9px;background:#fff;color:#30372b;box-shadow:0 5px 24px #0002;font-size:13px;white-space:normal;}
.cmh-float[hidden] {display:none;}
.cmh-float p {margin:8px 0;overflow-wrap:anywhere;}
.cmh-float ul {padding-left:18px;margin:9px 0;}
.cmh-float li+li {margin-top:5px;}
.cmh-float small {color:var(--muted);}
.cmh-footnote {margin:20px 0;}
@media(max-width:1000px){.cmh-cards{gap:12px}.cmh-card{padding:18px 16px}.cmh-charts{grid-template-columns:1fr}}
@media(max-width:680px){.cmh-cards{grid-template-columns:1fr}.cmh-card>strong{font-size:28px}.cmh-map header,.cmh-map footer{padding:16px;}.cmh-map footer{flex-wrap:wrap}}

.kpi-tabs {overflow-x:auto;flex-wrap:nowrap;}
.kpi-tabs > a {flex-shrink:0;white-space:nowrap;}

/* Contracted modules are tiles; commercial states keep their lighter badge layout. */
.cmh-cell.cmh-contracted {width:100%;flex-direction:row;align-items:center;padding:7px 10px;gap:8px;border:1px solid #bed0ad;border-left:4px solid #557826;border-radius:8px;background:#f1f6eb;}
.cmh-cell.cmh-contracted:hover {background:#e8f1df;border-color:#8eae71;}
.cmh-contract-check {flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:#557826;color:#fff;font-size:11px;}
.cmh-contracted .cmh-attention {right:5px;bottom:5px;}

.cmh-contracted:has(.cmh-attention) {padding-right:25px;}

/* Final commercial states remain distinct from the lighter in-progress badges. */
.badge.status-accepted,
#quote-form select[name="status"]:has(option[value="accepted"]:checked) {
  background-color: #207345;
  color: #fff;
  font-weight: 700;
}
.badge.status-closed,
#prospect-form select[name="status"]:has(option[value="closed"]:checked) {
  background-color: #475569;
  color: #fff;
  font-weight: 700;
}
#quote-form select[name="status"] option,
#prospect-form select[name="status"] option {
  background-color: #fff;
  color: #30352d;
}

.badge.forecast-state-pending { background-color: #f4cd52; color: #4a3508; font-weight: 700; }
.badge.forecast-state-invoiced { background-color: #187347; color: #fff; font-weight: 700; }
.badge.forecast-state-cancelled { background-color: #b42332; color: #fff; font-weight: 700; }
.forecast-summary-state { font-weight: 700; }

/* Record identity is independent of its commercial status and environment. */
.dialog-head[data-record-kind] {
  --record-accent: #316b46;
  --record-tint: #edf6ee;
  background: var(--record-tint);
  border-top: 6px solid var(--record-accent);
  border-bottom: 1px solid color-mix(in srgb, var(--record-accent) 25%, #fff);
  gap: 12px;
}
.dialog-head[data-record-kind="prospect"] { --record-accent:#2563a6; --record-tint:#edf4fd; }
.dialog-head[data-record-kind="quote"] { --record-accent:#7c3ca6; --record-tint:#f5eefb; }
.dialog-head[data-record-kind="forecast"] { --record-accent:#a86708; --record-tint:#fff6e6; }
.dialog-head[data-record-kind="partner"] { --record-accent:#147c7a; --record-tint:#eaf7f5; }
.dialog-head[data-record-kind="commission"] { --record-accent:#147c7a; --record-tint:#eaf7f5; }
.dialog-head[data-record-kind="module"] { --record-accent:#52654a; --record-tint:#f0f4ec; }
.dialog-head .record-heading { flex:1; min-width:0; }
.dialog-head .record-heading h2 { overflow-wrap:anywhere; }
.record-concept { margin:5px 0 0; font-size:13px; line-height:1.4; color:#53604f; overflow-wrap:anywhere; }
.record-company-link { border:0; padding:0; background:none; color:inherit; font:inherit; text-align:left; text-decoration:underline; text-underline-offset:3px; }
.record-company-link:hover { background:none; color:var(--record-accent); }
.record-company-link:focus-visible { outline:2px solid var(--record-accent); outline-offset:3px; }
@media(max-width:650px) {
 .quote-head .record-heading { flex-basis:calc(100% - 55px); }
 .dialog-head[data-record-kind] { padding:14px 18px; }
}

html[data-development="true"] .dialog-head[data-record-kind] {
  background:var(--record-tint);
  border-bottom-color:color-mix(in srgb, var(--record-accent) 25%, #fff);
}

.badge.status-draft,
#quote-form select[name="status"]:has(option[value="draft"]:checked) {
  background-color: #b42332;
  color: #fff;
  font-weight: 700;
}
.badge.status-discarded,
#quote-form select[name="status"]:has(option[value="discarded"]:checked) {
  background-color: #f0a3a3;
  color: #761c27;
  font-weight: 700;
}
.forecast-summary-status select[data-state="pending"] {
  color: #4a3508;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4 3 3 3-3' fill='none' stroke='%234a3508' stroke-width='1.5'/%3E%3C/svg%3E");
}

.prospect-presence { display:inline-flex; align-items:center; justify-content:center; min-width:19px; height:19px; color:#87917f; font-size:13px; font-weight:600; }
.prospect-presence.has-records { border-radius:5px; background:#207345; color:#fff; font-size:14px; font-weight:800; }
.prospect-row-actions { display:flex; gap:7px; align-items:center; white-space:nowrap; }

.company-drive-label { font-size:12px; font-weight:600; color:#526487; margin-bottom:9px; }
.company-drive [data-drive-editor] { margin-top:12px; }

/* Annual goal: immediate, scrollable detail from the same weighted quotes. */
.billing-goal {position:relative;overflow:visible;}
.billing-goal-tooltip {bottom:auto;pointer-events:auto;box-sizing:border-box;}
.billing-goal-tooltip-sales {width:680px;max-width:calc(100% - 16px);padding:14px;z-index:20;}
.billing-goal-tooltip-sales>p {margin:5px 0 10px;font-size:12px;color:#e2e9dc;}
.billing-goal-sales-scroll {max-height:min(360px,45vh);overflow:auto;}
.billing-goal-tooltip-sales table {width:100%;font-size:12px;border-collapse:collapse;}
.billing-goal-tooltip-sales th,.billing-goal-tooltip-sales td {padding:8px 6px;background:#30372b;color:white;border-bottom:1px solid #65705d;text-align:right;white-space:nowrap;}
.billing-goal-tooltip-sales th:first-child,.billing-goal-tooltip-sales td:first-child {text-align:left;white-space:normal;min-width:90px;}
.billing-goal-tooltip-sales thead {position:sticky;top:0;}
.billing-goal-tooltip-sales tfoot {position:sticky;bottom:0;}
.billing-goal-tooltip-sales small {display:block;font-size:11px;color:#dce4d5;}
.billing-goal-legend [data-goal-sales]:focus-visible {outline:2px solid #507a19;outline-offset:4px;}

.quote-prospect-notes h3 {display:flex;align-items:center;gap:10px;flex-wrap:wrap;scroll-margin-top:110px;}
.quote-prospect-notes h3 .badge {font-size:11px;background:#eef0f4;color:#4c5668;}
.quote-prospect-notes>[data-action="open-source-prospect"] {margin:0 0 14px;}

.potential-prospect-links {display:flex;flex-direction:column;align-items:flex-start;gap:8px;}
.potential-note-archive {margin-top:16px;}
.potential-note-archive>summary {color:#5e6658;font-weight:600;}

/* The nested follow-up section needs the same spacing as surrounding sections. */
.potential-follow-up.section {padding:22px 0;}
.potential-follow-up>h3 {margin:0 0 12px;}
.potential-follow-up>p.help {margin:0 0 14px;}

/* Non-clickable context labels retain the company name in record headers. */
.access-context-label,.access-context-label:disabled {cursor:default;text-decoration:none;opacity:1;color:inherit;}
.user-menu-access .grid {row-gap:12px;margin-top:16px;}

/* Annual potential: one year by default, explicit split only when needed. */
.potential-billing-editor summary {font-weight:700;cursor:pointer;}
.potential-billing-editor[open]>summary {margin-bottom:12px;}
.potential-billing-editor>.help {margin:10px 0 14px;}
.potential-billing-single {display:flex;align-items:end;gap:12px;flex-wrap:wrap;}
.potential-billing-single>div {flex:1;min-width:180px;}
.potential-billing-single label {display:block;margin-bottom:8px;}
.potential-billing-single button {margin-bottom:0;}
.potential-billing-columns,.potential-billing-row {display:grid;grid-template-columns:minmax(140px,1fr) 110px 140px 36px;align-items:center;gap:12px;}
.potential-billing-columns {font-size:12px;font-weight:600;color:var(--muted);margin-bottom:8px;}
.potential-billing-row {margin-bottom:12px;}
.potential-billing-row>div {display:flex;align-items:center;gap:6px;}
.potential-billing-row input {min-width:0;width:100%;}
.potential-billing-row output {text-align:right;font-weight:600;}
.potential-billing-actions {margin-top:14px;}
.potential-billing-total {padding:10px 0 0;margin-bottom:0!important;}
.potential-billing-pending {color:#8b5a00;}
.billing-goal-unallocated {border-top:1px solid var(--line);margin-top:16px;padding-top:12px;font-size:12px;}
.billing-goal-unallocated>summary {font-weight:600;cursor:pointer;color:#855400;}
.billing-goal-unallocated>.help {margin:12px 0;}
.billing-goal-unallocated table {font-size:12px;}
.billing-goal-unallocated td {white-space:nowrap;}
.billing-goal-unallocated td:first-child {white-space:normal;}
@media(max-width:600px){.potential-billing-columns,.potential-billing-row {grid-template-columns:minmax(100px,1fr) 90px 100px 30px;gap:8px;}.potential-billing-columns {font-size:11px;}.potential-billing-row output {font-size:12px;}}
@media(max-width:420px){.potential-billing-columns {display:none;}.potential-billing-row {grid-template-columns:minmax(100px,1fr) 85px 28px;}.potential-billing-row output {grid-column:1 / 3;grid-row:2;text-align:left;}.potential-billing-row>button {grid-column:3;grid-row:1;}}

/* Navegacion anual compartida de KPIs: conserva entrada directa. */
.kpi-year-filter > label {display:block;min-width:0;font-size:12px;font-weight:600;color:#50617c;margin-bottom:8px;}
.kpi-year-navigation {display:flex;align-items:center;gap:4px;}
.kpi-year-navigation button {height:40px;min-width:36px;padding:6px 10px;}
.kpi-year-navigation button[data-year-step] {font-size:24px;line-height:1;}
.kpi-year-navigation button[data-year-current] {font-size:12px;margin-left:3px;}
.kpi-filter-row .kpi-year-navigation input {width:66px;min-width:0;text-align:center;padding:10px 4px;margin:0;appearance:textfield;}
.kpi-year-navigation input::-webkit-inner-spin-button,.kpi-year-navigation input::-webkit-outer-spin-button {appearance:none;margin:0;}

/* Plan anual: resultados, valoración y foto histórica son elementos distintos. */
.objectives-title,.objective-snapshot-title {display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;}
.objective-filters {display:flex;align-items:end;gap:16px;flex-wrap:wrap;padding:20px;margin-bottom:20px;}
.objective-filters>label {min-width:140px;margin:0;}
.objective-filters .kpi-year-navigation input {width:76px;text-align:center;}
.objective-summary {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px;}
.objective-summary button {text-align:left;padding:18px;background:white;border:1px solid var(--border);border-radius:12px;}
.objective-summary strong {display:block;font-size:26px;line-height:1.2;margin-bottom:8px;}
.objective-summary span {font-size:13px;color:var(--muted);}
.objective-group {margin-bottom:20px;}
.objective-table {min-width:850px;}
.objective-table td:first-child {max-width:330px;}
.objective-table .help {margin-top:7px;}
.objective-status.on_track,.objective-quarter.on_track {background:#e4f2eb;color:#215e3d;}
.objective-status.at_risk,.objective-quarter.at_risk {background:#ffe3a1;color:#664300;}
.objective-status.delayed,.objective-quarter.delayed {background:#b83239;color:white;}
.objective-status.achieved,.objective-quarter.achieved {background:#187347;color:white;}
.objective-status.draft {background:#e7edf6;color:#364968;}
.objective-quarters {display:flex;gap:4px;}
.objective-quarter {display:inline-flex;justify-content:center;align-items:center;min-width:29px;min-height:29px;font-size:11px;font-weight:700;border:0;border-radius:6px;padding:5px;}
.objective-quarter.empty {color:#8a9087;background:#f5f6f2;}
.objective-prose {white-space:pre-wrap;overflow-wrap:anywhere;}
.objective-history {padding:14px 0;border-top:1px solid var(--border);}
.objective-review-edit,.objective-review-snapshot {border:1px solid var(--border);border-radius:10px;padding:18px;margin:18px 0;}
.objective-review-edit>label {margin-bottom:10px;}
.objective-review-edit [data-objective-review-fields] {padding-top:12px;margin-top:12px;border-top:1px solid var(--border);}
.objective-review-edit [data-objective-review-fields]>label {margin-top:16px;}
.objective-review-edit [data-objective-review-fields][hidden],[data-objective-numeric][hidden],[data-objective-hitos][hidden],[data-objective-billing][hidden] {display:none;}
.objective-review-meta {display:flex;gap:12px;flex-wrap:wrap;margin-bottom:18px;font-size:13px;}
.objective-review-result {font-size:20px;}
.dialog-head[data-record-kind="objective"] {--record-accent:#5360a6;--record-tint:#f0f1fa;}
#objective-form .section>label {display:block;margin-top:16px;}
#objective-form .section .grid2 {margin-top:16px;}
@media(max-width:700px){.objective-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}.objective-summary button{padding:14px;}.objective-filters>label{flex:1 1 150px;}.objectives-title .actions{width:100%;}.objective-review-edit,.objective-review-snapshot{padding:12px;}.objective-snapshot-title h3{margin:0;}}
.objective-group>header,.objective-review-list>header {padding:18px 20px;border-bottom:1px solid var(--border);}
.objective-group>header h2,.objective-review-list>header h2 {font-size:18px;margin:0;}

/* El asunto identifica la iniciativa dentro de la ficha de prospeccion. */
.dialog-head[data-record-kind="prospect"] .record-concept {font-size:22px;font-weight:700;line-height:1.3;color:#234e7b;margin-top:8px;}
@media(max-width:600px){.dialog-head[data-record-kind="prospect"] .record-concept{font-size:20px;}}

.objective-status.good,.objective-quarter.good{background:#187347;color:white;}
.objective-status.regular,.objective-quarter.regular{background:#f4cd52;color:#4a3508;}
.objective-status.bad,.objective-quarter.bad{background:#b42332;color:white;}
#objective-review-form select[name^="state-"]:has(option[value="good"]:checked){background:#187347;color:white;font-weight:700;}
#objective-review-form select[name^="state-"]:has(option[value="regular"]:checked){background:#f4cd52;color:#4a3508;font-weight:700;}
#objective-review-form select[name^="state-"]:has(option[value="bad"]:checked){background:#b42332;color:white;font-weight:700;}
#objective-review-form select[name^="state-"] option{background:white;color:#30352d;}

/* Navegación y orden del plan anual. */
.objective-filters .kpi-year-navigation input{height:40px;min-height:40px;margin:0;padding:8px 4px;}
.objective-filters .kpi-year-navigation{align-items:center;}
.objective-filters .kpi-year-filter>label{display:block;margin:0 0 6px;}
.objective-order{display:flex;gap:4px;}
.objective-order button{padding:4px 9px;min-width:30px;}

#objective-form .section>label.check{display:flex;align-items:center;gap:8px;}
#objective-form .section>label.check input{margin:0;flex:none;}

#objective-form label.check{display:flex;align-items:center;column-gap:10px;}
#objective-form label.check>span{display:block;}
#objective-form label.check>input[type="checkbox"]{width:17px;height:17px;min-width:17px;margin:0;flex:0 0 17px;}
.objective-abandoned{background:#b42332;color:#fff;font-weight:700;}

.demo-kpis .prospect-mine{text-align:left;cursor:pointer;}
.demo-kpis .prospect-mine:hover{border-color:#729c38;}
.demo-kpis .prospect-mine:focus-visible{outline:2px solid #527c1b;outline-offset:3px;}

.demo-kpis .prospect-mine[aria-pressed="true"]{background:#edf4e4;border-color:#729c38;box-shadow:inset 0 0 0 1px #729c38;}

#agenda-filter .agenda-shortcut{font-size:12px;padding:7px 10px;min-height:34px;}
#agenda-filter .agenda-shortcut[aria-pressed="true"]{background:#edf4e4;border-color:#729c38;color:#365b15;}

.nnr-distribution{margin-top:16px;padding-top:14px;border-top:1px solid var(--border);}
.nnr-distribution>label.check{display:flex;align-items:center;gap:8px;margin:12px 0;}
.nnr-distribution .grid2{margin-top:12px;}
.nnr-legend{flex-wrap:wrap;gap:8px 14px;}
.nnr-legend>span{display:inline-flex;align-items:center;gap:5px;}
.nnr-segment{cursor:pointer;}
.nnr-segment:hover,.nnr-segment:focus{filter:brightness(.9);stroke:#30352d;stroke-width:1.5;outline:none;}
.nnr-tooltip{position:fixed;z-index:5000;max-width:300px;padding:9px 12px;border:1px solid #dfe4d7;border-radius:8px;background:white;box-shadow:0 4px 18px #0002;color:#30352d;font-size:13px;pointer-events:none;}

.objective-summary button.active{border:2px solid #547d20;background:#edf5e3;box-shadow:0 0 0 1px #547d20}.objective-responsibles{border:1px solid var(--line,#ddd);border-radius:8px;padding:12px;display:flex;flex-wrap:wrap;gap:12px}.objective-previous-challenges{flex-basis:100%;padding:10px 16px;background:#fff4d5;border-top:1px solid #dbbd68;max-height:25vh;overflow:auto;flex-shrink:0}.objective-previous-challenges .rich-content{font-size:13px}.objective-previous-challenges p{margin:4px 0}

.dialog-head:has(.objective-previous-challenges){flex-wrap:wrap;gap:10px}

.objective-review-edit>.check{display:flex;gap:8px;margin:16px 0 12px;align-items:center}

.objective-people-field{border:1px solid #cbd5e1;border-radius:7px;padding:6px;background:white}.objective-people-field select{border:0;min-height:32px;padding:4px}.objective-people label{display:block;margin-bottom:8px}.objective-people [data-objective-people]{display:flex;flex-wrap:wrap;gap:5px}.objective-person{display:inline-flex;align-items:center;gap:5px;background:#eaf0f8;border-radius:5px;padding:3px 7px;font-size:13px}.objective-person button{padding:0 3px;min-height:22px;border:0;background:transparent}.objective-status.achieved,.objective-quarter.achieved{background:#176a3c;color:white}

.objective-people-field{position:relative}.objective-people-field>input{border:0;box-shadow:none;min-height:32px;padding:5px}.objective-people-field [role=listbox]{position:absolute;top:100%;left:0;right:0;z-index:5;background:white;border:1px solid #b6c3d6;border-radius:6px;box-shadow:0 4px 12px #0002;max-height:220px;overflow:auto}.objective-people-field [role=option]{padding:9px 12px;cursor:pointer}.objective-people-field [role=option]:hover,.objective-people-field [aria-selected=true]{background:#e9eef8}.objective-status.achieved,.objective-quarter.achieved{background:#7135a5;color:white}.objective-summary{grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.objective-summary button{padding:12px}.objective-summary button[data-objective-summary=achieved].active{border-color:#7135a5;box-shadow:0 0 0 1px #7135a5;background:#f3eafa}@media(max-width:700px){.objective-summary{grid-template-columns:repeat(2,minmax(0,1fr));}}

/* Responsables: nombres y escritura comparten una sola fila de altura estándar. */
.objective-people-field{display:flex;align-items:center;gap:5px;flex-wrap:nowrap;min-height:40px;padding:4px 7px;box-sizing:border-box}
.objective-people-field [data-objective-people]{flex:0 1 auto;max-width:calc(100% - 100px);flex-wrap:nowrap;overflow-x:auto;min-width:0;align-items:center}
.objective-people-field .objective-person{flex-shrink:0;white-space:nowrap}
.objective-people-field>input{flex:1 1 100px;width:0;min-width:85px;height:30px;min-height:30px;margin:0;padding:3px;border:0;box-sizing:border-box}
#objective-review-form select[name^="state-"]:has(option[value="achieved"]:checked){background:#7135a5;color:white;font-weight:700;border-color:#7135a5;}

/* Compact commission work selector; secondary filters remain collapsible. */
.commission-quick { margin: 0 0 14px; flex-wrap: wrap; }
[data-commission-advanced] { margin-top: 12px; }
[data-commission-advanced] > summary { cursor: pointer; font-weight: 600; }
[data-commission-advanced] > .filters { margin-top: 12px; }

.company-module-followup > td { padding: 12px 18px 16px; background: #f8faf6; }
.cm-followup-meta { display:flex; flex-wrap:wrap; gap:8px 24px; font-size:12px; }
.company-module-followup p { margin:8px 0; }

.note-module-origin { border-left:4px solid #758091; padding:4px 8px; background:#f3f5f8; border-radius:3px; font-weight:600; }

/* The notes wrapper must not make the final section look like the form's first. */
[data-master-notes] > .section.record-notes { padding-top: 22px; }
/* Independent follow-up blocks keep the same spacing as company notes. */
[data-presence-notes] > .section.record-notes { padding-top:22px; }

/* Two compact tabs are part of the existing sticky record header. */
.dialog-head:has(> .company-record-tabs){flex-wrap:wrap;gap:12px; padding-bottom:0;}
.company-record-tabs{display:flex;gap:18px;flex-basis:100%;min-width:0;}
.company-record-tabs button{border:0;border-radius:0;background:transparent;padding:10px 0 12px;color:var(--muted);font-weight:650;border-bottom:3px solid transparent;}
.company-record-tabs button[aria-selected="true"]{color:#396b38;border-bottom-color:#6e9e3b;}
.company-record-tabs button:focus-visible{outline:2px solid #396b38;outline-offset:2px;}
[data-company-presence]>.section{padding-top:22px;}
/* Show formatting only while the editor, its tools or link popup has focus. */
.rich-editor > .rich-toolbar { display:none; }
.rich-editor:focus-within > .rich-toolbar { display:flex; }
/* Shared, compact disclosure for record and version histories. */
details.version-history.section {padding:0;margin-block:18px;border:1px solid #dce3d8;border-radius:8px;background:#fff;overflow:hidden;}
details.version-history > summary {position:relative;list-style:none;cursor:pointer;padding:12px 38px 12px 40px;background:#f5f7f3;color:#485541;font-size:13px;font-weight:650;line-height:1.4;}
details.version-history > summary::-webkit-details-marker {display:none;}
details.version-history > summary::before {content:"";position:absolute;left:14px;top:50%;width:16px;height:16px;transform:translateY(-50%);background:center/16px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2367795a' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11a9 9 0 1 1 2.6 7M3 5v6h6M12 7v5l3 2'/%3E%3C/svg%3E");}
details.version-history > summary::after {content:"\203A";position:absolute;right:15px;top:50%;transform:translateY(-50%);font-size:21px;font-weight:400;}
details.version-history[open] > summary {border-bottom:1px solid #dce3d8;}
details.version-history[open] > summary::after {transform:translateY(-50%) rotate(90deg);}
details.version-history > summary:hover {background:#eef2e9;}
details.version-history > summary:focus-visible {outline:2px solid #527b35;outline-offset:-3px;}
details.version-history > :not(summary) {margin:0;padding:14px 16px;}
details.version-history > div > .event:last-child {margin-bottom:0;}
