/* Backup panel — modern light theme (round 3) */
:root,
body.theme-light {
  --font: "Inter", "Segoe UI", "Roboto", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --radius: 12px;
  --radius-xl: 16px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.06), 0 12px 32px rgba(83, 51, 237, 0.08);
  --shadow-soft: 0 4px 20px rgba(17, 24, 39, 0.06);
  --header-h: 3.25rem;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #5333ed;
  --accent-hover: #4527d4;
  --success: #15803d;
  --success-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --danger-hover: #991b1b;
  --info-bg: #ede9fe;
  --ring: rgba(83, 51, 237, 0.28);
  --header-bg: #ffffff;
  --sidebar-w: 252px;
  --hero-gradient: linear-gradient(135deg, #5333ed 0%, #7c3aed 45%, #8b5cf6 100%);
  --sidebar-gradient: linear-gradient(180deg, #faf8ff 0%, #f3f0ff 48%, #eef2ff 100%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root,
  body.theme-light {
    --bg: #0f1117;
    --surface: #181b24;
    --surface-2: #1f2430;
    --border: #2d3548;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --header-bg: #181b24;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.35);
    --sidebar-gradient: linear-gradient(180deg, #151820 0%, #12151c 100%);
    color-scheme: dark;
  }

  .page-hero-strip {
    box-shadow: 0 12px 40px rgba(83, 51, 237, 0.25);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

body.layout-auth {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 80% 0%, rgba(139, 92, 246, 0.18), transparent),
    radial-gradient(ellipse 60% 45% at 10% 100%, rgba(83, 51, 237, 0.12), transparent),
    var(--bg);
  z-index: 0;
}

.layout-auth .auth-wrap {
  position: relative;
  z-index: 1;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--header-bg, var(--surface));
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: grid;
  place-items: center;
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.host-pill {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .host-pill {
    display: none;
  }
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-gradient);
  border-right: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.85rem;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: background 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  padding: 0 0.35rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
  margin-bottom: 1rem;
}

.sidebar-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--hero-gradient);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(83, 51, 237, 0.35);
}

.sidebar-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0.35rem;
  font-weight: 600;
}

.site-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  text-transform: capitalize;
  transition: background 0.2s ease, box-shadow 0.2s ease, color 0.15s;
  border: 1px solid transparent;
}

.site-nav-link:hover {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  text-decoration: none;
}

.site-nav-link.is-active {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
  font-weight: 600;
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: 0 2px 8px rgba(83, 51, 237, 0.12);
}

.site-nav-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.site-nav-name {
  text-transform: capitalize;
}

.site-nav-host {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}

.site-avatar {
  --avatar-bg: var(--accent);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--avatar-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.site-avatar--lg {
  width: 3rem;
  height: 3rem;
  font-size: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
  box-shadow: 0 0 0 2px var(--surface);
}

.status-dot--ok {
  background: #22c55e;
}

.status-dot--stale {
  background: #f59e0b;
}

.status-dot--error {
  background: #ef4444;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--accent) 8%, var(--border));
}

.sidebar-user {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.55rem;
  row-gap: 0.05rem;
  padding: 0.65rem 0.5rem;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.sidebar-user-avatar {
  grid-row: 1 / span 2;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--hero-gradient);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
}

.sidebar-user-name {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: capitalize;
}

.sidebar-user-role {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-logout svg {
  width: 1rem;
  height: 1rem;
}

.btn-block {
  width: 100%;
}

.app-content {
  flex: 1;
  min-width: 0;
  background: var(--bg);
}

.app-main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.35rem 2.75rem;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-header__meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
}

.cache-meta {
  color: var(--text-muted);
}

.site-name-pill {
  display: inline-block;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--accent);
}

.cell-muted {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.type-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.25rem;
  border: 1px solid transparent;
}

.type-pill--daily {
  background: color-mix(in srgb, #7c3aed 18%, var(--surface));
  color: #6d28d9;
  border-color: color-mix(in srgb, #7c3aed 30%, transparent);
}

.type-pill--manual {
  background: color-mix(in srgb, #2563eb 15%, var(--surface));
  color: #1d4ed8;
  border-color: color-mix(in srgb, #2563eb 28%, transparent);
}

.type-pill--r2,
.type-pill--cloud {
  background: color-mix(in srgb, #0d9488 14%, var(--surface));
  color: #0f766e;
  border-color: color-mix(in srgb, #14b8a6 28%, transparent);
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.restore-dropdown,
.download-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.restore-dropdown summary,
.download-dropdown-wrap summary {
  list-style: none;
  cursor: pointer;
}

.restore-dropdown summary::-webkit-details-marker,
.download-dropdown-wrap summary::-webkit-details-marker {
  display: none;
}

.restore-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 168px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
  box-shadow: var(--shadow-soft);
}

.dropdown-label {
  margin: 0.15rem 0.45rem 0.35rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.restore-pick--live {
  color: var(--danger);
}

.restore-pick {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 4px;
}

.restore-pick:hover {
  background: var(--surface-2);
}

.modal-restore .restore-steps {
  margin: 0 0 1rem 1.1rem;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-restore .restore-steps li {
  margin-bottom: 0.5rem;
}

.auth-flash {
  max-width: 400px;
  margin: 1rem auto 0;
  padding: 0 1rem;
}

@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }

  .sidebar-nav {
    flex: 1;
  }

  .site-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .sidebar-foot {
    margin-top: 0;
    flex-direction: row;
    align-items: center;
  }
}

.page-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.page-sub {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.alert.ok {
  background: var(--success-bg);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
  color: var(--text);
}

.alert.error {
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
}

.btn-icon-only {
  padding: 0.4rem;
  min-width: 2.15rem;
}

.btn-hero {
  box-shadow: 0 4px 14px rgba(83, 51, 237, 0.35);
}

.page-hero-strip .btn-ghost {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.page-hero-strip .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-icon svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1rem;
}

.site-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.site-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.site-card__name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: capitalize;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-ok {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge-run {
  background: var(--info-bg);
  color: var(--accent);
}

.badge-fail {
  background: var(--danger-bg);
  color: var(--danger);
}

.meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.meta-list li:last-child {
  border-bottom: none;
}

.meta-list .label {
  color: var(--text-muted);
}

.meta-list .value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

.card-actions form {
  margin: 0;
}

/* Login */
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  border-radius: var(--radius-xl);
  padding: 2.15rem 1.85rem;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.auth-card .brand {
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.auth-card h1 {
  margin: 0 0 0.35rem;
  text-align: center;
  font-size: 1.35rem;
}

.auth-card .auth-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.auth-card .btn-primary {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.65rem;
}

/* Tables */
.data-table-wrap {
  overflow-x: auto;
  border: none;
  border-radius: 0;
  background: transparent;
}

table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  padding: 0.85rem 1.15rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.data-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  font-weight: 600;
}

.data-table tbody tr:hover td {
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table .col-num,
th.col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table code {
  font-size: 0.8rem;
}

/* Sections */
.section {
  margin-top: 2rem;
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.panel-jobs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.job-poll-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.job-poll-item:last-child {
  border-bottom: none;
}

.job-poll-item .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.log-pre {
  margin: 0;
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.breadcrumb {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.25s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.modal-warn {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  background: var(--warn-bg);
}

.modal-warn strong {
  color: var(--danger);
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.live-confirm {
  display: none;
}

.live-confirm.is-visible {
  display: block;
}

.download-menu {
  position: relative;
  display: inline-block;
}

.download-menu details summary {
  list-style: none;
  cursor: pointer;
}

.download-menu details summary::-webkit-details-marker {
  display: none;
}

.download-dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 20;
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem;
  box-shadow: var(--shadow);
}

.download-dropdown a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text);
}

.download-dropdown a:hover {
  background: var(--surface-2);
}

.job-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.job-status-bar strong {
  text-transform: capitalize;
}

.modal-backdrop[hidden] {
  display: none !important;
}

/* —— Kinsta-style backups layout —— */
.page-hero {
  margin-bottom: 1.25rem;
}

.page-hero h1 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-hero .page-sub {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.breadcrumb span.sep {
  opacity: 0.45;
}

.site-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.site-switcher select {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 2rem 0.4rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

@media (max-width: 900px) {
  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .stat-cards {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card__label {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-card__value {
  margin: 0.35rem 0 0;
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-card__value--sm {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.page-hero-strip {
  background: var(--hero-gradient);
  border-radius: var(--radius-xl);
  padding: 1.35rem 1.4rem 1rem;
  margin-bottom: 1.15rem;
  color: #fff;
  box-shadow: 0 12px 36px rgba(83, 51, 237, 0.28);
  position: relative;
  overflow: hidden;
}

.page-hero-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.15), transparent 55%);
  pointer-events: none;
}

.page-hero-strip__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-hero-strip__title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.page-hero-strip .page-title {
  margin: 0;
  color: #fff;
  font-size: 1.45rem;
}

.page-sub--hero {
  margin: 0.25rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.88);
}

.page-hero-strip .site-name-pill {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.site-live-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.82rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.site-live-link:hover {
  color: #fff;
  text-decoration: none;
  border-bottom-color: #fff;
}

.site-live-link svg {
  width: 0.9rem;
  height: 0.9rem;
}

.page-hero-strip__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.hero-form {
  margin: 0;
}

.page-hero-strip__meta {
  position: relative;
  z-index: 1;
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
}

.content-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.tab-bar {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: relative;
}

.tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 64px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  transition: transform 0.25s ease, width 0.25s ease;
  pointer-events: none;
}

.tab-bar button {
  flex-shrink: 0;
  margin: 0;
  padding: 0.85rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab-bar button:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.tab-bar button[aria-selected="true"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.tab-panel {
  display: none;
  padding: 0;
}

.tab-panel.is-active {
  display: block;
}

.panel-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.panel-section-head h2 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.panel-section-head p {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex: 1 1 100%;
}

.panel-section-head .head-actions {
  margin-left: auto;
}

.hint-box {
  margin: 1rem 1.15rem 0;
  padding: 0.75rem 0.9rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.backup-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.backup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.backup-row:last-child {
  border-bottom: none;
}

.backup-row__main {
  min-width: 0;
}

.backup-row__title {
  font-weight: 600;
  margin: 0;
}

.backup-row__meta {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.backup-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.empty-state {
  padding: 2rem 1.15rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.empty-state--illus {
  padding: 2.5rem 1.5rem 2.75rem;
}

.empty-state--page {
  margin-top: 3rem;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.empty-illus {
  width: 7.5rem;
  height: auto;
  margin: 0 auto 1rem;
  display: block;
  color: var(--accent);
}

.empty-state__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.empty-state__hint {
  margin: 0;
  max-width: 26rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.toast-stack .toast {
  pointer-events: auto;
}

.auth-flash.toast-stack {
  position: fixed;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  border: 1px solid transparent;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  animation: toast-in 0.35s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
}

.toast--ok {
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
  background: color-mix(in srgb, var(--success-bg) 90%, var(--surface));
}

.toast--error {
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  background: color-mix(in srgb, var(--danger-bg) 90%, var(--surface));
}

.toast-msg {
  flex: 1;
}

.toast-close {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 0.15rem;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.active-jobs-banner {
  margin-bottom: 1rem;
  padding: 0.65rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.site-grid .site-card {
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.site-grid .site-card:hover {
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
}

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

.settings-form {
  max-width: 36rem;
  padding: 1.25rem 0;
}

.checkbox-row,
.radio-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.checkbox-row input,
.radio-row input {
  width: auto;
  margin-top: 0.2rem;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.form-actions {
  margin-top: 1.25rem;
}

.settings-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}