/* App Updater feature styles. Layout mirrors the Backup page: shared
   .sidebar/.category + .page-header chrome, with an updater-owned .config-section
   card + padded body. Content widgets (stat grid, rows, badges, CVEs) are
   updater-specific. Uses the shared palette tokens + the --page-updater hue
   set on #updater-page. Eager-linked from index.html. */

/* ---- Layout (copied from .backup-* so the two pages match exactly) ---- */
.updater-layout {
  display: flex;
  min-height: calc(100vh - var(--topbar-height, 60px));
}
.updater-layout .main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}
.updater-page {
  color: var(--text-primary);
  width: 100%;
  padding-bottom: 48px;
}
/* One .config-section card holding the .page-header (flush, its border acts as
   the divider) + the body, which carries the padding. */
.updater-page-section {
  padding: 0;
  overflow: hidden;
}
.updater-page-section > .page-header {
  margin-bottom: 0;
}
.updater-page-body {
  padding: 22px;
}
/* The page-header icon tints with the page hue. */
#updater-page .page-header-icon-slot {
  color: rgb(var(--page-rgb, var(--accent-rgb)));
}

/* ---- Overview stat cards ---- */
.updater-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.updater-stat {
  position: relative; padding: 18px; border-radius: 14px;
  background: rgba(var(--text-rgb), 0.035);
  border: 1px solid rgba(var(--page-rgb, var(--accent-rgb)), 0.22);
}
.updater-stat-big { font-size: 2rem; font-weight: 700; line-height: 1; color: rgb(var(--page-rgb, var(--accent-rgb))); }
.updater-stat-label { margin-top: 6px; font-weight: 600; font-size: 0.9rem; }
.updater-stat-sub { color: rgba(var(--text-rgb), 0.5); font-size: 0.78rem; margin-top: 2px; }
.updater-stat .updater-btn { margin-top: 12px; }

/* ---- Lists / rows ---- */
.updater-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.updater-list { display: flex; flex-direction: column; gap: 8px; }
.updater-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px;
  padding: 12px 15px; border-radius: 11px;
  background: rgba(var(--text-rgb), 0.035);
  border: 1px solid rgba(var(--text-rgb), 0.07);
}
.updater-row-name { font-weight: 600; }
.updater-row-ver { color: rgba(var(--text-rgb), 0.6); font-family: var(--font-mono); font-size: 0.8rem; }
.updater-arrow { color: rgb(var(--page-rgb, var(--accent-rgb))); }

/* ---- Badges ---- */
.updater-badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  vertical-align: middle; margin-left: 6px;
}
.updater-badge-update { background: rgba(var(--page-updater-rgb), 0.18); color: rgb(var(--page-updater-rgb)); }
.updater-badge-ok { background: rgba(var(--page-verify-rgb), 0.16); color: rgb(var(--page-verify-rgb)); }
.updater-badge-unknown { background: rgba(var(--text-rgb), 0.1); color: rgba(var(--text-rgb), 0.55); }
.sev-critical { background: rgba(220, 38, 38, 0.18); color: #f87171; }
.sev-high { background: rgba(234, 88, 12, 0.18); color: #fb923c; }
.sev-medium { background: rgba(234, 179, 8, 0.16); color: #fcd34d; }
.sev-low { background: rgba(var(--text-rgb), 0.1); color: rgba(var(--text-rgb), 0.6); }

/* ---- CVE blocks ---- */
.updater-cve-app { padding: 12px 15px; border-radius: 11px; background: rgba(var(--text-rgb), 0.035); border: 1px solid rgba(var(--text-rgb), 0.07); }
.updater-cve-app-name { font-weight: 600; margin-bottom: 8px; }
.updater-cve { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid rgba(var(--text-rgb), 0.06); font-size: 0.82rem; }
.updater-cve-sev { font-weight: 700; font-size: 0.66rem; min-width: 58px; }
.updater-cve.sev-critical .updater-cve-sev { color: #f87171; }
.updater-cve.sev-high .updater-cve-sev { color: #fb923c; }
.updater-cve.sev-medium .updater-cve-sev { color: #fcd34d; }
.updater-cve-id { font-family: var(--font-mono); color: rgb(var(--page-rgb, var(--accent-rgb))); text-decoration: none; }
.updater-cve-id:hover { text-decoration: underline; }
.updater-cve-pkg { color: rgba(var(--text-rgb), 0.6); }
.updater-cve-fix { margin-left: auto; color: rgba(var(--page-verify-rgb), 0.9); font-size: 0.76rem; }

/* ---- Buttons ---- */
.updater-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 9px; cursor: pointer; font-size: 0.82rem; font-weight: 600;
  background: rgba(var(--text-rgb), 0.07); color: rgba(var(--text-rgb), 0.9);
  border: 1px solid rgba(var(--text-rgb), 0.12); transition: background 0.15s, border-color 0.15s;
}
.updater-btn:hover { background: rgba(var(--text-rgb), 0.12); }
.updater-btn-primary {
  background: rgba(var(--page-rgb, var(--accent-rgb)), 0.2);
  border-color: rgba(var(--page-rgb, var(--accent-rgb)), 0.45);
  color: rgb(var(--page-rgb, var(--accent-rgb)));
}
.updater-btn-primary:hover { background: rgba(var(--page-rgb, var(--accent-rgb)), 0.3); }

/* ---- Hints / empty states ---- */
.updater-hint { padding: 12px 15px; border-radius: 11px; margin-bottom: 14px; font-size: 0.84rem;
  background: rgba(var(--page-rgb, var(--accent-rgb)), 0.08); border: 1px solid rgba(var(--page-rgb, var(--accent-rgb)), 0.2); color: rgba(var(--text-rgb), 0.75); }
.updater-empty { padding: 40px 20px; text-align: center; color: var(--text-secondary); display: flex; flex-direction: column; gap: 14px; align-items: center; }

@media (max-width: 600px) {
  .updater-row { grid-template-columns: 1fr; gap: 6px; }
}
