:root {
  --verde: #279d2e;
  --verde-dark: #1f7f27;
  --cyan: #25b4bd;
  --card: #ffffff;
  --surface: #f7fbf7;
  --borde: #e5ece8;
  --s1: #16a34a;
  --s2: #f59e0b;
  --s3: #f97316;
  --s4: #dc2626;
  --s5: #7f1d1d;
  --s6: #4b5563;
  --cero: #e5e7eb;
}

.prome-card .card-body {
  padding: 1.5rem;
}

.card-label {
  color: var(--color-gray-600);
}

.card-value {
  margin-top: auto;
  color: var(--color-green-700);
  font-size: 2.5rem;
  line-height: 1;
  text-align: left;
}

/* ==========================================
   Formulario
========================================== */

.form-label {
  font-weight: 700;
}

.form-text {
  color: var(--color-gray-400);
  font-size: .85rem;
}

.floating-outline {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
}

.floating-outline .form-control {
  height: 60px;
  border-radius: 999px;
  padding: 1.4rem 1.25rem 0.55rem;
  color: #374151;
  font-size: 1rem;
}

.floating-outline label {
  position: absolute;
  top: 0;
  left: 22px;
  transform: translateY(-50%);
  padding: 0 0.5rem;
  background: #ffffff;
  color: #25b4bd;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
  border-radius: 999px;
  ;
}

.floating-outline .form-control::placeholder {
  color: #9ca3af;
}

/* ==========================================
   Tarjetas resumen
========================================== */

.prome-highlight-card {
  background: var(--surface);
}

/* ==========================================
   Tablas
========================================== */

.prome-table {
  border: 1px solid var(--borde);
  border-radius: 16px;
  overflow: hidden;
}

.prome-table thead th {
  background: linear-gradient(90deg, #f5faf5, #eef8f1);
  color: var(--verde-dark);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--borde);
  vertical-align: middle;
}

.prome-table tbody td {
  vertical-align: middle;
  border-color: var(--borde);
}

.prome-table tbody tr:hover td {
  background: #fcfffc;
}

.text-end {
  font-variant-numeric: tabular-nums;
}

/* ==========================================
   Filas especiales
========================================== */

.total-row td {
  background: #f3fbf4 !important;
  border-top: 2px solid var(--verde);
  font-weight: 700;
}

.cero-row td {
  color: var(--muted);
  font-style: italic;
}

/* ==========================================
   Situaciones
========================================== */

.sit {
  display: inline-block;
  min-width: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.sit-0 {
  background: #d1d5db;
  color: #374151;
}

.sit-1 {
  background: linear-gradient(135deg, #16a34a, #15803d);
}

.sit-2 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.sit-3 {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.sit-4 {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.sit-5 {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
}

.sit-6 {
  background: linear-gradient(135deg, #4b5563, #374151);
}

/* ==========================================
   Badges
========================================== */

.badge-activo {
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
}

.badge-cero {
  background: #f3f4f6;
  color: #6b7280;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
}

.flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.flag {
  background: #fef3c7;
  color: #92400e;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ==========================================
   Gráfico
========================================== */

.chart-wrap {
  padding: 0.75rem;
  border: 1px solid var(--borde);
  border-radius: 16px;
  background: linear-gradient(180deg, #fcfffc, var(--surface));
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

.chart-wrap svg {
  display: block;
  margin: 0 auto;
  height: auto;
}

.chart-wrap::-webkit-scrollbar {
  height: 8px;
}

/* ==========================================
   Leyenda
========================================== */

.legend {
  font-size: 0.85rem;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
}

.legend .dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  margin-right: 0.4rem;
  flex-shrink: 0;
}

/* ==========================================
   Details
========================================== */

details {
  margin-top: 1rem;
}

summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--verde-dark);
  user-select: none;
}

summary:hover {
  color: var(--verde);
}

/* ==========================================
   Heatmap
========================================== */

.heatmap {
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 0.75rem;
}

.heatmap th {
  background: transparent;
  border: 0;
  padding: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  transform: rotate(-45deg);
  transform-origin: center;
  height: 70px;
  text-transform: none;
  letter-spacing: normal;
}

.heatmap th.rowh {
  transform: none;
  height: auto;
  color: var(--texto);
  font-weight: 700;
}

.heatmap .rowh {
  min-width: 320px;
  max-width: 320px;
  padding-right: 1.5rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: sticky;
  left: 0;
  z-index: 2;
}

.heatmap td {
  padding: 0;
  border: 0;
  width: 24px;
  height: 24px;
}

.cell {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: help;
}

.cell.activo-1,
.s1 {
  background: var(--s1);
}

.cell.activo-2,
.s2 {
  background: var(--s2);
}

.cell.activo-3,
.s3 {
  background: var(--s3);
}

.cell.activo-4,
.s4 {
  background: var(--s4);
}

.cell.activo-5,
.s5 {
  background: var(--s5);
}

.cell.activo-6,
.s6 {
  background: var(--s6);
}

.cell.cero,
.cero {
  background: repeating-linear-gradient(45deg,
      #e5e7eb,
      #e5e7eb 3px,
      #f9fafb 3px,
      #f9fafb 6px);

  border: 1px solid #d1d5db;
}

.cell.sin,
.sin-datos {
  background: #fff;
  border: 1px dashed #d1d5db;
}