/**
 * Expansion Stylesheet
 * ---------------------------------------------------------------------------
 * Dashboard خلاصه، پنل تنظیمات، و گزارش سلامت کنترلر (شامل استایل چاپ/PDF).
 */

/* ===================== Dashboard Summary ===================== */

.dashboard-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  max-width: 1480px;
  margin: 0 auto;
}

.dashboard-item {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 20px;
  background: var(--bg-raised);
  transition: background 0.15s ease;
}

.dashboard-item[data-jump]:hover {
  background: rgba(45, 226, 196, 0.06);
}

.dashboard-label {
  font-size: 10.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.dashboard-item strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* ===================== Settings Panel ===================== */

.settings-panel-root {
  position: fixed;
  top: 70px;
  left: 20px;
  z-index: 250;
  max-width: 340px;
}

.settings-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.settings-card h3 {
  margin: 0 0 14px;
  font-size: 14px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.settings-row-checkbox {
  cursor: pointer;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.settings-row input[type="number"] {
  width: 80px;
  background: var(--bg-base);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 4px 8px;
  font-family: var(--font-mono);
}

.settings-history-list {
  max-height: 160px;
  overflow-y: auto;
  margin: 8px 0;
}

.settings-history-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-faint);
}

/* ===================== Health Report ===================== */

.panel-health-report {
  grid-column: 1 / -1;
  border-color: rgba(45, 226, 196, 0.25);
}

.health-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.health-check-item {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
  color: var(--text-faint);
  transition: all 0.2s ease;
}

.health-check-item.checked {
  border-color: var(--signal-cyan);
  color: var(--signal-cyan);
  background: rgba(45, 226, 196, 0.08);
}

.health-check-item.checked::before {
  content: "✓ ";
}

.health-score-hero {
  text-align: center;
  padding: 24px 0;
}

.health-score-number {
  font-size: 64px;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
}

.health-score-grade {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.health-score-meta {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.health-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.health-breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  text-align: center;
}

.health-breakdown-item span {
  font-size: 11px;
  color: var(--text-faint);
}

.health-breakdown-item strong {
  font-size: 18px;
  font-family: var(--font-mono);
  color: var(--signal-cyan);
}

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

.health-warnings li {
  padding: 10px 14px;
  background: rgba(255, 182, 72, 0.08);
  border: 1px solid rgba(255, 182, 72, 0.25);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--signal-amber);
  line-height: 1.8;
}

/* ===================== Print / PDF Export ===================== */

@media print {
  body * {
    visibility: hidden;
  }
  #health-report-printable, #health-report-printable * {
    visibility: visible;
  }
  #health-report-printable {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    color: #000;
  }
  #health-report-printable .health-score-number,
  #health-report-printable .health-breakdown-item strong {
    color: #000 !important;
  }
  #health-report-printable .health-warnings li {
    background: #fff3e0;
    border-color: #ffb648;
    color: #7a4a00;
  }
  .no-print {
    display: none !important;
  }
}

@media (max-width: 980px) {
  .dashboard-item {
    flex: 1 1 45%;
  }
  .settings-panel-root {
    left: 8px;
    right: 8px;
    max-width: none;
  }
}
