.cl-dashboard-wrapper {
  padding: 16px;
}

// ── KPI grid ──────────────────────────────────────────────────────────

.cl-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;

  @media (max-width: 900px) {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cl-kpi-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 16px;
  background: #fff;
  border-top: 4px solid transparent;

  &--blue  { border-top-color: #2563eb; }
  &--navy  { border-top-color: #1e3a8a; }
  &--amber { border-top-color: #f59e0b; }
  &--red   { border-top-color: #dc2626; }
  &--green { border-top-color: #059669; }
}

.cl-kpi-label {
  font-size: 10px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.cl-kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
}

// ── Period toggle ─────────────────────────────────────────────────────

.cl-period-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.cl-toggle-btn {
  padding: 5px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;

  &--active {
    background: #1e3a8a;
    color: #fff;
    border-color: #1e3a8a;
  }
}

// ── Chart row ─────────────────────────────────────────────────────────

.cl-chart-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 16px;

  @media (max-width: 700px) {
    grid-template-columns: 1fr;
  }
}

.cl-chart-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.cl-chart-title {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.cl-svg-chart {
  width: 100%;
  height: 200px;
}

.cl-chart-skeleton {
  height: 180px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e9eaec 50%, #f3f4f6 75%);
  background-size: 400% 100%;
  border-radius: 6px;
  animation: shimmer 1.4s ease infinite;
}

// ── Doughnut ──────────────────────────────────────────────────────────

.cl-doughnut-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cl-doughnut-svg {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.cl-doughnut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cl-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.cl-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cl-legend-label { flex: 1; color: #374151; }
.cl-legend-count { font-weight: 600; color: #111827; }

// ── Method breakdown bars ─────────────────────────────────────────────

.cl-method-section,
.cl-failures-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  margin-bottom: 12px;
}

.cl-method-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cl-method-label {
  min-width: 120px;
  font-size: 12px;
  color: #374151;
}

.cl-method-bar-track {
  flex: 1;
  height: 8px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}

.cl-method-bar {
  height: 100%;
  background: #1e3a8a;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.cl-method-count {
  min-width: 30px;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  text-align: right;
}

// ── Table (reuse log styles) ──────────────────────────────────────────

.cl-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;

  th {
    background: #f8fafc;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
  }

  td {
    padding: 8px 10px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
  }
}

.cl-empty-state {
  padding: 30px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

// ── RTL ───────────────────────────────────────────────────────────────

[dir="rtl"] {
  .cl-kpi-grid { direction: ltr; }
  .cl-chart-row { direction: ltr; }
  .cl-doughnut-wrap { flex-direction: row-reverse; }
  .cl-log-table th, .cl-log-table td { text-align: right; }
}

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
