:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #223047;
  background: #f4f6fa;
  font-size: 14px;
  font-synthesis: none;
  --blue: #275ade;
  --kpi-blue: #628de6;
  --kpi-planned: #b6cdf5;
  --kpi-estimated: #f4d978;
  --muted: #64748b;
  --border: #e2e7ef;
  --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;
}
.topbar {
  height: 70px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 36px;
  font-size: 12px;
  color: var(--muted);
}
.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);
}
.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.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: 15px 20px;
  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 .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: 18px;
}
.quote-company-field input[type="hidden"] {
  display: none;
}
.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 {
  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 {
  background: #f0f9f4;
  border-color: #b7d9c5;
  border-left: 4px solid #258054;
}
#quote-form .quote-acceptance-phase h3,
#forecast-form .forecast-invoice-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;
  }
  .topbar {
    padding: 0 20px;
  }
  .grid {
    gap: 14px;
  }
  th,
  td {
    padding: 13px;
  }
  .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;
  }
  .topbar {
    height: 48px;
    padding: 0 14px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .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: 14px 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 { 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-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-panel { padding:12px; background:#f4f8f6; border-top:1px solid #dce3df; }
.rich-link-panel[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-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;}
