/* ═══════════════════════════════════════════
   DASHBOARD — Monitoring Design
   ═══════════════════════════════════════════ */

.dash-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.dash-breadcrumb {
  margin-bottom: 20px;
}
.dash-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.dash-crumb {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ─── Top Stats Bar (Bento NOC KPI Cards) ─── */
.dash-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.dash-stat-card {
  background: var(--bg-card, #13151C);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.dash-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dash-stat-mid {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-stat-bar-full {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.dash-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
}
.dash-stat-card.kpi-online::before { background: #10B981; }
.dash-stat-card.kpi-los::before { background: #F43F5E; }
.dash-stat-card.kpi-dying::before { background: #F59E0B; }
.dash-stat-card.kpi-olt::before { background: #6366F1; }
.dash-stat-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  transform: translateY(-1px);
}
.dash-stat-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-stat-right {
  text-align: right;
}
.dash-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.dash-stat-icon.olt-icon { background: rgba(99, 102, 241, 0.14); color: #818CF8; }
.dash-stat-icon.online-icon { background: rgba(16, 185, 129, 0.14); color: #34D399; }
.dash-stat-icon.dying-icon { background: rgba(245, 158, 11, 0.14); color: #FBBF24; font-size: 1rem; }
.dash-stat-icon.los-icon { background: rgba(244, 63, 94, 0.14); color: #FB7185; }
.dash-stat-icon.offline-icon { background: rgba(148, 163, 184, 0.12); color: #94A3B8; }

.dash-stat-value {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-variant-numeric: tabular-nums;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.05;
}
.dash-stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.dash-stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.dash-stat-bar {
  width: 80px;
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0;
}
.dash-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}
.dash-bar-fill.green { background: #10b981; }
.dash-bar-fill.orange { background: #f59e0b; }
.dash-bar-fill.red { background: #f43f5e; }
.dash-stat-pct {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── OLT Cards ─── */
.olt-cards-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.olt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  transition: all 0.2s ease;
}
.olt-card:hover {
  border-color: rgba(59,130,246,0.15);
}

.olt-card-header {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  gap: 24px;
  flex-wrap: wrap;
}
.olt-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 220px;
}
.olt-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(59,130,246,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.olt-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.olt-type {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.olt-uptime {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.olt-badge {
  font-size: 0.68rem;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.3px;
}
.olt-badge.online {
  background: rgba(16,185,129,0.1);
  color: #34d399;
  border: 1px solid rgba(16,185,129,0.25);
}
.olt-badge.offline {
  background: rgba(244,63,94,0.1);
  color: #fb7185;
  border: 1px solid rgba(244,63,94,0.25);
}

.olt-stats-row {
  display: flex;
  gap: 20px;
  flex: 1;
  justify-content: center;
}
.olt-mini-stat {
  text-align: center;
  min-width: 55px;
}
.olt-mini-val {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-variant-numeric: tabular-nums;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
}
.olt-mini-val.highlight-green { color: #34d399; }
.olt-mini-val.highlight-red { color: #fb7185; }
.olt-mini-val.highlight-orange { color: #fbbf24; }
.olt-mini-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.olt-temp {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.22);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #f87171;
  white-space: nowrap;
}

/* ─── Fan Grid ─── */
.olt-card-body {
  padding: 16px 24px 20px;
}
.olt-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.fan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.fan-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  transition: all 0.2s ease;
}
.fan-card:hover {
  border-color: rgba(16,185,129,0.3);
  background: rgba(16,185,129,0.03);
}
.fan-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.fan-icon {
  font-size: 0.85rem;
}
.fan-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.fan-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: auto;
}
.fan-status-dot.online { background: #10b981; }
.fan-status-dot.offline { background: #f43f5e; }
.fan-status-text {
  font-size: 0.68rem;
  font-weight: 600;
}
.fan-status-text.online { color: #34d399; }
.fan-status-text.offline { color: #fb7185; }

.fan-speed {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-variant-numeric: tabular-nums;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.fan-rpm {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}
.fan-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.fan-bar-fill {
  height: 100%;
  background: #10b981;
  border-radius: 2px;
  transition: width 0.5s ease;
}
.fan-level {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ─── Circular Radial Ring Fan Gauge ─── */
.fan-card.fan-card-radial {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px 12px 10px;
}
.fan-ring-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 4px auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fan-ring-svg {
  display: block;
  overflow: visible;
}
.fan-ring-track {
  stroke: rgba(255, 255, 255, 0.07);
}
[data-theme="light"] .fan-ring-track {
  stroke: rgba(15, 23, 42, 0.09);
}
.fan-ring-progress {
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.28));
}
.fan-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 1.05;
}
.fan-ring-val {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-primary);
}
.fan-ring-unit {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 2px;
}

.fan-nodata {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.fan-nodata-badge {
  font-size: 0.72rem;
  color: #ef4444;
  background: rgba(239,68,68,0.1);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

/* ─── Responsive ─── */
@media (max-width: 1200px) {
  .dash-stats-bar { grid-template-columns: repeat(2, 1fr); }
  .olt-stats-row { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 768px) {
  .dash-stats-bar { grid-template-columns: 1fr; gap: 10px; }
  .dash-stat-card { padding: 14px 16px; }
  .olt-card-header { flex-direction: column; align-items: stretch; padding: 14px 16px; gap: 14px; }
  .olt-info { min-width: 0; }
  .olt-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
  .olt-mini-stat { min-width: 0; background: rgba(255,255,255,0.02); border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 6px; }
  .olt-temp { align-self: flex-start; }
  .olt-card-body { padding: 12px 16px 16px; }
  .fan-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
@media (max-width: 480px) {
  .dash-stats-bar { grid-template-columns: 1fr; }
}
