/* Home Care 360 — estilos base con la identidad de Home Care Technology.
   Colores tomados del logo y del tema de hctortopedicos.com. */

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/open-sans-latin.woff2") format("woff2");
}

:root {
  --hct-azul: #004f72;
  --hct-azul-oscuro: #003a54;
  --hct-verde: #369e93;
  --hct-fondo-suave: #ecf5f5;
  --hct-borde: #c2d3da;
  --fondo: #fbfcff;
  --superficie: #ffffff;
  --texto: #1b2b33;
  --texto-suave: #55666e;
  --alerta: #8a5a00;
  --alerta-fondo: #fff4dc;
  --error: #9b2c2c;
  --error-fondo: #fdecec;
  --radio: 6px;
  --sombra: 0 1px 2px rgb(0 79 114 / 0.06), 0 8px 24px rgb(0 79 114 / 0.08);
  --fuente: "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.55;
  color: var(--texto);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  color: var(--hct-azul);
  text-wrap: balance;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

p {
  margin: 0;
}

a {
  color: var(--hct-azul);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--hct-verde);
  outline-offset: 2px;
}

/* ---------- Barra superior ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(16px, env(safe-area-inset-left));
  background: var(--superficie);
  border-bottom: 3px solid var(--hct-verde);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.topbar__brand img {
  height: 36px;
  width: auto;
}

.topbar__app {
  padding-left: 14px;
  border-left: 1px solid var(--hct-borde);
  font-weight: 600;
  color: var(--hct-azul);
  white-space: nowrap;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.92rem;
}

.topbar__user form {
  margin: 0;
}

.topbar__name {
  color: var(--texto-suave);
}

@media (max-width: 640px) {
  .topbar__brand img {
    height: 28px;
  }
  .topbar__app,
  .topbar__name {
    display: none;
  }
}

/* ---------- Contenido ---------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px max(16px, env(safe-area-inset-left)) 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--superficie);
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card--soft {
  background: var(--hct-fondo-suave);
  border-color: transparent;
}

.muted {
  color: var(--texto-suave);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chip {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--hct-fondo-suave);
  color: var(--hct-azul);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radio);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn--primary {
  background: var(--hct-azul);
  color: #fff;
}

.btn--primary:hover {
  background: var(--hct-azul-oscuro);
}

.btn--secondary {
  background: var(--superficie);
  border-color: var(--hct-borde);
  color: var(--hct-azul);
}

.btn--link {
  min-height: 0;
  padding: 0;
  background: none;
  color: var(--hct-azul);
  font-weight: 600;
  text-decoration: underline;
}

/* Botón de Google según sus pautas de marca: fondo blanco, borde gris, logo a color. */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid #747775;
  border-radius: var(--radio);
  color: #1f1f1f;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-google:hover {
  background: #f6f8f8;
}

.btn-google svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------- Mensajes ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radio);
  background: var(--hct-fondo-suave);
  color: var(--hct-azul);
  font-size: 0.95rem;
}

.alert--warn {
  background: var(--alerta-fondo);
  color: var(--alerta);
}

.alert--error {
  background: var(--error-fondo);
  color: var(--error);
}

.messages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Pantallas de ingreso ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background-color: var(--hct-fondo-suave);
  /* Trama de puntos verde agua; el centro se aclara (::before) y quedan las
     esquinas punteadas, como en el membrete de HCT. */
  background-image: radial-gradient(circle, rgb(54 158 147 / 0.35) 1.6px, transparent 2px);
  background-size: 14px 14px;
}

.auth::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    var(--hct-fondo-suave) 55%,
    rgb(236 245 245 / 0) 100%
  );
}

.auth__card {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 40px 32px 32px;
  background: var(--superficie);
  border-radius: 10px;
  box-shadow: var(--sombra);
  border-top: 4px solid var(--hct-azul);
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.auth__logo {
  width: 220px;
  max-width: 80%;
  height: auto;
  margin: 0 auto 4px;
}

.auth__title {
  font-size: 1.4rem;
}

.auth__lead {
  color: var(--texto-suave);
  margin-top: -12px;
}

.auth__note {
  font-size: 0.85rem;
  color: var(--texto-suave);
}

.auth__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth__footer {
  padding-top: 16px;
  border-top: 1px solid var(--hct-borde);
  font-size: 0.8rem;
  color: var(--texto-suave);
}

/* ---------- Navegación principal ---------- */
.topbar__nav {
  display: flex;
  gap: 4px;
  margin-right: auto;
  margin-left: 24px;
}

.topbar__nav a {
  padding: 6px 12px;
  border-radius: var(--radio);
  color: var(--texto);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}

.topbar__nav a:hover,
.topbar__nav a[aria-current="page"] {
  background: var(--hct-fondo-suave);
  color: var(--hct-azul);
}

/* ---------- Encabezado de página ---------- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}

.page-head__title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.back-link {
  font-size: 0.9rem;
  color: var(--texto-suave);
}

/* ---------- Etiquetas ---------- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--hct-fondo-suave);
  color: var(--hct-azul);
  white-space: nowrap;
}

.badge--warn {
  background: var(--alerta-fondo);
  color: var(--alerta);
}

.badge--ok {
  background: #e3f2ef;
  color: #1f6b62;
}

/* ---------- Búsqueda ---------- */
.search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.search input[type="search"] {
  flex: 1 1 280px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}

/* ---------- Tablas ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  background: var(--superficie);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

table.data th,
table.data td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--hct-borde);
  vertical-align: top;
}

table.data th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texto-suave);
  background: var(--fondo);
}

table.data tr:last-child td {
  border-bottom: 0;
}

table.data a {
  font-weight: 600;
  text-decoration: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--texto-suave);
}

/* ---------- Formularios ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form fieldset {
  margin: 0;
  padding: 20px 24px 24px;
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  background: var(--superficie);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 20px;
}

.form legend {
  padding: 0 6px;
  font-weight: 700;
  color: var(--hct-azul);
}

.form .full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label,
.field .label {
  font-size: 0.88rem;
  font-weight: 600;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="search"],
.field select,
.field textarea,
.search input[type="search"] {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  background: #fff;
  font: inherit;
  color: var(--texto);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search input:focus {
  outline: 2px solid var(--hct-verde);
  outline-offset: 1px;
  border-color: var(--hct-verde);
}

.field .help {
  font-size: 0.8rem;
  color: var(--texto-suave);
}

.field .error,
.errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--error);
  font-weight: 600;
}

.field--invalid input,
.field--invalid select {
  border-color: var(--error);
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.choices label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.choices > div,
.choices ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.form__actions {
  display: flex;
  gap: 12px;
}

/* Persona o empresa: se muestra solo lo que aplica (sin JavaScript). */
.customer-form:has(input[name="kind"][value="Company"]:checked) .only-person,
.customer-form:has(input[name="kind"][value="Person"]:checked) .only-company,
.customer-form:not(:has(select[name="id_type"] option[value="31"]:checked)) .only-nit {
  display: none;
}

/* ---------- Ficha ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  margin: 0;
  font-size: 0.95rem;
}

.facts dt {
  color: var(--texto-suave);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline > li {
  padding-left: 16px;
  border-left: 3px solid var(--hct-fondo-suave);
  font-size: 0.92rem;
}

.timeline .when {
  color: var(--texto-suave);
  font-size: 0.85rem;
}

.timeline ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* ---------- Pedidos ---------- */
.badge--muted {
  background: #eef1f3;
  color: var(--texto-suave);
}

.badge--error {
  background: var(--error-fondo);
  color: var(--error);
}

.btn--danger {
  background: var(--superficie);
  border-color: #e3b4b4;
  color: var(--error);
}

.btn--danger:hover {
  background: var(--error-fondo);
}

.btn--small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.85rem;
}

.select-inline {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  background: #fff;
  font: inherit;
}

.actions-card {
  border-left: 4px solid var(--hct-verde);
}

.next-step {
  margin: 0 0 12px;
  font-size: 1.02rem;
}

/* Barra de pasos del pedido: hechos en verde, el actual en azul, los que faltan en gris. */
.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  counter-reset: paso;
}

.stepper__step {
  counter-increment: paso;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--hct-borde);
  border-radius: 999px;
  background: var(--superficie);
  color: var(--texto-suave);
  font-size: 0.82rem;
}

.stepper__step::before {
  content: counter(paso);
  display: inline-block;
  min-width: 1.4em;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--hct-fondo-suave);
  text-align: center;
  font-weight: 700;
}

.stepper__step--done {
  border-color: var(--hct-verde);
  color: var(--hct-verde);
}

.stepper__step--done::before {
  content: "✓";
  background: var(--hct-verde);
  color: #fff;
}

.stepper__step--current {
  border-color: var(--hct-azul);
  background: var(--hct-azul);
  color: #fff;
  font-weight: 700;
}

.stepper__step--current::before {
  background: #fff;
  color: var(--hct-azul);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
}

.action-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.action-form input[type="text"] {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  font: inherit;
  min-width: 220px;
}

.inline-actions {
  display: flex;
  gap: 6px;
  margin: 0;
}

.lines-table td {
  vertical-align: top;
}

.lines-table input[type="text"],
.lines-table input[type="number"] {
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  font: inherit;
}

.lines-table td:first-child {
  min-width: 320px;
}

.total-row td {
  background: var(--hct-fondo-suave);
}

/* ---------- Bandejas y tablero ---------- */
.count {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hct-azul);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  vertical-align: middle;
}

.topbar__nav {
  overflow-x: auto;
  scrollbar-width: none;
}

.small {
  font-size: 0.85rem;
}

.error-text {
  color: var(--error);
  font-weight: 600;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.board__column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radio);
  background: var(--hct-fondo-suave);
  min-height: 160px;
}

.board__column h2 {
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.board__card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  background: var(--superficie);
  font-size: 0.92rem;
}

.board__card--stuck {
  border-color: #e3b4b4;
  border-left: 4px solid var(--error);
}

.board__card--hold {
  background: #fff8f8;
}

.board__card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.board__card-head a {
  text-decoration: none;
}

.board__lines {
  margin: 2px 0;
  padding-left: 18px;
  font-size: 0.85rem;
}

.board__lines li + li {
  margin-top: 4px;
}

.board__notes {
  margin: 4px 0;
  padding: 4px 8px;
  border-radius: var(--radio);
  background: var(--alerta-fondo);
  color: var(--alerta);
}

.board__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.board__actions form {
  margin: 0;
}

/* ---------- Último precio facturado ---------- */
.price-history {
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: var(--radio);
  background: var(--hct-fondo-suave);
}

.price-history h3 {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.price-history table.data {
  background: var(--superficie);
}

/* Inicio: accesos a cada bandeja con cuántas cosas esperan. */
.home-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.home-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  background: var(--superficie);
  color: var(--texto);
  text-decoration: none;
  box-shadow: var(--sombra);
}

.home-tile:hover,
.home-tile:focus-visible {
  border-color: var(--hct-verde);
}

.home-tile strong {
  color: var(--hct-azul);
}

.home-tile span {
  color: var(--texto-suave);
  font-size: 0.85rem;
}

.home-tile .home-tile__count {
  color: var(--hct-azul);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
}

.home-tile--primary {
  background: var(--hct-azul);
  border-color: var(--hct-azul);
}

.home-tile--primary strong,
.home-tile--primary span {
  color: #fff;
}

/* Precio de referencia debajo del producto y últimas compras del cliente. */
.price-hint {
  min-height: 1.2em;
  margin-top: 4px;
}

.purchases summary {
  cursor: pointer;
  color: var(--hct-azul);
}

.purchases ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--texto-suave);
  font-size: 0.88rem;
}

/* Pedido paso a paso: secciones plegables («fold») que muestran abierto solo lo que toca. */
.fold > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  cursor: pointer;
  list-style: none;
}

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

.fold > summary::before {
  content: "▸";
  color: var(--hct-verde);
  font-weight: 700;
}

.fold[open] > summary::before {
  content: "▾";
}

.fold > summary h2 {
  display: inline;
  margin: 0;
}

.fold[open] > summary {
  margin-bottom: 12px;
}

.page-head__sub {
  display: block;
  color: var(--texto-suave);
  font-size: 1rem;
  font-weight: 600;
}

.action-note > summary {
  list-style: none;
  cursor: pointer;
}

.action-note > summary::-webkit-details-marker {
  display: none;
}

.action-note[open] > summary {
  margin-bottom: 8px;
}

/* Confirmar: los datos del pago aparecen solo si el cliente pagó todo o un anticipo. */
.confirm-form:not(:has(input[name="paid"][value="todo"]:checked, input[name="paid"][value="anticipo"]:checked)) .confirm-form__payment {
  display: none;
}

.choices--big label {
  display: block;
  margin: 6px 0;
  padding: 10px 14px;
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  background: var(--superficie);
  cursor: pointer;
}

.choices--big label:has(input:checked) {
  border-color: var(--hct-azul);
  background: var(--hct-fondo-suave);
  font-weight: 600;
}

.summary-lines {
  margin: 0 0 8px;
  padding-left: 18px;
}

.summary-total {
  margin: 0;
  font-size: 1.1rem;
}

.board__help {
  margin: -4px 0 10px;
  color: var(--texto-suave);
  font-size: 0.8rem;
  line-height: 1.35;
}

.nowrap {
  white-space: nowrap;
}

/* Aviso de pedido posiblemente repetido */
.duplicates ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.duplicates li { margin: 0.15rem 0; }

/* Inicio por rol: avisos, cifras y barras (apps/core/dashboards.py). */
.dash {
  margin: 0 0 20px;
  padding: 18px 20px;
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  background: var(--hct-fondo-suave);
}

.dash__title {
  margin-bottom: 12px;
  font-size: 1.25rem;
}

.dash-alerts {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.dash-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radio);
  background: var(--superficie);
  border: 1px solid var(--hct-borde);
}

.dash-alert--bad {
  background: var(--error-fondo);
  border-color: transparent;
}

.dash-alert--warn {
  background: var(--alerta-fondo);
  border-color: transparent;
}

.dash-alert__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hct-verde);
}

.dash-alert--bad .dash-alert__dot {
  background: var(--error);
}

.dash-alert--warn .dash-alert__dot {
  background: var(--alerta);
}

.dash-alert a {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5em, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  background: var(--superficie);
  color: var(--texto);
  text-decoration: none;
}

a.kpi:hover,
a.kpi:focus-visible {
  border-color: var(--hct-verde);
}

.kpi__l {
  color: var(--texto-suave);
  font-size: 0.9rem;
}

.kpi__v {
  color: var(--hct-azul);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.kpi__d {
  color: var(--texto-suave);
  font-size: 0.82rem;
}

.kpi__d--down {
  color: var(--error);
}

.kpi__d--warn {
  color: var(--alerta);
}

.kpi__d--up {
  color: #1d7a4f;
}

.dash-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.dash-chart {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  background: var(--superficie);
}

.dash-chart figcaption {
  margin-bottom: 12px;
}

.dash-chart figcaption strong {
  display: block;
  color: var(--texto);
}

.dash-chart figcaption span {
  color: var(--texto-suave);
  font-size: 0.85rem;
}

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

.bars__row {
  display: grid;
  grid-template-columns: minmax(7em, 12em) minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  font-size: 0.92rem;
}

.bars__label small {
  display: block;
  color: var(--texto-suave);
  font-size: 0.8rem;
}

.bars__track {
  position: relative;
  height: 14px;
  border-radius: 4px;
  background: rgb(0 79 114 / 0.08);
}

.bars__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 4px;
  background: var(--hct-azul);
}

.bars__fill--b {
  background: var(--hct-verde);
}

.bars__fill--w {
  background: #c98a1a;
}

.bars__fill--r {
  background: var(--error);
}

.bars__fill--q {
  background: var(--hct-borde);
}

.bars__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.dash-table {
  margin-bottom: 10px;
}

.dash-table h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

table.data .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.card__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

@media (max-width: 640px) {
  .dash {
    padding: 14px;
  }

  .dash-alert {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .dash-alert a {
    grid-column: 2;
  }

  .bars__row {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .bars__track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.bars__mark {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--texto);
}

table.goals input {
  width: 100%;
  max-width: 14em;
  padding: 7px 10px;
  border: 1px solid var(--hct-borde);
  border-radius: var(--radio);
  font: inherit;
  text-align: right;
}

/* Cartera: sugerencia de nota crédito sin relación */
.suggestion {
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: var(--radio);
  background: var(--alerta-fondo);
}

.suggestion form {
  display: inline-block;
  margin-left: 6px;
}