/* ═══════════════════════════════════════════
   DASHBOARD — Métricas · Gráficas · Feeds
   Diseño: Premium Minimalist SaaS
═══════════════════════════════════════════ */

/* ── Donut premium ───────────────────────── */
.donut-wrap {
  position: relative;
  flex-shrink: 0;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  gap: 2px;
}

.donut-total {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.donut-label {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.donut-legend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  cursor: default;
  padding: 3px 0;
  transition: color var(--transition-fast);
}
.donut-legend-item:hover { color: var(--color-text); }

.donut-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-legend-count {
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

/* ── Timeline (mini Gantt) ───────────────── */
.timeline-container {
  overflow-x: auto;
  position: relative;
}

.timeline-header {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-2);
}

.timeline-label-col {
  width: 220px;
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-2) var(--space-3);
}

.timeline-months-row {
  display: flex;
  flex: 1;
}

.timeline-month-cell {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-subtle);
  text-align: center;
  padding: var(--space-2) 0;
  border-left: 1px solid var(--color-border);
  letter-spacing: 0.02em;
}

.timeline-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-border-subtle);
  min-height: 40px;
  transition: background var(--transition-fast);
}
.timeline-row:hover { background: var(--color-surface-alt); }
.timeline-row:last-child { border-bottom: none; }

.timeline-project-name {
  width: 220px;
  flex-shrink: 0;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.005em;
}

.timeline-chart-area {
  flex: 1;
  position: relative;
  height: 40px;
  padding: 8px 0;
}

.timeline-grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-border-subtle);
}

.timeline-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary-glow);
  z-index: 2;
}

.timeline-bar {
  position: absolute;
  top: 8px;
  height: 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  display: flex;
  align-items: center;
}
.timeline-bar:hover { opacity: 0.85; transform: scaleY(1.05); }

.timeline-bar-progress {
  height: 100%;
  background: rgba(0,0,0,0.25);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.timeline-bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 var(--space-2);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  color: rgba(255,255,255,0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.timeline-empty {
  text-align: center;
  padding: var(--space-8);
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
}

/* ── Sección ─────────────────────────────── */
.dash-section {
  margin-bottom: var(--space-6);
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.dash-section-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Tarjetas de métricas ────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

@media (max-width: 1280px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width:  640px) { .metric-grid { grid-template-columns: 1fr; } }

.metric-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  overflow: hidden;
  transition:
    box-shadow var(--transition-base),
    border-color var(--transition-base),
    transform var(--transition-base);
}

.metric-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
  transform: translateY(-1px);
}

/* Franja de color superior — más fina y elegante */
.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--metric-color, var(--color-primary));
  opacity: 0.85;
}

/* Punto decorativo en esquina */
.metric-card::after {
  content: '';
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--metric-color, var(--color-primary));
  opacity: 0.08;
}

.metric-card.metric-primary  { --metric-color: var(--color-primary); }
.metric-card.metric-warning  { --metric-color: var(--color-warning); }
.metric-card.metric-danger   { --metric-color: var(--color-danger); }
.metric-card.metric-success  { --metric-color: var(--color-success); }

.metric-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1;
  padding-top: var(--space-1);
  padding-right: 36px; /* espacio para el punto decorativo */
}

.metric-value {
  font-size: 38px;
  font-weight: var(--weight-bold);
  color: var(--color-text);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.metric-trend {
  font-size: var(--text-xs);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  width: fit-content;
  font-weight: var(--weight-medium);
  letter-spacing: 0.01em;
}

.metric-trend.up      { color: var(--color-success-fg); background: var(--color-success-light); }
.metric-trend.down    { color: var(--color-danger-fg);  background: var(--color-danger-light);  }
.metric-trend.neutral { color: var(--color-text-muted); background: var(--color-surface-alt);   }

/* Skeleton de métricas */
.metric-card.loading .metric-value { @extend .skeleton; width: 64px; height: 36px; }
.metric-card.loading .metric-label { @extend .skeleton; width: 120px; height: 12px; }

/* ── Grid de gráficas ────────────────────── */
.chart-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.chart-grid-3 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
}

.chart-grid-4 {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(260px, .9fr) minmax(360px, 1.2fr);
  gap: var(--space-4);
}

/* Aprovecha el ancho de escritorio sin convertir listas en tarjetas gigantes. */
@media (min-width: 1281px) {
  .chart-grid-4 .chart-card { min-width: 0; }
  .chart-grid-4 .chart-card.chart-wide { grid-column: span 1; }
  .project-progress-list, .deadline-list, .workload-list, .activity-feed { min-height: 248px; }
  .workload-list, .activity-feed { max-height: 360px; }
}

@media (min-width: 1600px) {
  .chart-grid-4 { grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr) minmax(460px, 1.35fr); }
}

@media (max-width: 1280px) {
  .chart-grid-2,
  .chart-grid-3,
  .chart-grid-4 { grid-template-columns: 1fr; }
}

/* Card de gráfica */
.chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: box-shadow var(--transition-base);
  overflow: visible;
}

.chart-card:hover { box-shadow: var(--shadow-sm); }

.chart-card.chart-wide { grid-column: span 2; }
@media (max-width: 1280px) {
  .chart-card.chart-wide { grid-column: span 1; }
}

.chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.chart-card-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
  color: var(--color-text);
  line-height: var(--leading-snug);
}

.chart-card-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin-top: 3px;
  line-height: var(--leading-normal);
}

/* Contenedores estables para Chart.js */
.chart-container,
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
  min-height: 300px;
}

.chart-container.chart-sm {
  height: 220px;
  min-height: 220px;
}

.chart-container.chart-lg {
  height: 320px;
  min-height: 320px;
}

.chart-container canvas,
.chart-wrapper canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.chart-donut-layout {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: 260px;
}

.chart-donut-wrapper {
  position: relative;
  width: 260px;
  height: 260px;
  min-width: 260px;
  min-height: 260px;
  max-width: 260px;
  max-height: 260px;
  flex: 0 0 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-donut-wrapper canvas {
  display: block;
  width: 220px !important;
  height: 220px !important;
  max-width: 220px;
  max-height: 220px;
}

.chart-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
  text-align: center;
  text-wrap: balance;
  z-index: 2;
}

@media (max-width: 767px) {
  .chart-container,
  .chart-wrapper {
    height: 260px;
    min-height: 260px;
  }

  .chart-container.chart-lg {
    height: 300px;
    min-height: 300px;
  }

  .chart-donut-layout {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
  }

  .chart-donut-wrapper {
    width: 220px;
    height: 220px;
    min-width: 220px;
    min-height: 220px;
    max-width: 220px;
    max-height: 220px;
    flex-basis: 220px;
    margin: 0 auto;
  }

  .chart-donut-wrapper canvas {
    width: 190px !important;
    height: 190px !important;
    max-width: 190px;
    max-height: 190px;
  }
}

/* ── Skeleton ────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-alt) 25%,
    var(--color-surface-raised) 50%,
    var(--color-surface-alt) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position:   0% 50%; }
}

/* ── Mapa de calor ───────────────────────── */
.heatmap-wrapper { overflow-x: auto; padding-bottom: var(--space-2); }

.heatmap-grid { display: flex; gap: 3px; }

.heatmap-col { display: flex; flex-direction: column; gap: 3px; }

.heatmap-cell {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-subtle);
  cursor: default;
  transition: opacity 0.1s, transform 0.1s;
}
.heatmap-cell:hover { opacity: 0.75; transform: scale(1.15); }

/* Niveles de actividad — escala verde esmeralda sobre dark */
.heatmap-cell[data-level="1"] { background: rgba(66,199,244,0.26); border-color: rgba(66,199,244,0.20); }
.heatmap-cell[data-level="2"] { background: rgba(66,199,244,0.48); border-color: rgba(66,199,244,0.30); }
.heatmap-cell[data-level="3"] { background: rgba(66,199,244,0.78); border-color: rgba(66,199,244,0.42); }
.heatmap-cell[data-level="4"] { background: var(--color-primary); box-shadow: 0 0 5px var(--color-primary-glow); }

.heatmap-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  padding: var(--space-5);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
  text-align: center;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin-top: var(--space-3);
}

.heatmap-legend-cells {
  display: flex;
  gap: 3px;
}

.heatmap-legend-cell {
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

/* ── Feed de actividad ───────────────────── */
/* Heatmap ejecutivo — overrides estables */
.heatmap-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 280px;
  height: 100%;
}

.heatmap-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 0%, rgba(66, 199, 244, 0.10), transparent 42%),
    var(--color-surface-alt);
}

.heatmap-grid-shell {
  display: flex;
  justify-content: center;
  width: 100%;
  overflow-x: auto;
  padding: var(--space-1) 0;
}

.heatmap-grid-wrap {
  width: fit-content;
  min-width: min(100%, 520px);
}

.heatmap-grid {
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.heatmap-col {
  gap: 5px;
}

.heatmap-cell {
  width: clamp(14px, 1.05vw, 18px);
  height: clamp(14px, 1.05vw, 18px);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  transition: opacity var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.heatmap-cell:hover {
  opacity: 0.92;
  transform: scale(1.16);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

.heatmap-empty {
  flex-direction: column;
  gap: var(--space-2);
  min-height: 260px;
  padding: var(--space-8);
  border-radius: var(--radius-lg);
}

.heatmap-empty-title {
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.heatmap-empty-copy {
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
  max-width: 280px;
}

.heatmap-legend {
  justify-content: flex-end;
  width: min(100%, 520px);
  margin-top: 0;
}

.heatmap-legend-cells {
  gap: 4px;
}

.heatmap-legend-cell {
  width: 13px;
  height: 13px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
}

.heatmap-legend-cell[data-level="1"] { background: rgba(66,199,244,0.26); border-color: rgba(66,199,244,0.20); }
.heatmap-legend-cell[data-level="2"] { background: rgba(66,199,244,0.48); border-color: rgba(66,199,244,0.30); }
.heatmap-legend-cell[data-level="3"] { background: rgba(66,199,244,0.78); border-color: rgba(66,199,244,0.42); }
.heatmap-legend-cell[data-level="4"] { background: var(--color-primary); box-shadow: 0 0 5px var(--color-primary-glow); }

.heatmap-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}

.activity-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.heatmap-summary-item {
  padding: var(--space-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  min-width: 0;
  overflow: hidden;
}

.heatmap-summary-label {
  color: var(--color-text-subtle);
  font-size: 10px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heatmap-summary-value {
  margin-top: var(--space-1);
  color: var(--color-text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1400px) {
  .activity-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1366px) {
  .heatmap-panel { min-height: 260px; }
  .heatmap-main { padding: var(--space-3); }
  .heatmap-grid,
  .heatmap-col { gap: 4px; }
  .heatmap-cell {
    width: 13px;
    height: 13px;
  }
  .activity-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .heatmap-cell {
    width: 15px;
    height: 15px;
  }
}

@media (max-width: 767px) {
  .heatmap-grid-shell {
    justify-content: flex-start;
  }
  .heatmap-legend {
    width: 100%;
  }
  .heatmap-summary,
  .activity-summary-grid {
    grid-template-columns: 1fr;
  }
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 340px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.activity-item:hover { background: var(--color-surface-alt); }

.activity-avatar {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  color: white;
  flex-shrink: 0;
  margin-top: 1px;
}

.activity-body { flex: 1; min-width: 0; }

.activity-text {
  font-size: var(--text-xs);
  color: var(--color-text);
  line-height: 1.5;
}

.activity-text strong { font-weight: var(--weight-semibold); }

.activity-meta {
  font-size: 11px;
  color: var(--color-text-subtle);
  margin-top: 2px;
  letter-spacing: 0.01em;
}

.activity-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--weight-medium);
  background: var(--color-primary-light);
  color: var(--color-primary);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* ── Progreso de proyectos ───────────────── */
.project-progress-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.project-progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.project-progress-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
  letter-spacing: -0.005em;
}

.project-progress-pct {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Barra de progreso específica del dashboard */
.progress-bar {
  height: 4px;
  background: var(--color-surface-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  transition: width 0.7s var(--ease-out);
}

/* ── Tabla de proyectos (dashboard) ─────── */
.projects-table-wrapper { overflow-x: auto; }

.projects-table { width: 100%; border-collapse: collapse; }

.projects-table th {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: var(--space-2) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.projects-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
  vertical-align: middle;
}

.projects-table tr:last-child td { border-bottom: none; }
.projects-table tr:hover td {
  background: var(--color-primary-subtle);
  cursor: pointer;
}

.project-color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--color-border);
}

/* ── Vencimientos próximos ───────────────── */
.deadline-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.deadline-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.deadline-item:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-border-strong);
}

.deadline-date {
  text-align: center;
  min-width: 34px;
  flex-shrink: 0;
}

.deadline-date .day {
  font-size: 18px;
  font-weight: var(--weight-bold);
  line-height: 1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.deadline-date .month {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  letter-spacing: 0.06em;
  margin-top: 1px;
  display: block;
}

.deadline-info      { flex: 1; min-width: 0; }

.deadline-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
}

.deadline-project {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin-top: 2px;
}

.deadline-overdue {
  border-color: var(--color-danger-light);
  background: var(--color-danger-light);
}
.deadline-overdue:hover  { background: var(--color-danger-light); border-color: var(--color-danger); }
.deadline-overdue .deadline-date .day   { color: var(--color-danger); }
.deadline-overdue .deadline-date .month { color: var(--color-danger-fg); }

/* ── Carga de trabajo ────────────────────── */
.workload-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.workload-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.workload-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 120px;
}

.workload-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
}

.workload-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.workload-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.workload-bar-label {
  font-size: 10px;
  color: var(--color-text-subtle);
  width: 40px;
  text-align: right;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.workload-bar-track {
  flex: 1;
  height: 4px;
  background: var(--color-surface-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.workload-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s var(--ease-out);
}

.workload-bar-fill.active  { background: var(--color-primary); }
.workload-bar-fill.overdue { background: var(--color-danger); }

.workload-count {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  min-width: 22px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Select de período ───────────────────── */
.period-select {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}
.period-select:hover { border-color: var(--color-border-strong); }
/* ── Domo executive dashboard overrides ────────────────────────────────── */
.metric-card,
.chart-card,
.deadline-card,
.timeline-mini-card {
  background:
    linear-gradient(180deg, rgba(66,199,244,0.035), transparent 34%),
    var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.metric-card:hover,
.chart-card:hover,
.deadline-card:hover {
  border-color: var(--color-primary-border);
  box-shadow: var(--shadow-lg), 0 0 24px rgba(66,199,244,0.055);
}

.metric-icon {
  background: linear-gradient(180deg, rgba(66,199,244,0.16), rgba(1,77,164,0.12));
  border: 1px solid var(--color-primary-border);
  color: var(--accent-300);
}

.metric-value {
  color: var(--color-text);
  text-shadow: 0 0 24px rgba(66,199,244,0.08);
}

.chart-card-title::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent-400);
  box-shadow: 0 0 12px rgba(66,199,244,0.5);
  vertical-align: 1px;
}

.chart-empty-state,
.heatmap-empty {
  background:
    radial-gradient(circle at 50% 0%, rgba(66,199,244,0.12), transparent 42%),
    var(--color-surface-alt);
}

.heatmap-main {
  border-color: var(--color-primary-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.heatmap-summary-item {
  background: linear-gradient(180deg, rgba(66,199,244,0.07), rgba(1,77,164,0.04));
  border-color: var(--color-border-strong);
}

/* Heatmap premium layout */
.heatmap-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--space-4);
  min-height: 300px;
  height: 100%;
}

.heatmap-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-5);
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 0%, rgba(66, 199, 244, 0.10), transparent 42%),
    var(--color-surface-alt);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.heatmap-grid-shell {
  display: flex;
  justify-content: center;
  width: 100%;
  overflow-x: auto;
  padding: var(--space-1) var(--space-1) var(--space-2);
  scrollbar-width: thin;
}

.heatmap-grid-wrap {
  --heatmap-cell: clamp(16px, 1.25vw, 18px);
  --heatmap-gap: clamp(4px, 0.35vw, 6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  max-width: 100%;
}

.heatmap-month-labels {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--heatmap-cell);
  gap: var(--heatmap-gap);
  width: fit-content;
  margin-bottom: var(--space-2);
  color: var(--color-text-subtle);
  font-size: 10px;
  line-height: 1;
  text-transform: capitalize;
}

.heatmap-month-labels span {
  min-height: 10px;
  white-space: nowrap;
}

.heatmap-grid {
  display: flex;
  justify-content: center;
  gap: var(--heatmap-gap);
  width: fit-content;
}

.heatmap-col {
  display: flex;
  flex-direction: column;
  gap: var(--heatmap-gap);
}

.heatmap-cell {
  width: var(--heatmap-cell);
  height: var(--heatmap-cell);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  cursor: default;
  transition: opacity var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.heatmap-cell:hover {
  opacity: 0.92;
  transform: scale(1.16);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

.heatmap-cell[data-level="1"] { background: rgba(66,199,244,0.26); border-color: rgba(66,199,244,0.20); }
.heatmap-cell[data-level="2"] { background: rgba(66,199,244,0.48); border-color: rgba(66,199,244,0.30); }
.heatmap-cell[data-level="3"] { background: rgba(66,199,244,0.78); border-color: rgba(66,199,244,0.42); }
.heatmap-cell[data-level="4"] { background: var(--color-primary); box-shadow: 0 0 5px var(--color-primary-glow); }

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  width: min(100%, 340px);
  margin-top: 0;
  color: var(--color-text-subtle);
  font-size: var(--text-xs);
}

.heatmap-legend-cells {
  display: flex;
  gap: 4px;
}

.heatmap-legend-cell {
  width: 13px;
  height: 13px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
}

.heatmap-legend-cell[data-level="1"] { background: rgba(66,199,244,0.26); border-color: rgba(66,199,244,0.20); }
.heatmap-legend-cell[data-level="2"] { background: rgba(66,199,244,0.48); border-color: rgba(66,199,244,0.30); }
.heatmap-legend-cell[data-level="3"] { background: rgba(66,199,244,0.78); border-color: rgba(66,199,244,0.42); }
.heatmap-legend-cell[data-level="4"] { background: var(--color-primary); box-shadow: 0 0 5px var(--color-primary-glow); }

.heatmap-summary,
.activity-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.heatmap-summary-item {
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(66,199,244,0.07), rgba(1,77,164,0.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  overflow: visible;
}

.heatmap-summary-label {
  color: var(--color-text-subtle);
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.25;
  min-height: 36px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: normal;
  text-wrap: balance;
}

.heatmap-summary-value {
  margin-top: var(--space-2);
  color: var(--color-text);
  font-size: clamp(16px, 1.15vw, 20px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.heatmap-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 260px;
  padding: var(--space-8);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 0%, rgba(66,199,244,0.12), transparent 42%),
    var(--color-surface-alt);
  color: var(--color-text-subtle);
  text-align: center;
}

@media (max-width: 1366px) {
  .heatmap-panel { min-height: 290px; }
  .heatmap-main { padding: var(--space-4); }
  .heatmap-grid-wrap {
    --heatmap-cell: 16px;
    --heatmap-gap: 4px;
  }
}

@media (max-width: 1024px) {
  .heatmap-summary,
  .activity-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .heatmap-main {
    align-items: stretch;
    padding: var(--space-4);
  }
  .heatmap-grid-shell {
    justify-content: flex-start;
  }
  .heatmap-grid-wrap {
    --heatmap-cell: 15px;
    --heatmap-gap: 4px;
  }
  .heatmap-legend {
    justify-content: center;
    width: 100%;
  }
  .heatmap-summary,
  .activity-summary-grid {
    grid-template-columns: 1fr;
  }
}
