/* Dashboard-specific styles, on top of style.css */

:root {
  --amber: #f7b750;
  --card-hover: #1c222b;
}

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot.loading { background: var(--text-muted); animation: pulse 1.2s infinite; }
.dot.ok      { background: var(--green); }
.dot.warn    { background: var(--amber); }
.dot.err     { background: var(--red); }
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* Metric grid */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  transition: border-color 0.2s;
}
.metric:hover { border-color: var(--accent-dim); }
.metric.wide { grid-column: span 2; }
@media (max-width: 480px) {
  .metric.wide { grid-column: span 1; }
}

.m-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.m-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.m-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Progress bar */
.bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.6rem;
}
.bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.4s ease, background 0.2s;
  width: 0;
}
.bar-fill.warn { background: var(--amber); }
.bar-fill.crit { background: var(--red); }

/* Disks */
.disk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.disk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
}
.disk-card h3 {
  font-size: 1rem;
  margin: 0 0 0.3rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.disk-card .disk-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}
.disk-card .disk-usage {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-top: 0.4rem;
}
.disk-card .disk-usage .pct {
  font-weight: 600;
  color: var(--text);
}
.disk-card.offline { opacity: 0.6; }
.disk-card .health-ok { color: var(--green); font-weight: 600; }
.disk-card .health-warn { color: var(--amber); font-weight: 600; }
.disk-card .health-err { color: var(--red); font-weight: 600; }

/* Drive cards (SMART) */
.disk-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  margin-bottom: 1rem;
}
.drive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.drive-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  font-size: 0.88rem;
  border-left: 3px solid var(--green);
}
.drive-card.warn { border-left-color: var(--amber); }
.drive-card.crit { border-left-color: var(--red); }
.drive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.drive-head .drive-model {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drive-head .drive-health {
  flex-shrink: 0;
  font-weight: 600;
}
.drive-health.ok  { color: var(--green); }
.drive-health.err { color: var(--red); }
.drive-serial {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}
.drive-rows {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
  font-size: 0.85rem;
}
.drive-rows .k { color: var(--text-muted); }
.drive-rows .v { color: var(--text); font-variant-numeric: tabular-nums; }
.drive-rows .v.err { color: var(--red); font-weight: 600; }
.drive-rows .v.warn { color: var(--amber); font-weight: 600; }
.drive-rows .v.ok { color: var(--green); }
.drive-wear {
  margin-top: 0.7rem;
}
.drive-wear .wear-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.drive-errors-banner {
  margin-top: 0.7rem;
  background: rgba(248, 81, 73, 0.12);
  color: var(--red);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* GPU cards */
.gpu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.gpu-card.nvidia { border-left: 4px solid #76b900; }
.gpu-card.amd    { border-left: 4px solid #ed1c24; }

.gpu-head {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.gpu-head .gpu-title {
  flex: 1;
  min-width: 200px;
}
.gpu-head h3 {
  font-size: 1.3rem;
  margin: 0;
  color: var(--text);
}
.gpu-head .gpu-role {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}
.gpu-head .gpu-temp {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.gpu-vram {
  margin-bottom: 1.2rem;
}
.gpu-vram .vram-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.gpu-vram .vram-row strong { color: var(--text); }

.gpu-util-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}
.util-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.8rem;
  text-align: center;
}
.util-box .util-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.util-box .util-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.util-box .util-peak {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.util-box.hot .util-value { color: var(--amber); }
.util-box.crit .util-value { color: var(--red); }
.util-box.now { background: rgba(88, 166, 255, 0.08); border-color: var(--accent-dim); }

.sparkline-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.spark-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.8rem;
}
.spark-card .spark-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
}
.spark-card svg {
  width: 100%;
  height: 48px;
  display: block;
}

/* Services */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
}
.service-card h3 {
  font-size: 1rem;
  margin: 0 0 0.8rem;
  color: var(--text);
}
.service-big {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.6rem;
}
.service-rows .svc-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.service-rows .svc-row:first-child { border-top: none; }
.service-rows .svc-row strong { color: var(--text); }
.svc-ok   { color: var(--green); }
.svc-err  { color: var(--red); }

/* Responsive tweaks */
@media (max-width: 500px) {
  .m-value { font-size: 1.3rem; }
  .util-box .util-value { font-size: 1.4rem; }
  .gpu-card { padding: 1rem; }
}
