/* admin-dashboard.css — the /admin landing: a grid of section cards. Loaded
   with app.css + admin-shell.css. */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.dash-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.dash-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.dash-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.dash-card-title { font-size: 1.05rem; font-weight: 600; }
.dash-card-count {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  padding: 2px var(--space-2);
  border-radius: var(--radius);
  background: var(--accent-glow);
  color: var(--accent);
}
/* Live activity badge (e.g. a running prune) — distinct from numeric counts. */
.dash-card-count--live {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--danger-bg, var(--accent-glow));
  color: var(--danger, var(--accent));
  animation: dash-live-pulse 1.6s ease-in-out infinite;
}
@keyframes dash-live-pulse { 50% { opacity: 0.55; } }

.dash-card-desc { font-size: 14px; color: var(--text-muted); line-height: 1.45; }

/* ── Storage panel ── */
/* Sits below the Overview tiles; give it clear breathing room from the grid. */
.storage-section { margin-top: var(--space-6); }

.storage-card {
  margin-top: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Usage meter: one filled segment per category (audio, images, …), then the
   rest of the disk's used space; the remaining track is free space. Category
   segment/swatch colors are set inline from JS using these vars (theme-aware).
   Fallbacks cover any future category the server adds before the UI knows it. */
.storage-card {
  --storage-cat-images: #4f9ad6;
  --storage-cat-review: #d6b24f;
  --storage-cat-trash:  #b06a78;
  --storage-cat-video:  #d68f4f;
  --storage-cat-alt1:   #9b7fd6;
  --storage-cat-alt2:   #4fb59a;
  --storage-cat-alt3:   #d6678a;
}
.storage-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.storage-bar-seg { height: 100%; transition: width 200ms ease; }
.storage-bar-other { background: var(--text-muted); opacity: 0.55; }

.storage-headline {
  margin: var(--space-3) 0 0;
  font-size: 15px;
  color: var(--text);
}
.storage-headline strong { font-weight: 600; }
.storage-headline span { color: var(--text-muted); }

.storage-note {
  margin: 0 0 var(--space-3);
  font-size: 14px;
  color: var(--text-muted);
}

/* Detail rows: label (with a colour swatch keyed to the bar) + value. */
.storage-detail {
  margin: var(--space-4) 0 0;
  display: grid;
  grid-template-columns: auto auto;
  gap: var(--space-2) var(--space-5);
  justify-content: start;
}
.storage-detail-row { display: contents; }
.storage-detail dt {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-muted);
}
.storage-detail dd {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.storage-loc {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
}

.storage-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.storage-swatch--other { background: var(--text-muted); opacity: 0.55; }
