/* ==========================================================================
   Author Monitoring Dashboard — Base, layout shell & core components
   ========================================================================== */

/* ---- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
::selection { background: var(--accent-soft); }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Slim, theme-aware scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 200;
  background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-md);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 8px; }

/* ---- App shell ------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns var(--dur) var(--ease);
}
.app.sidebar-collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

.main-col { display: flex; flex-direction: column; min-width: 0; }

/* "View as" — shown above the navbar while a Super Admin previews another role. */
.preview-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px clamp(12px, 2vw, 24px);
  background: var(--warning-soft); color: var(--warning-text);
  border-bottom: 1px solid var(--warning);
  font-size: var(--fs-sm); line-height: 1.45;
}
.preview-bar .grow { flex: 1 1 260px; min-width: 0; }
.preview-bar strong { font-weight: 650; }
.preview-bar .btn { flex: none; }

/* Bulk actions bar (components.js → BulkBar). Below menus (120), so the
   dropdowns it opens sit on top of it. */
.bulk-bar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 110;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  width: max-content; max-width: calc(100vw - 32px);
  padding: 8px 10px 8px 16px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.bulk-bar[hidden] { display: none; }
.bulk-count { font-size: var(--fs-sm); font-weight: 600; margin-right: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bulk-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.has-bulk-bar .page { padding-bottom: 110px; }
.has-bulk-bar .toast-region { bottom: var(--bulk-bar-space, 84px); }
@media (max-width: 640px) {
  .bulk-bar { left: 12px; right: 12px; bottom: 12px; transform: none; width: auto; justify-content: flex-start; }
}

/* A confirmation that lists every item it will touch (components.js → confirmList). */
.confirm-list {
  margin: 0; padding: 8px 12px 8px 28px; max-height: 280px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  font-size: var(--fs-sm); line-height: 1.5; color: var(--ink);
}
.confirm-list li + li { margin-top: 3px; }

.page {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 24px clamp(16px, 3vw, 32px) 48px;
  flex: 1;
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-head h1 { font-size: var(--fs-xl); letter-spacing: -0.01em; }
.page-head .sub { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- Sidebar ----------------------------------------------------------------- */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
  z-index: 60;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--navbar-h); flex-shrink: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.brand-mark {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius);
  font-weight: 700; font-size: var(--fs-sm);
}
.brand-name { font-weight: 650; font-size: var(--fs-base); letter-spacing: -0.01em; overflow: hidden; }
.brand-name small { display: block; font-weight: 400; font-size: var(--fs-xs); color: var(--ink-3); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-section { margin-bottom: 14px; }
.nav-section-label {
  padding: 6px 10px 4px; font-size: var(--fs-xs); font-weight: 600;
  color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap; overflow: hidden;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; margin: 1px 0;
  border-radius: var(--radius);
  color: var(--ink-2); font-size: var(--fs-base);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.nav-item svg { flex-shrink: 0; }
.nav-item .nav-badge { margin-left: auto; }

.sidebar-foot { padding: 10px 8px; border-top: 1px solid var(--border); }

.app.sidebar-collapsed .brand-name,
.app.sidebar-collapsed .nav-section-label,
.app.sidebar-collapsed .nav-item span { display: none; }
.app.sidebar-collapsed .nav-item { justify-content: center; padding: 9px; }

/* Mobile: sidebar becomes an off-canvas drawer (see responsive.css) */
.sidebar-scrim { display: none; }

/* ---- Navbar --------------------------------------------------------------------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  height: var(--navbar-h);
  padding: 0 clamp(12px, 2vw, 24px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar .spacer { flex: 1; }

.global-search-btn {
  display: flex; align-items: center; gap: 8px;
  min-width: min(300px, 30vw);
  padding: 6px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--ink-3);
  font-size: var(--fs-sm); cursor: pointer; text-align: left;
  transition: border-color var(--dur-fast) var(--ease);
}
.global-search-btn:hover { border-color: var(--border-strong); }
.global-search-btn kbd { margin-left: auto; }

kbd {
  font-family: var(--font-sans); font-size: var(--fs-xs);
  background: var(--surface-2); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: var(--radius-sm);
  padding: 1px 6px; color: var(--ink-2);
}

/* ---- Buttons ----------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--fs-base); font-weight: 500;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn-danger:hover { background: var(--critical-text); border-color: var(--critical-text); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { padding: 4px 10px; font-size: var(--fs-sm); border-radius: var(--radius-sm); }
.btn-icon {
  padding: 7px; width: 34px; height: 34px;
  border-color: transparent; background: transparent; color: var(--ink-2);
}
.btn-icon:hover { background: var(--surface-2); color: var(--ink); }
.btn-block { width: 100%; }

.btn .spin { animation: rotate 0.9s linear infinite; }

/* ---- Cards ---------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-head h2, .card-head h3 { font-size: var(--fs-base); font-weight: 600; }
.card-head .hint { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--ink-2); }

/* ---- Badges / chips / status --------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--radius-full);
  font-size: var(--fs-xs); font-weight: 550; line-height: 1.6;
  background: var(--surface-2); color: var(--ink-2);
  white-space: nowrap;
}
.badge-good     { background: var(--good-soft);     color: var(--good-text); }
.badge-warning  { background: var(--warning-soft);  color: var(--warning-text); }
.badge-serious  { background: var(--serious-soft);  color: var(--serious-text); }
.badge-critical { background: var(--critical-soft); color: var(--critical-text); }
.badge-accent   { background: var(--accent-soft);   color: var(--accent); }

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-3); flex-shrink: 0; display: inline-block;
}
.status-dot.online   { background: var(--good); }
.status-dot.offline  { background: var(--critical); }
.status-dot.warning  { background: var(--warning); }
.status-dot.pulse::after {
  content: ""; display: block; width: 100%; height: 100%;
  border-radius: 50%; background: inherit;
  animation: ping 1.8s var(--ease) infinite;
}

/* ---- Avatar --------------------------------------------------------------------------------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  font-size: var(--fs-xs); font-weight: 650;
  overflow: hidden; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; font-size: var(--fs-lg); }
.avatar-sm { width: 26px; height: 26px; font-size: 0.625rem; }

/* ---- Dropdown menu ---------------------------------------------------------------------------- */
.menu {
  position: fixed; z-index: 120;
  min-width: 190px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: menu-in var(--dur-fast) var(--ease);
}
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 10px; border: 0; border-radius: var(--radius);
  background: none; color: var(--ink); font-size: var(--fs-base);
  cursor: pointer; text-align: left;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item.danger { color: var(--critical-text); }
.menu-item:disabled { opacity: 0.45; cursor: default; }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.menu-label { padding: 6px 10px 3px; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; }
.menu-item .check { margin-left: auto; color: var(--accent); font-weight: 700; }

/* ---- Modal --------------------------------------------------------------------------------------- */
.modal-scrim {
  position: fixed; inset: 0; z-index: 130;
  background: var(--scrim);
  display: grid; place-items: center; padding: 20px;
  animation: fade-in var(--dur) var(--ease);
}
.modal {
  width: 100%; max-width: 520px; max-height: min(86vh, 720px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: modal-in var(--dur) var(--ease);
}
.modal.modal-lg { max-width: 780px; }
.modal.modal-sm { max-width: 400px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-head h2 { font-size: var(--fs-md); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--border); flex-shrink: 0;
}

/* ---- Toasts ----------------------------------------------------------------------------------------- */
.toast-region {
  position: fixed; bottom: 20px; right: 20px; z-index: 150;
  display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 40px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  animation: toast-in var(--dur-slow) var(--ease);
}
.toast.leaving { animation: toast-out var(--dur) var(--ease) forwards; }
.toast .toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast .toast-title { font-weight: 600; }
.toast .toast-msg { color: var(--ink-2); margin-top: 1px; }
.toast.success .toast-icon { color: var(--good-text); }
.toast.error   .toast-icon { color: var(--critical-text); }
.toast.warning .toast-icon { color: var(--warning-text); }
.toast.info    .toast-icon { color: var(--accent); }

/* ---- Tabs -------------------------------------------------------------------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  padding: 9px 14px; border: 0; background: none; cursor: pointer;
  font-size: var(--fs-base); font-weight: 500; color: var(--ink-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel[hidden] { display: none; }

/* Pill-style segmented control (chart range switchers) */
.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border-radius: var(--radius);
}
.seg button {
  padding: 4px 11px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---- Accordion ------------------------------------------------------------------------------------------ */
.accordion { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.accordion details + details { border-top: 1px solid var(--border); }
.accordion summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px; cursor: pointer; font-weight: 550; list-style: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; color: var(--ink-3); font-size: var(--fs-lg); }
.accordion details[open] summary::after { content: "–"; }
.accordion .accordion-body { padding: 0 16px 14px; color: var(--ink-2); font-size: var(--fs-sm); }

/* ---- Empty state / skeleton / spinner ---------------------------------------------------------------------- */
.empty-state {
  display: grid; place-items: center; text-align: center;
  padding: 48px 24px; color: var(--ink-2);
}
.empty-state .empty-icon {
  width: 52px; height: 52px; border-radius: var(--radius-lg);
  display: grid; place-items: center; margin-bottom: 14px;
  background: var(--surface-2); color: var(--ink-3);
}
.empty-state h3 { color: var(--ink); font-size: var(--fs-md); margin-bottom: 4px; }
.empty-state p { font-size: var(--fs-sm); max-width: 40ch; margin-bottom: 16px; }

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  color: transparent !important; user-select: none;
}

/* ---- Skeleton composition ------------------------------------------------------
 * Placeholders mirror the real layout they replace (same grid, same tile padding,
 * same row rhythm) so nothing jumps when the content swaps in. Marked
 * aria-hidden + aria-busy on the region by the JS helpers in components.js.
 * ------------------------------------------------------------------------------ */
/* Hides the real content while its placeholder is up. Uses !important because
   the hosts it is applied to (.stat-grid, .widget-grid, .table-card) set their
   own display, which would otherwise win over the [hidden] UA rule. */
.sk-hidden { display: none !important; }

.skeleton-line { height: 11px; border-radius: var(--radius-full); }
.skeleton-line + .skeleton-line { margin-top: 8px; }
.skeleton-line.sk-xs { height: 9px; }
.skeleton-line.sk-lg { height: 15px; }
.skeleton-line.w-25 { width: 25%; }
.skeleton-line.w-33 { width: 33%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-66 { width: 66%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-circle { border-radius: 50%; flex-shrink: 0; width: 30px; height: 30px; }

/* Stat tile placeholder — matches .stat-tile padding so the grid height holds */
.sk-tile { padding: 16px 18px; }
.sk-tile .sk-value { height: 26px; width: 58%; margin-top: 10px; border-radius: var(--radius-sm); }
.sk-tile .sk-delta { height: 9px; width: 40%; margin-top: 10px; border-radius: var(--radius-full); }

/* Chart body placeholder — a soft bar silhouette rather than a flat block, so a
   loading chart still reads as a chart. Heights are deterministic, not random. */
.sk-chart { display: flex; align-items: flex-end; gap: 6px; width: 100%; }
.sk-chart > span { flex: 1; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }

/* Table placeholder rows */
.sk-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.sk-row:last-child { border-bottom: 0; }
.sk-row > .skeleton-line { flex: 1; margin-top: 0; }

/* Feed / leaderboard placeholder */
.sk-feed-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.sk-feed-item:last-child { border-bottom: 0; }
.sk-feed-item .sk-feed-body { flex: 1; min-width: 0; }

/* Respect reduced motion: hold a static wash instead of shimmering. */
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--surface-2); }
}

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--surface-3); border-top-color: var(--accent);
  animation: rotate 0.8s linear infinite;
}
.spinner-lg { width: 30px; height: 30px; border-width: 3px; }

.progress {
  height: 6px; border-radius: var(--radius-full);
  background: var(--surface-3); overflow: hidden;
}
.progress-bar {
  height: 100%; border-radius: var(--radius-full);
  background: var(--accent); width: 0;
  transition: width var(--dur-slow) var(--ease);
}

/* ---- First-run boot overlay ------------------------------------------------------
 * Shown once per session on the first authenticated page load while the shared
 * config, cached data and initial WordPress sync come up. Steps are checklist
 * rows so the wait is legible rather than an opaque spinner.
 * ---------------------------------------------------------------------------------- */
.boot-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(800px 420px at -10% 110%, var(--accent-soft), transparent 55%),
    var(--bg);
  animation: fade-in var(--dur) var(--ease);
}
.boot-overlay.leaving { animation: fade-out var(--dur-slow) var(--ease) forwards; }

.boot-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 28px 26px 24px;
}
.boot-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.boot-brand .brand-mark { width: 38px; height: 38px; font-size: var(--fs-base); }
.boot-brand h2 { font-size: var(--fs-md); letter-spacing: -0.01em; }
.boot-brand p { font-size: var(--fs-xs); color: var(--ink-3); }

.boot-progress { margin-bottom: 18px; }
.boot-progress .progress { height: 5px; }
.boot-pct {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: var(--fs-xs); color: var(--ink-3); margin-top: 8px;
}
.boot-pct .boot-phase { color: var(--ink-2); font-weight: 500; }

.boot-steps { display: flex; flex-direction: column; gap: 2px; }
.boot-step {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; font-size: var(--fs-sm); color: var(--ink-3);
  transition: color var(--dur) var(--ease);
}
.boot-step .boot-step-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  display: grid; place-items: center;
}
.boot-step .boot-step-icon .spinner { width: 14px; height: 14px; border-width: 2px; }
.boot-step .boot-step-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--surface-3);
}
.boot-step[data-state="active"] { color: var(--ink); }
.boot-step[data-state="done"]   { color: var(--ink-2); }
.boot-step[data-state="done"] .boot-step-icon { color: var(--good-text); }
.boot-step[data-state="skip"] .boot-step-icon { color: var(--ink-3); }
.boot-step[data-state="fail"] { color: var(--critical-text); }
.boot-step .boot-step-note { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-3); }

.boot-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: var(--fs-xs); color: var(--ink-3);
}
.boot-skip {
  background: none; border: 0; padding: 4px; cursor: pointer;
  font-size: var(--fs-xs); color: var(--accent);
  text-decoration: underline; text-underline-offset: 2px;
}
.boot-skip:hover { color: var(--ink); }

@media (max-width: 480px) {
  .boot-overlay { place-items: start center; padding: 14px; }
  .boot-card { padding: 22px 18px 18px; }
}

/* ---- Sync-complete dialog ------------------------------------------------------- */
.sync-done-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px; margin: 16px 0 4px;
}
.sync-done-metric {
  padding: 11px 13px; border-radius: var(--radius);
  background: var(--surface-2); text-align: center;
}
.sync-done-metric .m-value { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.01em; }
.sync-done-metric .m-label { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }

/* ---- Breadcrumb --------------------------------------------------------------------------------------------- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-3); }
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--ink); text-decoration: none; }
.breadcrumb .sep { user-select: none; }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 500; }

/* ---- Utility classes ------------------------------------------------------------------------------------------ */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.wrap        { flex-wrap: wrap; }
.gap-1 { gap: 4px; }  .gap-2 { gap: 8px; }  .gap-3 { gap: 12px; }  .gap-4 { gap: 16px; }  .gap-6 { gap: 24px; }
.grid        { display: grid; }
.grow        { flex: 1; min-width: 0; }
.mt-2 { margin-top: 8px; }  .mt-4 { margin-top: 16px; }  .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }  .mb-4 { margin-bottom: 16px; }
.text-sm    { font-size: var(--fs-sm); }
.text-xs    { font-size: var(--fs-xs); }
.text-2     { color: var(--ink-2); }
.text-3     { color: var(--ink-3); }
.text-good  { color: var(--good-text); }
.text-bad   { color: var(--critical-text); }
.font-med   { font-weight: 500; }
.font-semi  { font-weight: 600; }
.mono       { font-family: var(--font-mono); font-size: var(--fs-xs); }
.tnum       { font-variant-numeric: tabular-nums; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden     { display: none !important; }
.divider    { height: 1px; background: var(--border); border: 0; }

/* ---- Keyframes ---------------------------------------------------------------------------------------------------- */
@keyframes fade-in  { from { opacity: 0; } }
@keyframes fade-out { to   { opacity: 0; visibility: hidden; } }
@keyframes menu-in  { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes toast-out { to  { opacity: 0; transform: translateX(24px); } }
@keyframes shimmer  { to { background-position: -200% 0; } }
@keyframes rotate   { to { transform: rotate(360deg); } }
@keyframes ping     { 75%, 100% { transform: scale(2.4); opacity: 0; } }

/* ---- Print: used by the PDF report export ---------------------------------------------------------------------------- */
@media print {
  .sidebar, .navbar, .page-actions, .toast-region, .no-print { display: none !important; }
  .app { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; break-inside: avoid; }
}
